Trait cstr_enum::FromCStr[][src]

pub trait FromCStr {
    type Err: Sized;
    fn from_cstr(s: &CStr) -> Result<Self, Self::Err>
    where
        Self: Sized
; }

Conversion from a C-style string

This trait should be used the same way as std::str::FromStr, although a separate .parse() implementation is not provided &str

Associated Types

type Err: Sized[src]

The error type returned if parsing fails.

If using the derive macro, this will be &'static str.

Loading content...

Required methods

fn from_cstr(s: &CStr) -> Result<Self, Self::Err> where
    Self: Sized
[src]

Parse the &CStr for an instance of Self.

If using the derive macro, this will be a match statement over &'static [u8].

Loading content...

Implementors

Loading content...