Struct microkelvin::TokenBuffer
source ·
[−]pub struct TokenBuffer { /* fields omitted */ }
Expand description
Writebuffer guarded by a Token
Implementations
Construct a new TokenBuffer
from a mutable slice of bytes and a token
Return bytes that have been written into the tokenbuffer
Return bytes that have not yet been written
Safety
It is up to the caller to assure that Only one mutable reference may exist at a time
Bump the buffer pointer forward, and reduce the internal count of written bytes.
Returns the amount of bytes written into the lbuffer
Trait Implementations
type Error = BufferOverflow
type Error = BufferOverflow
The error produced by any failing methods.
Attempts to write the given bytes to the serializer.
Advances the given number of bytes as padding.
Aligns the position of the serializer to the given alignment.
Aligns the position of the serializer to be suitable to write the given type.
Resolves the given value with its resolver and writes the archived type. Read more
Archives the given object and returns the position it was archived at.
unsafe fn resolve_unsized_aligned<T>(
&mut self,
value: &T,
to: usize,
metadata_resolver: <T as ArchiveUnsized>::MetadataResolver
) -> Result<usize, Self::Error> where
T: ArchiveUnsized + ?Sized,
unsafe fn resolve_unsized_aligned<T>(
&mut self,
value: &T,
to: usize,
metadata_resolver: <T as ArchiveUnsized>::MetadataResolver
) -> Result<usize, Self::Error> where
T: ArchiveUnsized + ?Sized,
Resolves the given reference with its resolver and writes the archived reference. Read more
fn serialize_unsized_value<T>(
&mut self,
value: &T
) -> Result<usize, Self::Error> where
T: SerializeUnsized<Self> + ?Sized,
fn serialize_unsized_value<T>(
&mut self,
value: &T
) -> Result<usize, Self::Error> where
T: SerializeUnsized<Self> + ?Sized,
Archives a reference to the given object and returns the position it was archived at.
Auto Trait Implementations
impl RefUnwindSafe for TokenBuffer
impl !Send for TokenBuffer
impl !Sync for TokenBuffer
impl Unpin for TokenBuffer
impl UnwindSafe for TokenBuffer
Blanket Implementations
type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
pub fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
pub fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
Mutably borrows from an owned value. Read more
impl<F, W, T, D> Deserialize<With<T, W>, D> for F where
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for F where
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
Gets the layout of the type.