[−][src]Struct rctl::Limit
Defines how much of a [Resource] a process can use beofore the defined [Action] triggers.
Implementations
impl Limit
[src]
pub fn amount(amount: usize) -> Limit
[src]
Construct a limit representing the amount used before an [Action] triggers.
The entity the amount gets accounted for defaults to the type of the [Subject] of the respective [Rule].
pub fn amount_per(amount: usize, per: SubjectType) -> Limit
[src]
Limit the amount per [SubjectType].
This defines what entity the amount gets accounted for.
Examples
For example the following [Rule] means that each process of any user belonging to the login class "users" may allocate up to 100 MiB of virtual memory:
Rule { subject: Subject::login_class("users"), resource: Resource::VMemoryUse, action: Action::Deny, limit: Limit::amount_per(100*1024*1024, SubjectType::Process), }
Setting per: Some(SubjectType::User)
on the above [Rule] would mean
that for each user belonging to the login class "users", the sum of
virtual memory allocated by all the processes of that user will not
exceed 100 MiB.
Setting per: Some(SubjectType::LoginClass)
on the above [Rule] would
mean that the sum of virtual memory allocated by all processes of all
users belonging to that login class will not exceed 100 MiB.
pub fn to_string(&self) -> String
[src]
Return the String representation of the Limit.
Trait Implementations
impl Clone for Limit
[src]
impl Debug for Limit
[src]
impl Display for Limit
[src]
impl Eq for Limit
[src]
impl<'a> From<&'a Limit> for Filter
[src]
impl From<Limit> for Filter
[src]
impl FromStr for Limit
[src]
type Err = ParseError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl Hash for Limit
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<'a> Into<String> for &'a Limit
[src]
impl PartialEq<Limit> for Limit
[src]
impl StructuralEq for Limit
[src]
impl StructuralPartialEq for Limit
[src]
Auto Trait Implementations
impl RefUnwindSafe for Limit
impl Send for Limit
impl Sync for Limit
impl Unpin for Limit
impl UnwindSafe for Limit
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,