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 = Self{tag: 1, value: C::RLIMIT_AS as u8,}
pub const AS: Self = Self{tag: 1, value: C::RLIMIT_AS as u8,}
The maximum size (in bytes) of the process’s virtual memory (address space).
sourcepub const CORE: Self = Self{tag: 2, value: C::RLIMIT_CORE as u8,}
pub const CORE: Self = Self{tag: 2, value: C::RLIMIT_CORE as u8,}
The maximum size (in bytes) of a core file that the process may dump.
sourcepub const CPU: Self = Self{tag: 3, value: C::RLIMIT_CPU as u8,}
pub const CPU: Self = Self{tag: 3, value: C::RLIMIT_CPU as u8,}
A limit (in seconds) on the amount of CPU time that the process can consume.
sourcepub const DATA: Self = Self{tag: 4, value: C::RLIMIT_DATA as u8,}
pub const DATA: Self = Self{tag: 4, value: C::RLIMIT_DATA as u8,}
The maximum size (in bytes) of the process’s data segment (initialized data, uninitialized data, and heap).
sourcepub const FSIZE: Self = Self{tag: 5, value: C::RLIMIT_FSIZE as u8,}
pub const FSIZE: Self = Self{tag: 5, value: C::RLIMIT_FSIZE as u8,}
The maximum size (in bytes) of files that the process may create.
sourcepub const KQUEUES: Self = Self{tag: 6, value: C::RLIMIT_KQUEUES as u8,}
pub const KQUEUES: Self = Self{tag: 6, value: C::RLIMIT_KQUEUES as u8,}
The maximum number of kqueues this user id is allowed to create.
sourcepub const LOCKS: Self = Self{tag: 7, value: C::RLIMIT_LOCKS as u8,}
pub const LOCKS: Self = Self{tag: 7, value: C::RLIMIT_LOCKS as u8,}
(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 MEMLOCK: Self = Self{tag: 8, value: C::RLIMIT_MEMLOCK as u8,}
pub const MEMLOCK: Self = Self{tag: 8, value: C::RLIMIT_MEMLOCK as u8,}
The maximum number (in bytes) of memory that may be locked into RAM.
sourcepub const MSGQUEUE: Self = Self{tag: 9, value: C::RLIMIT_MSGQUEUE as u8,}
pub const MSGQUEUE: Self = Self{tag: 9, value: C::RLIMIT_MSGQUEUE as u8,}
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 = Self{tag: 10, value: C::RLIMIT_NICE as u8,}
pub const NICE: Self = Self{tag: 10, value: C::RLIMIT_NICE as u8,}
This specifies a ceiling
to which the process’s nice value can be raised
using setpriority(2)
or nice(2)
.
sourcepub const NOFILE: Self = Self{tag: 11, value: C::RLIMIT_NOFILE as u8,}
pub const NOFILE: Self = Self{tag: 11, value: C::RLIMIT_NOFILE as u8,}
This specifies a value one greater than the maximum file descriptor number that can be opened by this process.
sourcepub const NOVMON: Self = Self{tag: 12, value: C::RLIMIT_NOVMON as u8,}
pub const NOVMON: Self = Self{tag: 12, value: C::RLIMIT_NOVMON as u8,}
The number of open vnode monitors.
sourcepub const NPROC: Self = Self{tag: 13, value: C::RLIMIT_NPROC as u8,}
pub const NPROC: Self = Self{tag: 13, value: C::RLIMIT_NPROC as u8,}
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 NPTS: Self = Self{tag: 14, value: C::RLIMIT_NPTS as u8,}
pub const NPTS: Self = Self{tag: 14, value: C::RLIMIT_NPTS as u8,}
The maximum number of pseudo-terminals this user id is allowed to create.
sourcepub const NTHR: Self = Self{tag: 15, value: C::RLIMIT_NTHR as u8,}
pub const NTHR: Self = Self{tag: 15, value: C::RLIMIT_NTHR as u8,}
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 = Self{tag: 16, value: C::RLIMIT_POSIXLOCKS as u8,}
pub const POSIXLOCKS: Self = Self{tag: 16, value: C::RLIMIT_POSIXLOCKS as u8,}
The maximum number of POSIX-type advisory-mode locks available to this user.
sourcepub const RSS: Self = Self{tag: 17, value: C::RLIMIT_RSS as u8,}
pub const RSS: Self = Self{tag: 17, value: C::RLIMIT_RSS as u8,}
A limit (in bytes) on the process’s resident set (the number of virtual pages resident in RAM).
sourcepub const RTPRIO: Self = Self{tag: 18, value: C::RLIMIT_RTPRIO as u8,}
pub const RTPRIO: Self = Self{tag: 18, value: C::RLIMIT_RTPRIO as u8,}
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 = Self{tag: 19, value: C::RLIMIT_RTTIME as u8,}
pub const RTTIME: Self = Self{tag: 19, value: C::RLIMIT_RTTIME as u8,}
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 = Self{tag: 20, value: C::RLIMIT_SBSIZE as u8,}
pub const SBSIZE: Self = Self{tag: 20, value: C::RLIMIT_SBSIZE as u8,}
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 = Self{tag: 21, value: C::RLIMIT_SIGPENDING as u8,}
pub const SIGPENDING: Self = Self{tag: 21, value: C::RLIMIT_SIGPENDING as u8,}
A limit on the number of signals that may be queued for the real user ID of the calling process.
sourcepub const STACK: Self = Self{tag: 22, value: C::RLIMIT_STACK as u8,}
pub const STACK: Self = Self{tag: 22, value: C::RLIMIT_STACK as u8,}
The maximum size (in bytes) of the process stack.
sourcepub const SWAP: Self = Self{tag: 23, value: C::RLIMIT_SWAP as u8,}
pub const SWAP: Self = Self{tag: 23, value: C::RLIMIT_SWAP as u8,}
The maximum size (in bytes) of the swap space that may be reserved or used by all of this user id’s processes.
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