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

A controller that allows controlling the net_prio subsystem of a Cgroup.

In essence, using net_prio one can set the priority of the packets emitted from the control group’s tasks. This can then be used to have QoS restrictions on certain control groups and thus, prioritizing certain tasks.

Implementations§

source§

impl NetPrioController

source

pub fn new(root: PathBuf) -> Self

Constructs a new NetPrioController with root serving as the root of the control group.

source

pub fn prio_idx(&self) -> u64

Retrieves the current priority of the emitted packets.

source

pub fn ifpriomap(&self) -> Result<HashMap<String, u64>>

A map of priorities for each network interface.

source

pub fn set_if_prio(&self, eif: &str, prio: u64) -> Result<()>

Set the priority of the network traffic on eif to be prio.

Trait Implementations§

source§

impl Clone for NetPrioController

source§

fn clone(&self) -> NetPrioController

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for NetPrioController

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> From<&'a Subsystem> for &'a NetPrioController

source§

fn from(sub: &'a Subsystem) -> &'a NetPrioController

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> Controller for Twhere T: ControllerInternal,

source§

fn apply(&self, res: &Resources) -> Result<(), Error>

Apply a set of resources to the Controller, invoking its internal functions to pass the kernel the information.

source§

fn create(&self)

Create this controller

source§

fn set_notify_on_release(&self, enable: bool) -> Result<(), Error>

Set notify_on_release

source§

fn set_release_agent(&self, path: &str) -> Result<(), Error>

Set release_agent

source§

fn exists(&self) -> bool

Does this controller already exist?

source§

fn delete(&self) -> Result<(), Error>

Delete the controller.

source§

fn add_task(&self, pid: &CgroupPid) -> Result<(), Error>

Attach a task to this controller.

source§

fn add_task_by_tgid(&self, pid: &CgroupPid) -> Result<(), Error>

Attach a task to this controller by thread group id.

source§

fn procs(&self) -> Vec<CgroupPid, Global>

Get the list of procs that this controller has.

source§

fn tasks(&self) -> Vec<CgroupPid, Global>

Get the list of tasks that this controller has.

source§

fn set_cgroup_type(&self, cgroup_type: &str) -> Result<(), Error>

set cgroup.type

source§

fn get_cgroup_type(&self) -> Result<String, Error>

get cgroup.type

source§

fn control_type(&self) -> Controllers

source§

fn path(&self) -> &Path

The file system path to the controller.
source§

fn v2(&self) -> bool

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.