[][src]Struct limits_rs::Limits

pub struct Limits {
    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,
}

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

Fields

max_cpu_time: Limitmax_file_size: Limitmax_data_size: Limitmax_stack_size: Limitmax_core_file_size: Limitmax_resident_set: Limitmax_processes: Limitmax_open_files: Limitmax_locked_memory: Limitmax_address_space: Limitmax_file_locks: Limitmax_pending_signals: Limitmax_msgqueue_size: Limitmax_nice_priority: Limitmax_realtime_priority: Limitmax_realtime_timeout: Limit

Methods

impl Limits[src]

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

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

impl Debug for Limits[src]

impl Default for Limits[src]

impl Eq for Limits[src]

impl PartialEq<Limits> for Limits[src]

impl StructuralEq for Limits[src]

impl StructuralPartialEq for Limits[src]

Auto Trait Implementations

impl RefUnwindSafe for Limits

impl Send for Limits

impl Sync for Limits

impl Unpin for Limits

impl UnwindSafe for Limits

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.