Enum sysctl::CtlValue[][src]

pub enum CtlValue {
Show variants None, Node(Vec<u8>), Int(i32), String(String), S64(i64), Struct(Vec<u8>), Uint(u32), Long(i64), Ulong(u64), U64(u64), U8(u8), U16(u16), S8(i8), S16(i16), S32(i32), U32(u32),
}

An Enum that holds all values returned by sysctl calls. Extract inner value with if let or match.

Example

if let Ok(ctl) = sysctl::Ctl::new("kern.osrevision") {
    if let Ok(sysctl::CtlValue::Int(val)) = ctl.value() {
        println!("Value: {}", val);
    }
}

Variants

None
Node(Vec<u8>)
Int(i32)
String(String)
S64(i64)
Struct(Vec<u8>)
Uint(u32)
Long(i64)
Ulong(u64)
U64(u64)
U8(u8)
U16(u16)
S8(i8)
S16(i16)
S32(i32)
U32(u32)

Trait Implementations

impl Debug for CtlValue[src]

impl Display for CtlValue[src]

impl From<&'_ CtlValue> for CtlType[src]

impl From<CtlValue> for CtlType[src]

impl PartialEq<CtlValue> for CtlValue[src]

impl PartialOrd<CtlValue> for CtlValue[src]

impl StructuralPartialEq for CtlValue[src]

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> ToString for T where
    T: Display + ?Sized
[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.