pub struct ExampleHost {
pub title: Property<String>,
pub sources: Property<Vec<ExampleSource>>,
pub selected_source: Property<usize>,
pub drawer_open: Property<bool>,
pub _active_source: Property<ExampleSource>,
pub _source_markups: Property<Vec<String>>,
pub _active_source_markup: Property<String>,
pub _drawer_width_px: Property<f64>,
pub _drawer_progress: Property<f64>,
pub _drawer_target_open: Property<bool>,
pub _is_resizing_drawer: Property<bool>,
pub _compact_drawer: Property<bool>,
}Expand description
A display wrapper for documentation/demo examples.
ExampleHost renders every projected child with slot() and offers an
optional source drawer driven by an explicit sources manifest.
Fields§
§title: Property<String>Title shown in the source drawer.
sources: Property<Vec<ExampleSource>>Explicit source files related to the projected example subtree.
selected_source: Property<usize>Selected source index for the drawer tabs.
drawer_open: Property<bool>Whether the source drawer is visible.
_active_source: Property<ExampleSource>§_source_markups: Property<Vec<String>>§_active_source_markup: Property<String>§_drawer_width_px: Property<f64>§_drawer_progress: Property<f64>§_drawer_target_open: Property<bool>§_is_resizing_drawer: Property<bool>§_compact_drawer: Property<bool>Implementations§
Source§impl ExampleHost
impl ExampleHost
pub fn on_mount(&mut self, ctx: &NodeContext)
Sourcepub fn on_pre_render(&mut self, ctx: &NodeContext)
pub fn on_pre_render(&mut self, ctx: &NodeContext)
Keeps the animated drawer progress synchronized with external state writes.
Sourcepub fn toggle_drawer(&mut self, _ctx: &NodeContext, _event: Event<Click>)
pub fn toggle_drawer(&mut self, _ctx: &NodeContext, _event: Event<Click>)
Toggles the source drawer.
Sourcepub fn on_resize_mouse_down(
&mut self,
ctx: &NodeContext,
event: Event<MouseDown>,
)
pub fn on_resize_mouse_down( &mut self, ctx: &NodeContext, event: Event<MouseDown>, )
Starts dragging the source divider when pressed near the handle.
Sourcepub fn on_split_mouse_down(
&mut self,
ctx: &NodeContext,
_event: Event<MouseDown>,
)
pub fn on_split_mouse_down( &mut self, ctx: &NodeContext, _event: Event<MouseDown>, )
Starts dragging from the explicit source divider hit target.
Sourcepub fn on_resize_mouse_over(
&mut self,
ctx: &NodeContext,
_event: Event<MouseOver>,
)
pub fn on_resize_mouse_over( &mut self, ctx: &NodeContext, _event: Event<MouseOver>, )
Shows the platform resize cursor over the source divider.
Sourcepub fn on_resize_mouse_out(
&mut self,
ctx: &NodeContext,
_event: Event<MouseOut>,
)
pub fn on_resize_mouse_out( &mut self, ctx: &NodeContext, _event: Event<MouseOut>, )
Restores the cursor after leaving the source divider.
Sourcepub fn on_resize_mouse_move(
&mut self,
ctx: &NodeContext,
event: Event<MouseMove>,
)
pub fn on_resize_mouse_move( &mut self, ctx: &NodeContext, event: Event<MouseMove>, )
Updates the fixed-sum preview/source split while dragging.
Sourcepub fn on_resize_mouse_up(&mut self, ctx: &NodeContext, _event: Event<MouseUp>)
pub fn on_resize_mouse_up(&mut self, ctx: &NodeContext, _event: Event<MouseUp>)
Ends source divider dragging.
Trait Implementations§
Source§impl Clone for ExampleHost
impl Clone for ExampleHost
Source§fn clone(&self) -> ExampleHost
fn clone(&self) -> ExampleHost
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl CoercionRules for ExampleHost
impl CoercionRules for ExampleHost
Source§fn is_identity_roundtrip() -> bool
fn is_identity_roundtrip() -> bool
Self preserves the semantics of converting that clone
through ToPaxValue and back with try_coerce. Read moreSource§fn try_coerce(value: PaxValue) -> Result<ExampleHost, String>
fn try_coerce(value: PaxValue) -> Result<ExampleHost, String>
value into Self.Source§fn allows_singleton_stack() -> bool
fn allows_singleton_stack() -> bool
Source§impl Debug for ExampleHost
impl Debug for ExampleHost
Source§impl Default for ExampleHost
impl Default for ExampleHost
Source§fn default() -> ExampleHost
fn default() -> ExampleHost
Source§impl<'de> Deserialize<'de> for ExampleHost
impl<'de> Deserialize<'de> for ExampleHost
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ExampleHost, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ExampleHost, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl HelperFunctions for ExampleHost
impl HelperFunctions for ExampleHost
Source§fn register_all_functions()
fn register_all_functions()
impl ImplToFromPaxAny for ExampleHost
Source§impl Interpolatable for ExampleHost
impl Interpolatable for ExampleHost
Source§fn interpolate(&self, _other: &Self, _t: f64) -> Self
fn interpolate(&self, _other: &Self, _t: f64) -> Self
Source§impl Serialize for ExampleHost
impl Serialize for ExampleHost
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Source§impl ToPaxValue for ExampleHost
impl ToPaxValue for ExampleHost
Source§fn to_pax_value(self) -> PaxValue
fn to_pax_value(self) -> PaxValue
PaxValue.Source§fn nested_properties(&self) -> Vec<UntypedProperty>
fn nested_properties(&self) -> Vec<UntypedProperty>
Source§fn to_pax_value_in_graph(self) -> PaxValuewhere
Self: Sized,
fn to_pax_value_in_graph(self) -> PaxValuewhere
Self: Sized,
Self::to_pax_value reads published value snapshots.Auto Trait Implementations§
impl Freeze for ExampleHost
impl RefUnwindSafe for ExampleHost
impl Send for ExampleHost
impl Sync for ExampleHost
impl Unpin for ExampleHost
impl UnsafeUnpin for ExampleHost
impl UnwindSafe for ExampleHost
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> PropertyValue for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
Source§fn round_into(self) -> U
fn round_into(self) -> U
Source§impl<T> ToFromPaxAny for Twhere
T: ImplToFromPaxAny,
impl<T> ToFromPaxAny for Twhere
T: ImplToFromPaxAny,
Source§fn to_pax_any(self) -> PaxAny
fn to_pax_any(self) -> PaxAny
PaxAny.Source§fn from_pax_any(pax_any: PaxAny) -> Result<T, String>
fn from_pax_any(pax_any: PaxAny) -> Result<T, String>
PaxAny.