Skip to main content

RetainedLayerRegistry

Struct RetainedLayerRegistry 

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

Bounded registry tracking retained page/scroll layers, focus, and animation timelines across route transitions.

Implementations§

Source§

impl RetainedLayerRegistry

Bounded retained scroll-layer capture, restoration, and target-page pre-warming for RetainedLayerRegistry.

Source

pub fn new() -> Self

Creates an empty RetainedLayerRegistry.

§Returns
  • Self - Empty retained layer registry.
Source

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

Returns a cloned snapshot of the retained layer record for route_key, if registered.

§Arguments
  • &Self - Registry reference.
  • &str - Canonical route path.
§Returns
  • Option<RetainedScrollLayer> - Retained layer snapshot when present.
Source

pub fn remove_layer(&mut self, route_key: &str) -> bool

Removes a retained layer entry when its page is explicitly destroyed (PageRetention::Destroy).

§Arguments
  • &Self - Mutable registry.
  • &str - Canonical route path.
§Returns
  • bool - true when an entry was removed.
Source

pub fn capture_page_state( &mut self, tree: &mut SceneTree, route_key: &str, wrapper: NodeId, timeline_secs: f64, ) -> RetainedScrollLayer

Captures a leaving page’s scroll offsets, focused descendant, and active descendant animation timelines without resetting them.

§Arguments
  • &Self - Mutable registry.
  • &mut SceneTree - Mutable scene tree.
  • &str - Canonical route path of the leaving page.
  • NodeId - Outer ScrollView wrapper node handle.
  • f64 - Current page animation timeline clock in seconds.
§Returns
  • RetainedScrollLayer - Captured retained layer snapshot.
Source

pub fn restore_page_state( &mut self, tree: &mut SceneTree, route_key: &str, ) -> Option<RetainedScrollLayer>

Restores a frozen page’s retained scroll offsets, input focus, and suspended animation timelines when switching back to route_key.

§Arguments
  • &Self - Mutable registry.
  • &mut SceneTree - Mutable scene tree.
  • &str - Canonical route path of the entering page.
§Returns
  • Option<RetainedScrollLayer> - Updated retained layer snapshot after reuse, or None when not cached.
Source

pub fn prewarm_page_resources( &mut self, tree: &SceneTree, route_key: &str, wrapper: NodeId, sample_texts: &[&str], ) -> PagePrewarmReport

Pre-warms layout node inspection, glyph text samples, and retained scroll layer registration for route_key.

§Arguments
  • &Self - Mutable registry.
  • &SceneTree - Scene tree containing the target page wrapper.
  • &str - Canonical route path being pre-warmed.
  • NodeId - Target page outer wrapper node handle.
  • &[&str] - Additional representative text labels to warm into glyph shaping caches.
§Returns
  • PagePrewarmReport - Summary of warmed nodes, glyphs, and retained scroll layer reuse.
Source§

impl RetainedLayerRegistry

Source

pub fn get_next_generation(&self) -> u64

Source

pub fn get_touch_clock(&self) -> u64

Source

pub fn get_total_reuse_hits(&self) -> u64

Source

pub fn get_total_prewarms(&self) -> u64

Trait Implementations§

Source§

impl Clone for RetainedLayerRegistry

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 RetainedLayerRegistry

Source§

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

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

impl Default for RetainedLayerRegistry

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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.