[−][src]Struct uapi::Bstr
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]
impl DerefMut for Bstr
[src]
impl Eq for Bstr
[src]
impl Hash for Bstr
[src]
pub fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,