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 ofTourSteps 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
impl Clone for TourConfig
source§fn clone(&self) -> TourConfig
fn clone(&self) -> TourConfig
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for TourConfig
impl Debug for TourConfig
source§impl<'de> Deserialize<'de> for TourConfig
impl<'de> Deserialize<'de> for TourConfig
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl PartialEq for TourConfig
impl PartialEq for TourConfig
source§fn eq(&self, other: &TourConfig) -> bool
fn eq(&self, other: &TourConfig) -> bool
self and other values to be equal, and is used
by ==.source§impl Properties for TourConfig
impl Properties for TourConfig
source§impl Serialize for TourConfig
impl Serialize for TourConfig
impl StructuralPartialEq for TourConfig
Auto Trait Implementations§
impl Freeze for TourConfig
impl RefUnwindSafe for TourConfig
impl Send for TourConfig
impl Sync for TourConfig
impl Unpin for TourConfig
impl UnwindSafe for TourConfig
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)§impl<T> FromQuery for Twhere
T: DeserializeOwned,
impl<T> FromQuery for Twhere
T: DeserializeOwned,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoPropValue<Option<T>> for T
impl<T> IntoPropValue<Option<T>> for T
§fn into_prop_value(self) -> Option<T>
fn into_prop_value(self) -> Option<T>
self to a value of a Properties struct.§impl<T> IntoPropValue<T> for T
impl<T> IntoPropValue<T> for T
§fn into_prop_value(self) -> T
fn into_prop_value(self) -> T
self to a value of a Properties struct.