[][src]Enum sysctl::CtlValue

pub enum CtlValue {
    None,
    Node(Vec<u8>),
    Int(i32),
    String(String),
    S64(u64),
    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

This example is not tested
let val_enum = sysctl::value("kern.osrevision");

if let sysctl::CtlValue::Int(val) = val_enum {
    println!("Value: {}", val);
}

Variants

NoneNode(Vec<u8>)Int(i32)String(String)S64(u64)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<'a> From<&'a CtlValue> for CtlType[src]

impl PartialOrd<CtlValue> for CtlValue[src]

impl PartialEq<CtlValue> for CtlValue[src]

impl Display for CtlValue[src]

impl Debug for CtlValue[src]

Auto Trait Implementations

Blanket Implementations

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.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]