Struct yew_tou_rs::prelude::TourConfig

source ·
pub struct TourConfig {
    pub id: Option<String>,
    pub steps: Vec<TourStep>,
}
Expand description

Configuration for a tour.

TourConfig holds all the necessary information to define and run a tour, including an optional identifier and a list of steps.

§Fields

  • id - An optional unique identifier for the tour.
  • steps - A vector of TourSteps that define the content and order of the tour.

§Examples

use yew_tou_rs::prelude::{TourConfig, TourStep};

let config = TourConfig {
    id: Some("main-tour".to_string()),
    steps: vec![
        TourStep {
            selector: ".intro-element".to_string(),
            content: "Welcome to the tour!".to_string(),
        },
        TourStep {
            selector: "#feature-button".to_string(),
            content: "Click here to see our main feature.".to_string(),
        },
    ],
};

§Yew Properties

This struct derives Properties, allowing it to be used as properties for Yew components.

§Serialization

TourConfig can be serialized and deserialized, which is useful for storing configurations or passing them between different parts of your application.

§Clone and Debug

This struct can be cloned and easily printed for debugging purposes.

Fields§

§id: Option<String>

An optional unique identifier for the tour.

This can be used to distinguish between different tours in your application or to persist tour state. If not provided, a default value may be used.

The #[prop_or_default] attribute means this field will use its default value (None) if not explicitly set when creating a TourConfig instance in a Yew component.

§steps: Vec<TourStep>

A vector of steps that define the content and order of the tour.

Each step is represented by a TourStep struct, which includes information about what element to highlight and what content to display for that step.

Trait Implementations§

source§

impl Clone for TourConfig

source§

fn clone(&self) -> TourConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TourConfig

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for TourConfig

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl PartialEq for TourConfig

source§

fn eq(&self, other: &TourConfig) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Properties for TourConfig

§

type Builder = TourConfigBuilder

Builder that will be used to construct properties
source§

fn builder() -> Self::Builder

Entrypoint for building properties
source§

impl Serialize for TourConfig

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl StructuralPartialEq for TourConfig

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromQuery for T

§

type Target = T

Target type after parsing.
§

type Error = HistoryError

Error that can occur while parsing.
§

fn from_query( query: &str, ) -> Result<<T as FromQuery>::Target, <T as FromQuery>::Error>

Decode this query string into the target type.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> IntoPropValue<Option<T>> for T

§

fn into_prop_value(self) -> Option<T>

Convert self to a value of a Properties struct.
§

impl<T> IntoPropValue<T> for T

§

fn into_prop_value(self) -> T

Convert self to a value of a Properties struct.
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T> ToQuery for T
where T: Serialize,

§

type Error = HistoryError

Error that can be returned from the conversion.
§

fn to_query(&self) -> Result<Cow<'_, str>, <T as ToQuery>::Error>

Method to encode the query into a string.
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<Token, Builder, How> AllPropsFor<Builder, How> for Token
where Builder: Buildable<Token>, <Builder as Buildable<Token>>::WrappedToken: HasAllProps<<Builder as Buildable<Token>>::Output, How>,

source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T> HasAllProps<(), T> for T