pub struct Explorer { /* private fields */ }Expand description
An interface to explore cgroups in the system.
§Example
use cgroups_explorer::Explorer;
let explorer = Explorer::detect_version()
.include(vec!["user.slice/*".to_string()])
.build()
.expect("Failed to build explorer");
let found = explorer
.iter_cgroups()
.for_each(|c| println!("Found cgroup: {}", c.path()));
Implementations§
Source§impl Explorer
impl Explorer
Sourcepub fn v1() -> ExplorerBuilder
pub fn v1() -> ExplorerBuilder
Create a new ExplorerBuilder for cgroups v1.
Sourcepub fn v2() -> ExplorerBuilder
pub fn v2() -> ExplorerBuilder
Create a new ExplorerBuilder for cgroups v2.
Sourcepub fn detect_version() -> ExplorerBuilder
pub fn detect_version() -> ExplorerBuilder
Create a new ExplorerBuilder by detecting the cgroups version on the system.
Sourcepub fn iter_cgroups(&self) -> Box<dyn Iterator<Item = Cgroup>>
pub fn iter_cgroups(&self) -> Box<dyn Iterator<Item = Cgroup>>
Create an iterator over all cgroups in the system, based on the criteria.
Auto Trait Implementations§
impl Freeze for Explorer
impl !RefUnwindSafe for Explorer
impl Send for Explorer
impl Sync for Explorer
impl Unpin for Explorer
impl !UnwindSafe for Explorer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more