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
impl Limits
Sourcepub fn set_property_from_strings(
&mut self,
name: &str,
soft_string: &str,
hard_string: &str,
)
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§
impl Eq for Limits
impl StructuralPartialEq for Limits
Auto Trait Implementations§
impl Freeze for Limits
impl RefUnwindSafe for Limits
impl Send for Limits
impl Sync for Limits
impl Unpin for Limits
impl UnwindSafe for Limits
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