Trait std::ascii::OwnedAsciiCast[src]

pub trait OwnedAsciiCast {
    fn is_ascii(&self) -> bool;
    unsafe fn into_ascii_nocheck(self) -> Vec<Ascii>;

    fn into_ascii(self) -> Vec<Ascii> { ... }
    fn into_ascii_opt(self) -> Option<Vec<Ascii>> { ... }
}

Trait for copyless casting to an ascii vector.

Required Methods

fn is_ascii(&self) -> bool

Check if convertible to ascii

unsafe fn into_ascii_nocheck(self) -> Vec<Ascii>

Take ownership and cast to an ascii vector. Does not perform validation checks.

Provided Methods

fn into_ascii(self) -> Vec<Ascii>

Take ownership and cast to an ascii vector. Fail on non-ASCII input.

fn into_ascii_opt(self) -> Option<Vec<Ascii>>

Take ownership and cast to an ascii vector. Return None on non-ASCII input.

Implementors