Skip to main content

FromWordPointer

Trait FromWordPointer 

Source
pub trait FromWordPointer<'a>: Sized + 'a {
    type Err: Display;

    // Required method
    fn from_cstr(s: &'a CStr) -> Result<Self, Self::Err>;
}
Expand description

Parse a value from a CStr instance.

Required Associated Types§

Source

type Err: Display

The type returned in the event of a conversion error.

Required Methods§

Source

fn from_cstr(s: &'a CStr) -> Result<Self, Self::Err>

Parse the value in s to return a value of this type.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'a, T: FromWordPointer<'a>> FromWordPointer<'a> for Option<T>

Source§

type Err = <T as FromWordPointer<'a>>::Err

Source§

fn from_cstr(s: &'a CStr) -> Result<Self, Self::Err>

Source§

impl<'a> FromWordPointer<'a> for &'a OsStr

Available on Unix only.
Source§

type Err = Infallible

Source§

fn from_cstr(s: &'a CStr) -> Result<Self, Self::Err>

Source§

impl<'a> FromWordPointer<'a> for &'a Path

Available on Unix only.
Source§

type Err = Infallible

Source§

fn from_cstr(s: &'a CStr) -> Result<Self, Self::Err>

Source§

impl<'a> FromWordPointer<'a> for &'a str

Source§

type Err = Utf8Error

Source§

fn from_cstr(s: &'a CStr) -> Result<Self, Self::Err>

Source§

impl<'a> FromWordPointer<'a> for OsString

Available on Unix only.
Source§

type Err = Infallible

Source§

fn from_cstr(s: &'a CStr) -> Result<Self, Self::Err>

Source§

impl<'a> FromWordPointer<'a> for PathBuf

Available on Unix only.
Source§

type Err = Infallible

Source§

fn from_cstr(s: &'a CStr) -> Result<Self, Self::Err>

Source§

impl<'a> FromWordPointer<'a> for String

Source§

type Err = Utf8Error

Source§

fn from_cstr(s: &'a CStr) -> Result<Self, Self::Err>

Source§

impl<'a> FromWordPointer<'a> for bool

Source§

type Err = Utf8OrParseError<<bool as FromStr>::Err>

Source§

fn from_cstr(s: &'a CStr) -> Result<Self, Self::Err>

Source§

impl<'a> FromWordPointer<'a> for char

Source§

type Err = Utf8OrParseError<<char as FromStr>::Err>

Source§

fn from_cstr(s: &'a CStr) -> Result<Self, Self::Err>

Source§

impl<'a> FromWordPointer<'a> for f32

Source§

type Err = Utf8OrParseError<<f32 as FromStr>::Err>

Source§

fn from_cstr(s: &'a CStr) -> Result<Self, Self::Err>

Source§

impl<'a> FromWordPointer<'a> for f64

Source§

type Err = Utf8OrParseError<<f64 as FromStr>::Err>

Source§

fn from_cstr(s: &'a CStr) -> Result<Self, Self::Err>

Source§

impl<'a> FromWordPointer<'a> for i8

Source§

type Err = Utf8OrParseError<<i8 as FromStr>::Err>

Source§

fn from_cstr(s: &'a CStr) -> Result<Self, Self::Err>

Source§

impl<'a> FromWordPointer<'a> for i16

Source§

type Err = Utf8OrParseError<<i16 as FromStr>::Err>

Source§

fn from_cstr(s: &'a CStr) -> Result<Self, Self::Err>

Source§

impl<'a> FromWordPointer<'a> for i32

Source§

type Err = Utf8OrParseError<<i32 as FromStr>::Err>

Source§

fn from_cstr(s: &'a CStr) -> Result<Self, Self::Err>

Source§

impl<'a> FromWordPointer<'a> for i64

Source§

type Err = Utf8OrParseError<<i64 as FromStr>::Err>

Source§

fn from_cstr(s: &'a CStr) -> Result<Self, Self::Err>

Source§

impl<'a> FromWordPointer<'a> for i128

Source§

type Err = Utf8OrParseError<<i128 as FromStr>::Err>

Source§

fn from_cstr(s: &'a CStr) -> Result<Self, Self::Err>

Source§

impl<'a> FromWordPointer<'a> for isize

Source§

type Err = Utf8OrParseError<<isize as FromStr>::Err>

Source§

fn from_cstr(s: &'a CStr) -> Result<Self, Self::Err>

Source§

impl<'a> FromWordPointer<'a> for u8

Source§

type Err = Utf8OrParseError<<u8 as FromStr>::Err>

Source§

fn from_cstr(s: &'a CStr) -> Result<Self, Self::Err>

Source§

impl<'a> FromWordPointer<'a> for u16

Source§

type Err = Utf8OrParseError<<u16 as FromStr>::Err>

Source§

fn from_cstr(s: &'a CStr) -> Result<Self, Self::Err>

Source§

impl<'a> FromWordPointer<'a> for u32

Source§

type Err = Utf8OrParseError<<u32 as FromStr>::Err>

Source§

fn from_cstr(s: &'a CStr) -> Result<Self, Self::Err>

Source§

impl<'a> FromWordPointer<'a> for u64

Source§

type Err = Utf8OrParseError<<u64 as FromStr>::Err>

Source§

fn from_cstr(s: &'a CStr) -> Result<Self, Self::Err>

Source§

impl<'a> FromWordPointer<'a> for u128

Source§

type Err = Utf8OrParseError<<u128 as FromStr>::Err>

Source§

fn from_cstr(s: &'a CStr) -> Result<Self, Self::Err>

Source§

impl<'a> FromWordPointer<'a> for usize

Source§

type Err = Utf8OrParseError<<usize as FromStr>::Err>

Source§

fn from_cstr(s: &'a CStr) -> Result<Self, Self::Err>

Implementors§