Struct rlimit::Resource[][src]

pub struct Resource { /* fields omitted */ }
Expand description

A kind of resource.

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

NetBSD: https://man.netbsd.org/getrlimit.2

Implementations

Set resource limits.

Errors

See setrlimit

Get resource limits.

Errors

See getrlimit

Returns the name of the resource.

Example

assert_eq!(Resource::NOFILE.as_name(), "RLIMIT_NOFILE");

Returns available resource names.

Returns available resources.

Returns the raw resource type.

Be careful: The actual type of RawResource can be different on different platforms.

The maximum size (in bytes) of the process’s virtual memory (address space).

The maximum size (in bytes) of a core file that the process may dump.

A limit (in seconds) on the amount of CPU time that the process can consume.

The maximum size (in bytes) of the process’s data segment (initialized data, uninitialized data, and heap).

The maximum size (in bytes) of files that the process may create.

The maximum number (in bytes) of memory that may be locked into RAM.

This specifies a value one greater than the maximum file descriptor number that can be opened by this process.

A limit on the number of extant process (or, more precisely on Linux, threads) for the real user ID of the calling process.

A limit (in bytes) on the process’s resident set (the number of virtual pages resident in RAM).

The maximum size (in bytes) of the process stack.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.