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

Create a new HydrationRegistry with defaults.

Gets the next id.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.