pub enum CtlValue {
}
Expand description
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)
Temperature(Temperature)
Trait Implementations
sourceimpl PartialOrd<CtlValue> for CtlValue
impl PartialOrd<CtlValue> for CtlValue
sourcefn partial_cmp(&self, other: &CtlValue) -> Option<Ordering>
fn partial_cmp(&self, other: &CtlValue) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl StructuralPartialEq for CtlValue
Auto Trait Implementations
impl RefUnwindSafe for CtlValue
impl Send for CtlValue
impl Sync for CtlValue
impl Unpin for CtlValue
impl UnwindSafe for CtlValue
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more