Struct bincode::StrBox [] [src]

pub struct StrBox<'a> {
    // some fields omitted
}

Like a RefBox, but encoding from a str and decoedes to a String.

Methods

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

fn new(s: &'a str) -> StrBox<'a>

Creates a new RefBox that looks at a borrowed value.

impl StrBox<'static>
[src]

fn take(self) -> String

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<StringStrBox<'static>>

Tries to take the value out of this refbox.

Trait Implementations

impl<'a> Debug for StrBox<'a>
[src]

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

Formats the value using the given formatter.

impl<'a> Encodable for StrBox<'a>
[src]

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

impl Decodable for StrBox<'static>
[src]

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