pub struct LinksEncoder { /* private fields */ }Expand description
Stateful Rust value encoder.
Implementations§
Source§impl LinksEncoder
impl LinksEncoder
Sourcepub const fn with_network(network: LinkNetwork) -> Self
pub const fn with_network(network: LinkNetwork) -> Self
Creates an encoder that appends to an existing network.
Sourcepub const fn network(&self) -> &LinkNetwork
pub const fn network(&self) -> &LinkNetwork
Returns the underlying network.
Sourcepub fn network_mut(&mut self) -> &mut LinkNetwork
pub fn network_mut(&mut self) -> &mut LinkNetwork
Returns the underlying network mutably.
Sourcepub fn into_network(self) -> LinkNetwork
pub fn into_network(self) -> LinkNetwork
Finishes encoding and returns the network.
Sourcepub fn encode<T: ToLinks + ?Sized>(&mut self, value: &T) -> LinkId
pub fn encode<T: ToLinks + ?Sized>(&mut self, value: &T) -> LinkId
Encodes a value and returns its root link.
Sourcepub fn register_type_shape(&mut self, shape: &RustTypeShape) -> LinkId
pub fn register_type_shape(&mut self, shape: &RustTypeShape) -> LinkId
Registers a queryable Rust type shape and returns its type link.
Sourcepub fn begin_object(&mut self, shape: &RustTypeShape) -> LinkId
pub fn begin_object(&mut self, shape: &RustTypeShape) -> LinkId
Starts an object instance for a Rust type shape.
Trait Implementations§
Source§impl Debug for LinksEncoder
impl Debug for LinksEncoder
Auto Trait Implementations§
impl Freeze for LinksEncoder
impl RefUnwindSafe for LinksEncoder
impl Send for LinksEncoder
impl Sync for LinksEncoder
impl Unpin for LinksEncoder
impl UnsafeUnpin for LinksEncoder
impl UnwindSafe for LinksEncoder
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.