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>

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>

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: Encodable> Encodable for SliceBox<'a, T>

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

impl<T: Decodable> Decodable for SliceBox<'static, T>

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

Derived Implementations

impl<'a, T: Clone + 'a> Clone for SliceBox<'a, T> where T: Clone, T: Clone

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

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

impl<'a, T: Hash + 'a> Hash for SliceBox<'a, T> where T: Hash, T: Hash

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

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

impl<'a, T: Ord + 'a> Ord for SliceBox<'a, T> where T: Ord, T: Ord

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

impl<'a, T: Eq + 'a> Eq for SliceBox<'a, T> where T: Eq, T: Eq

impl<'a, T: PartialOrd + 'a> PartialOrd for SliceBox<'a, T> where T: PartialOrd, T: PartialOrd

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

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

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

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

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

impl<'a, T: PartialEq + 'a> PartialEq for SliceBox<'a, T> where T: PartialEq, T: PartialEq

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

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

impl<'a, T: Debug + 'a> Debug for SliceBox<'a, T> where T: Debug, T: Debug

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