pub struct AutomanagedCgroup { /* private fields */ }
Expand description

An automatically managed controller of a specific cgroups subsystem.

It is a wrapper around Cgroup type which automatically creates (on init) and removes (on drop) a cgroup in a given subsystem.

Since it is a wrapper, all the methods from Cgroup type are directly available for AutomanagedCgroup instances.

Implementations§

Inits a cgroup, which means that it creates a cgroup in a given subsystem.

Notes:

  • If there is an existing cgroup, it will be recreated from scratch. If that is not what you what, consider using Cgroup type instead.
  • The cgroup will be automatically removed once the AutomanagedCgroup instance is dropped.

Methods from Deref<Target = Cgroup>§

Creates a cgroups namespace.

Notes:

  • Keep in mind the usual filesystem permissions (owner, group, and mode bits).

Removes a cgroups namespace.

Notes:

  • This method will fail if there are nested cgroups.
  • Keep in mind the usual filesystem permissions (owner, group, and mode bits).

Sets a binary or string value to the cgroup control file.

Sets a value to the cgroup control file.

Gets a string value from cgroup control file.

Gets a value from cgroup control file.

Attaches a task (thread) to the cgroup.

Lists tasks (threads) attached to the cgroup.

Kills (SIGKILL) all the attached to the cgroup tasks.

Trait Implementations§

Converts this type into a shared reference of the (usually inferred) input type.
The resulting type after dereferencing.
Dereferences the value.
Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.