Expand description
This struct represents a system control.
Fields
oid: Vec<c_int>
Trait Implementations
sourceimpl IntoIterator for Ctl
impl IntoIterator for Ctl
Ctl implements the IntoIterator trait to allow for easy iteration over nodes.
Example
use sysctl::Sysctl;
let kern = sysctl::Ctl::new("kern");
for ctl in kern {
println!("{}", ctl.name().unwrap());
}
sourceimpl Sysctl for Ctl
impl Sysctl for Ctl
sourcefn name(&self) -> Result<String, SysctlError>
fn name(&self) -> Result<String, SysctlError>
Returns a result containing the sysctl name on success, or a SysctlError on failure. Read more
sourcefn value_type(&self) -> Result<CtlType, SysctlError>
fn value_type(&self) -> Result<CtlType, SysctlError>
Returns a result containing the sysctl value type on success, or a Sysctl Error on failure. Read more
sourcefn description(&self) -> Result<String, SysctlError>
fn description(&self) -> Result<String, SysctlError>
Returns a result containing the sysctl description if success, or an Error on failure. Read more
sourcefn value(&self) -> Result<CtlValue, SysctlError>
fn value(&self) -> Result<CtlValue, SysctlError>
Returns a result containing the sysctl value on success, or a SysctlError on failure. Read more
sourcefn value_as<T>(&self) -> Result<Box<T>, SysctlError>
fn value_as<T>(&self) -> Result<Box<T>, SysctlError>
A generic method that takes returns a result containing the sysctl value if success, or a SysctlError on failure. Read more
sourcefn value_string(&self) -> Result<String, SysctlError>
fn value_string(&self) -> Result<String, SysctlError>
Returns a result containing the sysctl value as String on success, or a SysctlError on failure. Read more
sourcefn set_value(&self, value: CtlValue) -> Result<CtlValue, SysctlError>
fn set_value(&self, value: CtlValue) -> Result<CtlValue, SysctlError>
Sets the value of a sysctl. Fetches and returns the new value if successful, or returns a SysctlError on failure. Read more
sourcefn set_value_string(&self, value: &str) -> Result<String, SysctlError>
fn set_value_string(&self, value: &str) -> Result<String, SysctlError>
Sets the value of a sysctl with input as string. Fetches and returns the new value if successful, or returns a SysctlError on failure. Read more
impl StructuralPartialEq for Ctl
Auto Trait Implementations
impl RefUnwindSafe for Ctl
impl Send for Ctl
impl Sync for Ctl
impl Unpin for Ctl
impl UnwindSafe for Ctl
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more