Struct a653rs_linux_core::cgroup::CGroup
source · pub struct CGroup { /* private fields */ }Expand description
A single cgroup inside our tree of managed cgroups
The tree is not represented by a traditional tree data structure, as this is very complicated in Rust. Instead, the tree is “calculated” by the path alone.
Implementations§
source§impl CGroup
impl CGroup
sourcepub fn new_root<P: AsRef<Path>>(path: P, name: &str) -> Result<Self>
pub fn new_root<P: AsRef<Path>>(path: P, name: &str) -> Result<Self>
Creates a new cgroup as the root of a sub-tree
path must be the path of an already existing cgroup
sourcepub fn import_root<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn import_root<P: AsRef<Path>>(path: P) -> Result<Self>
Imports an already existing cgroup as the root of a sub-tree
sourcepub fn new_threaded(&self, name: &str) -> Result<Self>
pub fn new_threaded(&self, name: &str) -> Result<Self>
Creates a threaded sub-cgroup inside this one
sourcepub fn kill(&self) -> Result<()>
pub fn kill(&self) -> Result<()>
Kills all processes in this cgroup and returns once this procedure is finished
sourcepub fn get_events_path(&self) -> PathBuf
pub fn get_events_path(&self) -> PathBuf
Returns the path of the event file, which may be polled
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CGroup
impl RefUnwindSafe for CGroup
impl Send for CGroup
impl Sync for CGroup
impl Unpin for CGroup
impl UnwindSafe for CGroup
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more