pub struct LinksDecoder<'network> { /* private fields */ }Expand description
Stateful Rust value decoder.
Implementations§
Source§impl<'network> LinksDecoder<'network>
impl<'network> LinksDecoder<'network>
Sourcepub fn new(network: &'network LinkNetwork) -> Self
pub fn new(network: &'network LinkNetwork) -> Self
Creates a decoder over an existing network.
Sourcepub const fn network(&self) -> &'network LinkNetwork
pub const fn network(&self) -> &'network LinkNetwork
Returns the decoded network.
Sourcepub fn decode<T: FromLinks>(
&mut self,
link: LinkId,
) -> Result<T, LinksCodecError>
pub fn decode<T: FromLinks>( &mut self, link: LinkId, ) -> Result<T, LinksCodecError>
Decodes a value from a root link.
Sourcepub fn decode_field<T: FromLinks>(
&mut self,
object: LinkId,
field: &str,
) -> Result<T, LinksCodecError>
pub fn decode_field<T: FromLinks>( &mut self, object: LinkId, field: &str, ) -> Result<T, LinksCodecError>
Decodes a singular named field from an object.
Trait Implementations§
Auto Trait Implementations§
impl<'network> Freeze for LinksDecoder<'network>
impl<'network> !RefUnwindSafe for LinksDecoder<'network>
impl<'network> !Send for LinksDecoder<'network>
impl<'network> !Sync for LinksDecoder<'network>
impl<'network> Unpin for LinksDecoder<'network>
impl<'network> UnsafeUnpin for LinksDecoder<'network>
impl<'network> !UnwindSafe for LinksDecoder<'network>
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.