pub struct HydrationRegistry {
pub current_id: usize,
pub current_component_id: usize,
pub next_component_id: usize,
}
Expand description
A manager for the current hydration state.
Fields
current_id: usize
The current node id. This is incremented every time a new element is created.
current_component_id: usize
The current component id. This is incremented every time a new component is created.
Every time this is incremented, current_id
is reset to 0
. This is to add more tolerance
to hydration so that one component that doesn’t hydrate correctly will not prevent other
components from hydrating.
next_component_id: usize
The next component id. We need to save this because exiting the component scope decrements the current component id. This is to ensure that component ids are unique for each instance of a component.
Implementations
sourceimpl HydrationRegistry
impl HydrationRegistry
sourcepub fn new() -> HydrationRegistry
pub fn new() -> HydrationRegistry
Create a new HydrationRegistry
with defaults.
sourcepub fn get_next_id(&mut self) -> usize
pub fn get_next_id(&mut self) -> usize
Gets the next id.
Trait Implementations
sourceimpl Clone for HydrationRegistry
impl Clone for HydrationRegistry
sourcefn clone(&self) -> HydrationRegistry
fn clone(&self) -> HydrationRegistry
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for HydrationRegistry
impl Debug for HydrationRegistry
sourceimpl Default for HydrationRegistry
impl Default for HydrationRegistry
sourcefn default() -> HydrationRegistry
fn default() -> HydrationRegistry
Returns the “default value” for a type. Read more
impl Copy for HydrationRegistry
Auto Trait Implementations
impl RefUnwindSafe for HydrationRegistry
impl Send for HydrationRegistry
impl Sync for HydrationRegistry
impl Unpin for HydrationRegistry
impl UnwindSafe for HydrationRegistry
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more