[−][src]Enum rctl::State
Enum representing the state of RACCT
/RCTL
in the kernel.
Variants
RCTL
/ RACCT
is present in the kernel, but is not enabled via the
kern.racct.enable
tunable.
RCTL
/ RACCT
is enabled.
RCTL
/ RACCT
is disabled.
The kernel does not support RCTL
/ RACCT
. The following options have
to be set in the kernel configuration when compiling the kernel to
add support for RCTL
/ RACCT
:
options RACCT options RCTL
RCTL
is not available within a Jail
Implementations
impl State
[src]
pub fn check() -> State
[src]
Check the state of the RCTL
/ RACCT
support.
This queries the kern.racct.enable
sysctl. If this fails in any way,
(most probably by the sysctl not being present), the kernel is assumed
to be compiled without the RCTL
/ RACCT
options.
Example
let state = rctl::State::check();
pub fn is_enabled(&self) -> bool
[src]
Return true
if the RCTL
/ RACCT
support is Enabled.
Examples
if rctl::State::check().is_enabled() { // do things requiring `RCTL` / `RACCT` support. }
pub fn is_present(&self) -> bool
[src]
Return true
if the kernel has RCTL
/ RACCT
support compiled in.
Examples
if ! rctl::State::check().is_present() { println!("The kernel does not have RCTL / RACCT support"); }
Trait Implementations
impl Clone for State
[src]
impl Copy for State
[src]
impl Debug for State
[src]
impl Display for State
[src]
impl Eq for State
[src]
impl Hash for State
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<State> for State
[src]
impl StructuralEq for State
[src]
impl StructuralPartialEq for State
[src]
Auto Trait Implementations
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnwindSafe for State
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,