[][src]Struct uapi::Bstr

#[repr(transparent)]pub struct Bstr { /* fields omitted */ }

Thin wrapper for a [u8]

See also the crate documentation.

Implementations

impl Bstr[src]

pub fn empty() -> &'static Self[src]

Returns an empty &Bstr

pub fn from_bytes(s: &[u8]) -> &Self[src]

Transmutes the argument into &Bstr

pub fn from_bytes_mut(s: &mut [u8]) -> &mut Self[src]

Transmutes the argument into &mut Bstr

pub fn from_str(s: &str) -> &Self[src]

Shortcut for Bstr::from_bytes(s.as_bytes())

pub fn from_os_str(s: &OsStr) -> &Self[src]

Shortcut for Bstr::from_bytes(s.as_bytes())

pub fn from_path(s: &Path) -> &Self[src]

Shortcut for Bstr::from_os_str(s.as_os_str())

pub fn as_bytes(&self) -> &[u8][src]

Transmutes self into &[u8]

pub fn as_bytes_mut(&mut self) -> &mut [u8][src]

Transmutes self into &mut [u8]

pub fn as_str(&self) -> Result<&str, Utf8Error>[src]

Shortcut for str::from_utf8(self.as_bytes())

pub fn as_os_str(&self) -> &OsStr[src]

Shortcut for OsStr::from_bytes(self.as_bytes())

pub fn as_path(&self) -> &Path[src]

Shortcut for Path::new(self.as_os_str())

pub fn as_ptr(&self) -> *const c_char[src]

Shortcut for self.as_bytes().as_ptr()

pub fn as_mut_ptr(&mut self) -> *mut c_char[src]

Shortcut for self.as_mut_bytes().as_mut_ptr()

pub fn len(&self) -> usize[src]

Shortcut for self.as_bytes().len()

pub fn is_empty(&self) -> bool[src]

Shortcut for self.len() == 0

pub fn display(&self) -> impl Display + '_[src]

Shortcut for self.as_path().display()

pub fn to_ustring(&self) -> Ustring[src]

Allocates a new Ustring with the contents of this object

Trait Implementations

impl AsMut<[u8]> for Bstr[src]

impl AsRef<[u8]> for Bstr[src]

impl AsRef<Bstr> for CStr[src]

impl AsRef<OsStr> for Bstr[src]

impl AsRef<Path> for Bstr[src]

impl Borrow<Bstr> for Ustring[src]

impl Bytes for Bstr[src]

impl Debug for Bstr[src]

impl Deref for Bstr[src]

type Target = [u8]

The resulting type after dereferencing.

impl DerefMut for Bstr[src]

impl Eq for Bstr[src]

impl Hash for Bstr[src]

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

impl Ord for Bstr[src]

impl PartialEq<[u8]> for Bstr[src]

impl PartialEq<Bstr> for Bstr[src]

impl PartialEq<Bstr> for [u8][src]

impl PartialEq<Bstr> for PathBuf[src]

impl PartialEq<Bstr> for Ustr[src]

impl PartialEq<Bstr> for Ustring[src]

impl PartialEq<Bstr> for str[src]

impl PartialEq<Bstr> for CStr[src]

impl PartialEq<Bstr> for OsStr[src]

impl PartialEq<Bstr> for Path[src]

impl PartialEq<Bstr> for Vec<u8>[src]

impl PartialEq<Bstr> for String[src]

impl PartialEq<Bstr> for CString[src]

impl PartialEq<Bstr> for OsString[src]

impl PartialEq<CStr> for Bstr[src]

impl PartialEq<CString> for Bstr[src]

impl PartialEq<OsStr> for Bstr[src]

impl PartialEq<OsString> for Bstr[src]

impl PartialEq<Path> for Bstr[src]

impl PartialEq<PathBuf> for Bstr[src]

impl PartialEq<String> for Bstr[src]

impl PartialEq<Ustr> for Bstr[src]

impl PartialEq<Ustring> for Bstr[src]

impl PartialEq<Vec<u8>> for Bstr[src]

impl PartialEq<str> for Bstr[src]

impl PartialOrd<Bstr> for Bstr[src]

impl StructuralEq for Bstr[src]

impl StructuralPartialEq for Bstr[src]

impl ToOwned for Bstr[src]

type Owned = Ustring

The resulting type after obtaining ownership.

Auto Trait Implementations

impl RefUnwindSafe for Bstr

impl Send for Bstr

impl Sync for Bstr

impl Unpin for Bstr

impl UnwindSafe for Bstr

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.