pub struct ResourceLimits { /* private fields */ }Expand description
Resource limits manager
Implementations§
Source§impl ResourceLimits
impl ResourceLimits
pub fn new() -> Self
Sourcepub fn find_by_name(&self, name: &str) -> Option<&'static ResInfo>
pub fn find_by_name(&self, name: &str) -> Option<&'static ResInfo>
Get resource info by name (prefix match)
Sourcepub fn find_by_opt(&self, opt: char) -> Option<&'static ResInfo>
pub fn find_by_opt(&self, opt: char) -> Option<&'static ResInfo>
Get resource info by option character
Sourcepub fn find_by_res(&self, res: i32) -> Option<&'static ResInfo>
pub fn find_by_res(&self, res: i32) -> Option<&'static ResInfo>
Get resource info by resource number
Sourcepub fn get(&self, res: i32) -> Result<(LimitValue, LimitValue), String>
pub fn get(&self, res: i32) -> Result<(LimitValue, LimitValue), String>
Get current limit (soft and hard)
Sourcepub fn set(
&mut self,
res: i32,
soft: Option<LimitValue>,
hard: Option<LimitValue>,
) -> Result<(), String>
pub fn set( &mut self, res: i32, soft: Option<LimitValue>, hard: Option<LimitValue>, ) -> Result<(), String>
Set a limit
Trait Implementations§
Source§impl Debug for ResourceLimits
impl Debug for ResourceLimits
Source§impl Default for ResourceLimits
impl Default for ResourceLimits
Source§fn default() -> ResourceLimits
fn default() -> ResourceLimits
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ResourceLimits
impl RefUnwindSafe for ResourceLimits
impl Send for ResourceLimits
impl Sync for ResourceLimits
impl Unpin for ResourceLimits
impl UnsafeUnpin for ResourceLimits
impl UnwindSafe for ResourceLimits
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