[][src]Struct arf_strings::PosixString

pub struct PosixString(_);

A utility for converting from inside-world path-oriented strings, such as file and directory names, into NUL-terminated byte strings that can be passed to POSIX-like APIs. Input strings containing NUL bytes are interpreted as ARF strings.

Implementations

impl PosixString[src]

pub fn from_path_bytes(bytes: &[u8]) -> Result<Self, ()>[src]

Construct a PosixString from data in the given byte slice, which should contain a valid UTF-8 string, which must either contain no NUL bytes, or must be a valid ARF string.

If the data is not valid UTF-8, or if it contains NUL bytes and is not valid ARF, return an error.

pub fn from_path_str(s: &str) -> Result<Self, ()>[src]

Construct a PosixString from data in the given &str, which must either contain no NUL bytes, or must be a valid ARF string.

If the data contains NUL bytes and is not valid ARF, return an error.

pub fn as_cstr(&self) -> &CStr[src]

Return a &CStr reference to the contained CString.

pub fn into_cstring(self) -> CString[src]

Consume this PosixString and return the contained CString.

Auto Trait Implementations

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> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.