Skip to main content

EuvRouter

Struct EuvRouter 

Source
pub struct EuvRouter { /* private fields */ }
Expand description

Production cross-platform UI router with reactive history stack, lazy page mounting, and PageRetention lifecycle management.

Implementations§

Source§

impl EuvRouter

History stack navigation, pattern matching, lazy page lifecycle, and system-back integration for EuvRouter.

Source

pub fn new(initial_path: &str) -> Self

Creates a new EuvRouter initialized at initial_path with PageRetention::Freeze as default retention.

§Arguments
  • &str - Starting route path (e.g. "/").
§Returns
  • Self - Initialized reactive router handle.
Source

pub fn prewarm_page_resources( &self, route_key: &str, scene: &SceneHandle, wrapper: NodeId, sample_texts: &[&str], ) -> PagePrewarmReport

Pre-warms target-page layout nodes, glyph samples, and retained scroll layer state for route_key.

§Arguments
  • &Self - Router reference.
  • &str - Canonical target route path.
  • &SceneHandle - Active retained scene handle.
  • NodeId - Target page outer wrapper node handle.
  • &[&str] - Optional representative text labels to warm into glyph caches.
§Returns
  • PagePrewarmReport - Summary of warmed nodes, glyphs, and retained scroll layer reuse.
Source

pub fn retained_layer(&self, route_key: &str) -> Option<RetainedScrollLayer>

Returns a snapshot of the retained page/scroll layer tracked for route_key, if present.

§Arguments
  • &Self - Router reference.
  • &str - Canonical route path.
§Returns
  • Option<RetainedScrollLayer> - Retained scroll layer metadata snapshot.
Source

pub fn retained_layer_reuse_count(&self) -> u64

Returns the cumulative count of retained page/scroll layer reuses across route transitions.

§Arguments
  • &Self - Router reference.
§Returns
  • u64 - Total retained scroll layer reuse hits.
Source

pub fn retained_layer_prewarm_count(&self) -> u64

Returns the cumulative count of target-page resource pre-warm passes completed by this router.

§Arguments
  • &Self - Router reference.
§Returns
  • u64 - Total target-page pre-warm executions.
Source

pub fn with_default_retention(self, retention: PageRetention) -> Self

Configures the default PageRetention policy for routes whose components do not specify an override.

§Arguments
  • Self - Source router.
  • PageRetention - Default retention strategy (Destroy, Freeze, or Alive).
§Returns
  • Self - Updated router.
Source

pub fn route<CallbackFn>( self, pattern: &str, title: &str, builder: CallbackFn, ) -> Self
where CallbackFn: Fn(&EuvRouteMatch) -> NodeId + 'static,

Registers a declarative route pattern (supporting :param segments) with a lazy page builder.

§Arguments
  • Self - Source router.
  • &str - Route pattern (e.g. "/media" or "/items/:id").
  • &str - Human-readable page title.
  • CallbackFn - Lazy page builder receiving &EuvRouteMatch.
§Returns
  • Self - Router with the route registered.
Source

pub fn route_with_retention<CallbackFn>( self, pattern: &str, title: &str, retention: PageRetention, builder: CallbackFn, ) -> Self
where CallbackFn: Fn(&EuvRouteMatch) -> NodeId + 'static,

Registers a declarative route with an explicit PageRetention policy override (Destroy, Freeze, or Alive).

§Arguments
  • Self - Source router.
  • &str - Route pattern.
  • &str - Human-readable page title.
  • PageRetention - Explicit retention strategy when leaving this route.
  • CallbackFn - Lazy page builder receiving &EuvRouteMatch.
§Returns
  • Self - Router with the route registered.
Source

pub fn route_component<CodeValue, CallbackFn>( self, pattern: &str, title: &str, factory: CallbackFn, ) -> Self
where CodeValue: Component, CallbackFn: Fn(&EuvRouteMatch) -> CodeValue + 'static,

Registers a typed Component page factory whose Lifecycle::retention_policy drives freeze/destroy/alive behavior.

§Arguments
  • Self - Source router.
  • &str - Route pattern.
  • &str - Human-readable page title.
  • CallbackFn - Lazy factory constructing a Component page instance.
§Returns
  • Self - Router with the typed component route registered.
Source

pub fn with_dynamic_hub(self, hub: DynamicUpdateHub) -> Self

Attaches an optional DynamicUpdateHub so OTA hot-updated routes seamlessly override local builders.

§Arguments
  • Self - Source router.
  • DynamicUpdateHub - Live dynamic update hub.
§Returns
  • Self - Router connected to hub.
Source

pub fn push(&self, path: &str)

Pushes path onto the navigation history stack (no-op if already on path).

§Arguments
  • &Self - Router reference.
  • &str - Destination route path.
Source

pub fn replace(&self, path: &str)

Replaces the current history entry with path without growing stack depth.

§Arguments
  • &Self - Router reference.
  • &str - Replacement route path.
Source

pub fn back(&self) -> bool

Navigates one step backward in history if available.

§Arguments
  • &Self - Router reference.
§Returns
  • bool - true if navigated back; false if already at root.
Source

pub fn forward(&self) -> bool

Navigates one step forward in history if available.

§Arguments
  • &Self - Router reference.
§Returns
  • bool - true if navigated forward; false if at head of stack.
Source

pub fn handle_system_back(&self) -> bool

Unified OS Back handler: closes topmost overlay in EuvOverlayStack first, then pops router history.

§Arguments
  • &Self - Router reference.
§Returns
  • bool - true when consumed by an overlay or route pop; false when at app root.
Source

pub fn resolve_with_policy(&self, raw_path: &str) -> EuvResolvedRoute

Parses and matches raw_path against registered routes, extracting :param, ?query, and optional retention override.

§Arguments
  • &Self - Router reference.
  • &str - Raw path possibly containing ?k=v&k2=v2.
§Returns
  • EuvResolvedRoute - Match metadata, optional builder, and optional retention policy.
Source

pub fn resolve( &self, raw_path: &str, ) -> (EuvRouteMatch, Option<EuvRouteBuilderFn>)

Parses and matches raw_path against registered routes, extracting :param and ?query values.

§Arguments
  • &Self - Router reference.
  • &str - Raw path possibly containing ?k=v&k2=v2.
§Returns
  • (EuvRouteMatch, Option<EuvRouteBuilderFn>) - Parsed match metadata and matched builder if found.
Source

pub fn outlet<CallbackFn>(&self, fallback: CallbackFn) -> EuvRouterOutlet
where CallbackFn: Fn(&EuvRouteMatch) -> NodeId + 'static,

Creates a reactive EuvRouterOutlet bound to this router with a fallback builder.

§Arguments
  • &Self - Router reference.
  • CallbackFn - Fallback page builder for unmatched paths.
§Returns
  • EuvRouterOutlet - Component-backed reactive router outlet.
Source§

impl EuvRouter

Source

pub fn get_current_path(&self) -> Signal<String>

Source

pub fn get_mut_current_path(&mut self) -> &mut Signal<String>

Source

pub fn set_current_path(&mut self, val: Signal<String>) -> &mut Self

Source

pub fn get_can_go_back(&self) -> Signal<bool>

Source

pub fn get_mut_can_go_back(&mut self) -> &mut Signal<bool>

Source

pub fn set_can_go_back(&mut self, val: Signal<bool>) -> &mut Self

Source

pub fn get_can_go_forward(&self) -> Signal<bool>

Source

pub fn get_mut_can_go_forward(&mut self) -> &mut Signal<bool>

Source

pub fn set_can_go_forward(&mut self, val: Signal<bool>) -> &mut Self

Source

pub fn get_history_len(&self) -> Signal<usize>

Source

pub fn get_mut_history_len(&mut self) -> &mut Signal<usize>

Source

pub fn set_history_len(&mut self, val: Signal<usize>) -> &mut Self

Source

pub fn get_frozen_count(&self) -> Signal<usize>

Source

pub fn get_mut_frozen_count(&mut self) -> &mut Signal<usize>

Source

pub fn set_frozen_count(&mut self, val: Signal<usize>) -> &mut Self

Source

pub fn get_alive_count(&self) -> Signal<usize>

Source

pub fn get_mut_alive_count(&mut self) -> &mut Signal<usize>

Source

pub fn set_alive_count(&mut self, val: Signal<usize>) -> &mut Self

Source

pub fn get_lifecycle_entries(&self) -> Signal<Vec<EuvRouteLifecycleEntry>>

Source

pub fn get_mut_lifecycle_entries( &mut self, ) -> &mut Signal<Vec<EuvRouteLifecycleEntry>>

Source

pub fn set_lifecycle_entries( &mut self, val: Signal<Vec<EuvRouteLifecycleEntry>>, ) -> &mut Self

Source

pub fn get_inner(&self) -> &Rc<RefCell<EuvRouterInner>>

Source

pub fn get_mut_inner(&mut self) -> &mut Rc<RefCell<EuvRouterInner>>

Source

pub fn set_inner(&mut self, val: Rc<RefCell<EuvRouterInner>>) -> &mut Self

Source

pub fn get_retained_layers(&self) -> &Rc<RefCell<RetainedLayerRegistry>>

Source

pub fn get_mut_retained_layers( &mut self, ) -> &mut Rc<RefCell<RetainedLayerRegistry>>

Source

pub fn set_retained_layers( &mut self, val: Rc<RefCell<RetainedLayerRegistry>>, ) -> &mut Self

Trait Implementations§

Source§

impl Clone for EuvRouter

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for EuvRouter

Source§

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

Formats the struct fields as a debug struct, skipping excluded fields.

§Arguments
  • &mut ::std::fmt::Formatter<'_> - The formatter to write the representation into.
§Returns
  • ::std::fmt::Result - Success or failure of the formatting operation.
Source§

impl Default for EuvRouter

Default empty root router initialized at "/" for component prop initialization.

Source§

fn default() -> Self

Creates a default router starting at "/".

§Returns
  • Self - Default router handle.

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§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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.

Source§

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

Source§

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
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.