pub struct Resource { /* private fields */ }
Expand description
A kind of resource.
All resource constants are available on all unix platforms.
Passing an unsupported resource to [set|get|p]rlimit
will
result in a custom IO error.
Be careful: The documentation of Resource
constants are based on a few systems.
It may be inconsistent with other platforms.
References
Linux: https://man7.org/linux/man-pages/man2/getrlimit.2.html
FreeBSD: https://www.freebsd.org/cgi/man.cgi?query=getrlimit
Implementations
sourceimpl Resource
impl Resource
sourceimpl Resource
impl Resource
sourcepub const AS: Self
pub const AS: Self
The maximum size (in bytes) of the process’s virtual memory (address space).
sourcepub const CPU: Self
pub const CPU: Self
A limit (in seconds) on the amount of CPU time that the process can consume.
sourcepub const DATA: Self
pub const DATA: Self
The maximum size (in bytes) of the process’s data segment (initialized data, uninitialized data, and heap).
sourcepub const LOCKS: Self
pub const LOCKS: Self
(early Linux 2.4 only)
A limit on the combined number
of flock(2)
locks and fcntl(2)
leases
that this process may establish.
sourcepub const MSGQUEUE: Self
pub const MSGQUEUE: Self
A limit on the number of bytes that can be allocated for POSIX message queues for the real user ID of the calling process.
sourcepub const NICE: Self
pub const NICE: Self
This specifies a ceiling
to which the process’s nice value can be raised
using setpriority(2)
or nice(2)
.
sourcepub const NOFILE: Self
pub const NOFILE: Self
This specifies a value one greater than the maximum file descriptor number that can be opened by this process.
sourcepub const NPROC: Self
pub const NPROC: Self
A limit on the number of extant process (or, more precisely on Linux, threads) for the real user ID of the calling process.
sourcepub const NTHR: Self
pub const NTHR: Self
The maximum number of simultaneous threads (Lightweight Processes) for this user id. Kernel threads and the first thread of each process are not counted against this limit.
sourcepub const POSIXLOCKS: Self
pub const POSIXLOCKS: Self
The maximum number of POSIX-type advisory-mode locks available to this user.
sourcepub const RSS: Self
pub const RSS: Self
A limit (in bytes) on the process’s resident set (the number of virtual pages resident in RAM).
sourcepub const RTPRIO: Self
pub const RTPRIO: Self
This specifies a ceiling on the real-time priority
that may be set for this process
using sched_setscheduler(2)
and sched_setparam(2)
.
sourcepub const RTTIME: Self
pub const RTTIME: Self
A limit (in microseconds) on the amount of CPU time that a process scheduled under a real-time scheduling policy may consume without making a blocking system call.
sourcepub const SBSIZE: Self
pub const SBSIZE: Self
The maximum size (in bytes) of socket buffer usage for this user. This limits the amount of network memory, and hence the amount of mbufs, that this user may hold at any time.
sourcepub const SIGPENDING: Self
pub const SIGPENDING: Self
A limit on the number of signals that may be queued for the real user ID of the calling process.
Trait Implementations
impl Copy for Resource
impl Eq for Resource
impl StructuralEq for Resource
impl StructuralPartialEq for Resource
Auto Trait Implementations
impl RefUnwindSafe for Resource
impl Send for Resource
impl Sync for Resource
impl Unpin for Resource
impl UnwindSafe for Resource
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more