Struct tiny_std::UnixString

source ·
#[repr(transparent)]
pub struct UnixString(_);

Implementations§

Methods from Deref<Target = UnixStr>§

source

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

Try to convert this &UnixStr to a utf8 &str

Errors

Not utf8

source

pub fn as_slice(&self) -> &[u8]

Get this &UnixStr as a slice, including the null byte

source

pub fn len(&self) -> usize

Get the length of this &UnixStr, including the null byte

Trait Implementations§

source§

impl AsUnixStr for UnixString

source§

fn exec_with_self_as_ptr<F, T>(&self, func: F) -> Result<T, Error>where F: FnOnce(*const u8) -> Result<T, Error>,

Executes a function with this null terminated entity converts it to a string and pushes a null byte if not already null terminated Read more
source§

unsafe fn match_up_to(&self, null_terminated_pointer: *const u8) -> usize

Checks if this AsUnixStr matches a null terminated pointer and returns the non null length Read more
source§

impl Clone for UnixString

source§

fn clone(&self) -> UnixString

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for UnixString

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Deref for UnixString

§

type Target = UnixStr

The resulting type after dereferencing.
source§

fn deref(&self) -> &<UnixString as Deref>::Target

Dereferences the value.
source§

impl From<&UnixStr> for UnixString

source§

fn from(s: &UnixStr) -> UnixString

Converts to this type from the input type.
source§

impl PartialEq<UnixString> for UnixString

source§

fn eq(&self, other: &UnixString) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl ToUnixString for UnixString

source§

fn to_unix_string(&self) -> Result<UnixString, Error>

Turn this into a UnixString Read more
source§

impl TryFrom<&[u8]> for UnixString

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from( value: &[u8] ) -> Result<UnixString, <UnixString as TryFrom<&[u8]>>::Error>

Performs the conversion.
source§

impl TryFrom<&str> for UnixString

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from( value: &str ) -> Result<UnixString, <UnixString as TryFrom<&str>>::Error>

Performs the conversion.
source§

impl TryFrom<String> for UnixString

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from( value: String ) -> Result<UnixString, <UnixString as TryFrom<String>>::Error>

Performs the conversion.
source§

impl TryFrom<Vec<u8, Global>> for UnixString

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from( value: Vec<u8, Global> ) -> Result<UnixString, <UnixString as TryFrom<Vec<u8, Global>>>::Error>

Performs the conversion.
source§

impl Eq for UnixString

source§

impl StructuralEq for UnixString

source§

impl StructuralPartialEq for UnixString

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.