Skip to main content

Limits

Struct Limits 

Source
pub struct Limits {
Show 16 fields pub max_cpu_time: Limit, pub max_file_size: Limit, pub max_data_size: Limit, pub max_stack_size: Limit, pub max_core_file_size: Limit, pub max_resident_set: Limit, pub max_processes: Limit, pub max_open_files: Limit, pub max_locked_memory: Limit, pub max_address_space: Limit, pub max_file_locks: Limit, pub max_pending_signals: Limit, pub max_msgqueue_size: Limit, pub max_nice_priority: Limit, pub max_realtime_priority: Limit, pub max_realtime_timeout: Limit,
}
Expand description

A structure containing all possible properties that can be limited by a GNU/Linux operating system.

Fields§

§max_cpu_time: Limit§max_file_size: Limit§max_data_size: Limit§max_stack_size: Limit§max_core_file_size: Limit§max_resident_set: Limit§max_processes: Limit§max_open_files: Limit§max_locked_memory: Limit§max_address_space: Limit§max_file_locks: Limit§max_pending_signals: Limit§max_msgqueue_size: Limit§max_nice_priority: Limit§max_realtime_priority: Limit§max_realtime_timeout: Limit

Implementations§

Source§

impl Limits

Source

pub fn set_property_from_strings( &mut self, name: &str, soft_string: &str, hard_string: &str, )

Set properties on a Limit structure, as read from strings.

§Examples
use limits_rs::{Limit, Limits};

// Create a new limits structure
let mut limits = Limits::default();

// Trying to set a non-existing property should do nothing
limits.set_property_from_strings("Does_not_exist", "123", "456");
assert_eq!(limits, Limits::default());

// Let's set a limit for a existing property and assert that the limit is actually stored in
// the structure
limits.set_property_from_strings("Max file locks", "123", "456");
assert_eq!(limits.max_file_locks, Limit { soft: Some(123), hard: Some(456) })

Trait Implementations§

Source§

impl Debug for Limits

Source§

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

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

impl Default for Limits

Source§

fn default() -> Limits

Returns the “default value” for a type. Read more
Source§

impl PartialEq for Limits

Source§

fn eq(&self, other: &Limits) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for Limits

Source§

impl StructuralPartialEq for Limits

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.