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.