pub struct HydrationContext { /* private fields */ }
Expand description
Data shared between the frontend and the backend for hydration of server functions.
Implementations§
Source§impl HydrationContext
impl HydrationContext
Sourcepub fn from_serialized(
data: &[u8],
debug_types: Option<Vec<String>>,
debug_locations: Option<Vec<String>>,
) -> Self
pub fn from_serialized( data: &[u8], debug_types: Option<Vec<String>>, debug_locations: Option<Vec<String>>, ) -> Self
Create a new serialize context from the serialized data
Sourcepub fn serialized(&self) -> SerializedHydrationData
pub fn serialized(&self) -> SerializedHydrationData
Serialize the data in the context to be sent to the client
Sourcepub fn create_entry<T>(&self) -> SerializeContextEntry<T>
pub fn create_entry<T>(&self) -> SerializeContextEntry<T>
Create a new entry in the data that will be sent to the client without inserting any data. Returns an id that can be used to insert data into the entry once it is ready.
Sourcepub fn error_entry(&self) -> SerializeContextEntry<Option<CapturedError>>
pub fn error_entry(&self) -> SerializeContextEntry<Option<CapturedError>>
Get the entry for the error in the suspense boundary
Sourcepub fn extend(&self, other: &Self)
pub fn extend(&self, other: &Self)
Extend this data with the data from another HydrationContext
Trait Implementations§
Source§impl Clone for HydrationContext
impl Clone for HydrationContext
Source§fn clone(&self) -> HydrationContext
fn clone(&self) -> HydrationContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Default for HydrationContext
impl Default for HydrationContext
Source§fn default() -> HydrationContext
fn default() -> HydrationContext
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for HydrationContext
impl !RefUnwindSafe for HydrationContext
impl !Send for HydrationContext
impl !Sync for HydrationContext
impl Unpin for HydrationContext
impl !UnwindSafe for HydrationContext
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<Ret> SpawnIfAsync<(), Ret> for Ret
impl<Ret> SpawnIfAsync<(), Ret> for Ret
Source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
Source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
Source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
Source§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.