Trait spacetimedb_sats::de::SliceVisitor
source · pub trait SliceVisitor<'de, T: ToOwned + ?Sized>: Sized {
type Output;
// Required method
fn visit<E: Error>(self, slice: &T) -> Result<Self::Output, E>;
// Provided methods
fn visit_owned<E: Error>(self, buf: T::Owned) -> Result<Self::Output, E> { ... }
fn visit_borrowed<E: Error>(
self,
borrowed_slice: &'de T
) -> Result<Self::Output, E> { ... }
}
Expand description
A SliceVisitor
is provided a slice T
of some elements by a Deserializer
and is tasked with translating this slice to the Output
type.
Required Associated Types§
Required Methods§
Provided Methods§
sourcefn visit_owned<E: Error>(self, buf: T::Owned) -> Result<Self::Output, E>
fn visit_owned<E: Error>(self, buf: T::Owned) -> Result<Self::Output, E>
The input contains a slice and ownership of the slice is being given to the SliceVisitor
.
sourcefn visit_borrowed<E: Error>(
self,
borrowed_slice: &'de T
) -> Result<Self::Output, E>
fn visit_borrowed<E: Error>( self, borrowed_slice: &'de T ) -> Result<Self::Output, E>
The input contains a slice that lives at least as long ('de
) as the Deserializer
.
Object Safety§
This trait is not object safe.