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

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

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

impl<'a> Slice<'a>[src]

pub fn new(buf: &'a mut [u8]) -> Self[src]

Create a new Slice flavor from a given backing buffer

Trait Implementations

impl<'a> Index<usize> for Slice<'a>[src]

type Output = u8

The returned type after indexing.

impl<'a> IndexMut<usize> for Slice<'a>[src]

impl<'a> SerFlavor for Slice<'a>[src]

type Output = &'a mut [u8]

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

Auto Trait Implementations

impl<'a> RefUnwindSafe for Slice<'a>[src]

impl<'a> Send for Slice<'a>[src]

impl<'a> Sync for Slice<'a>[src]

impl<'a> Unpin for Slice<'a>[src]

impl<'a> !UnwindSafe for Slice<'a>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.