[][src]Trait uapi::IntoUstr

pub trait IntoUstr<'a>: Debug {
    pub fn into_ustr(self) -> Cow<'a, Ustr>;
}

Trait for objects which can be turned into Cow<'a, Ustr>

Provided Implementations

The implementations for &Ustr and Ustring return self unchanged.

The other provided implementations for borrowed objects first check if the object has a trailing nul byte. If so, this byte is used as the trailing nul byte for the Ustr. This means that IntoUstr does not guarantee to round-trip. For example

assert_eq!(b"abc", b"abc\0".into_ustr().as_bytes());

Required methods

pub fn into_ustr(self) -> Cow<'a, Ustr>[src]

Converts self into Cow<'a, Ustr>

Loading content...

Implementations on Foreign Types

impl<'a> IntoUstr<'a> for Cow<'a, Ustr>[src]

impl<'a> IntoUstr<'a> for &'a Cow<'a, Ustr>[src]

impl<'a> IntoUstr<'a> for &'a [u8][src]

impl IntoUstr<'static> for Vec<u8>[src]

impl<'a> IntoUstr<'a> for &'a str[src]

impl IntoUstr<'static> for String[src]

impl<'a> IntoUstr<'a> for &'a CStr[src]

impl IntoUstr<'static> for CString[src]

impl<'a> IntoUstr<'a> for &'a OsStr[src]

impl IntoUstr<'static> for OsString[src]

impl<'a> IntoUstr<'a> for &'a Path[src]

impl IntoUstr<'static> for PathBuf[src]

Loading content...

Implementors

impl IntoUstr<'static> for Ustring[src]

impl<'a> IntoUstr<'a> for &'a Bstr[src]

impl<'a> IntoUstr<'a> for &'a Ustr[src]

impl<'a> IntoUstr<'a> for &'a Ustring[src]

Loading content...