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.

fn into_vec(self) -> Vec<T> where T: Clone

Extract a Vec<T> from a SliceBox.

fn to_owned(self) -> SliceBox<'static, T> where T: Clone

Convert to an Owned SliceBox.

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

fn boxed(s: Vec<T>) -> SliceBox<'static, T>

Creates a new SliceBox made from an allocated Vec<T>.

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: Clone + 'a> Clone for SliceBox<'a, T>
[src]

fn clone(&self) -> SliceBox<'a, T>

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

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

fn hash<__HT: Hasher>(&self, __arg_0: &mut __HT)

Feeds this value into the state given, updating the hasher as necessary.

fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher
1.3.0

Feeds a slice of this type into the state provided.

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

fn cmp(&self, __arg_0: &SliceBox<'a, T>) -> Ordering

This method returns an Ordering between self and other. Read more

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

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

fn partial_cmp(&self, __arg_0: &SliceBox<'a, T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, __arg_0: &SliceBox<'a, T>) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, __arg_0: &SliceBox<'a, T>) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, __arg_0: &SliceBox<'a, T>) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, __arg_0: &SliceBox<'a, T>) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

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

fn eq(&self, __arg_0: &SliceBox<'a, T>) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, __arg_0: &SliceBox<'a, T>) -> bool

This method tests for !=.

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>