[go: up one dir, main page]

Struct postcard::flavors::Slice[][src]

pub struct Slice<'a> { /* fields omitted */ }
Expand description

The Slice flavor is a storage flavor, storing the serialized (or otherwise modified) bytes into a plain [u8] slice. The Slice flavor resolves into a sub-slice of the original slice buffer.

Implementations

Create a new Slice flavor from a given backing buffer

Trait Implementations

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

Performs the mutable indexing (container[index]) operation. Read more

The Output type is what this flavor “resolves” to when the serialization is complete. For storage flavors, this is typically a concrete type. For modification flavors, this is typically a generic parameter for the storage flavor they are wrapped around. Read more

The try_extend() trait method can be implemented when there is a more efficient way of processing multiple bytes at once, such as copying a slice to the output, rather than iterating over one byte at a time. Read more

The try_push() trait method can be used to push a single byte to be modified and/or stored

The release() trait method finalizes the modification or storage operation, and resolved into the type defined by SerFlavor::Output associated type. Read more

The try_push_varint_usize() trait method can be used to push a VarintUsize. The default implementation uses try_extend() to process the encoded VarintUsize bytes, which is likely the desired behavior for most circumstances. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.