Struct bincode::SliceBox [] [src]

pub struct SliceBox<'a, T: 'a> {
    // some fields omitted
}

Like a RefBox, but encodes from a [T] and encodes to a Vec<T>.

Methods

impl<'a, T> SliceBox<'a, T>
[src]

fn new(v: &'a [T]) -> SliceBox<'a, T>

Creates a new RefBox that looks at a borrowed value.

impl<T> SliceBox<'static, T>
[src]

fn take(self) -> Vec<T>

Takes the value out of this refbox.

Fails if this refbox was not created out of a deserialization.

Unless you are doing some really weird things with static references, this function will never fail.

fn try_take(self) -> Result<Vec<T>, SliceBox<'static, T>>

Tries to take the value out of this refbox.

Trait Implementations

impl<'a, T: Debug + 'a> Debug for SliceBox<'a, T>
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl<'a, T: Encodable> Encodable for SliceBox<'a, T>
[src]

fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error>

impl<T: Decodable> Decodable for SliceBox<'static, T>
[src]

fn decode<D: Decoder>(d: &mut D) -> Result<SliceBox<'static, T>, D::Error>