pub struct CgroupBuilder { /* private fields */ }Expand description
A control group builder instance
Implementations§
Source§impl CgroupBuilder
impl CgroupBuilder
Sourcepub fn new(name: &str) -> CgroupBuilder
pub fn new(name: &str) -> CgroupBuilder
Start building a control group with the supplied hierarchy and name pair.
Note that this does not actually create the control group until build() is called.
Sourcepub fn memory(self) -> MemoryResourceBuilder
pub fn memory(self) -> MemoryResourceBuilder
Builds the memory resources of the control group.
Sourcepub fn pid(self) -> PidResourceBuilder
pub fn pid(self) -> PidResourceBuilder
Builds the pid resources of the control group.
Sourcepub fn cpu(self) -> CpuResourceBuilder
pub fn cpu(self) -> CpuResourceBuilder
Builds the cpu resources of the control group.
Sourcepub fn devices(self) -> DeviceResourceBuilder
pub fn devices(self) -> DeviceResourceBuilder
Builds the devices resources of the control group, disallowing or allowing access to certain devices in the system.
Sourcepub fn network(self) -> NetworkResourceBuilder
pub fn network(self) -> NetworkResourceBuilder
Builds the network resources of the control group, setting class id, or various priorities on networking interfaces.
Sourcepub fn hugepages(self) -> HugepagesResourceBuilder
pub fn hugepages(self) -> HugepagesResourceBuilder
Builds the hugepage/hugetlb resources available to the control group.
Sourcepub fn blkio(self) -> BlkIoResourcesBuilder
pub fn blkio(self) -> BlkIoResourcesBuilder
Builds the block I/O resources available for the control group.
Sourcepub fn build(self, hier: Box<dyn Hierarchy>) -> Result<Cgroup, Error>
pub fn build(self, hier: Box<dyn Hierarchy>) -> Result<Cgroup, Error>
Finalize the control group, consuming the builder and creating the control group.
Sourcepub fn set_specified_controllers(
self,
specified_controllers: Vec<String>,
) -> Self
pub fn set_specified_controllers( self, specified_controllers: Vec<String>, ) -> Self
Specifically enable some controllers in the control group.