[][src]Struct rlimit::Rlim

pub struct Rlim(_);

Unsigned integer type used for limit values.

Arithmetic operations with Self are delegated to the inner RawRlim.

Arithmetic operation with usize converts the rhs to RawRlim and computes the result by two RawRlim values.

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

Panics

Panics if the usize operand can not be converted to RawRlim.

Panics in debug mode if arithmetic overflow occurred .

Features

Enables the feature serde to implement Serialize and Deserialize for Rlim with the attribute serde(transparent).

Implementations

impl Rlim[src]

pub const INFINITY: Self[src]

A value of Rlim indicating no limit.

pub const SAVED_CUR: Self[src]

A value of type Rlim indicating an unrepresentable saved soft limit.

pub const SAVED_MAX: Self[src]

A value of type Rlim indicating an unrepresentable saved hard limit.

impl Rlim[src]

#[must_use]pub const fn from_raw(rlim: RawRlim) -> Self[src]

Wraps a raw value of limit as Rlim.

Example

// The integer type is inferred by compiler.
const DEFAULT_LIMIT: Rlim = Rlim::from_raw(42);

#[must_use]pub const fn as_raw(self) -> RawRlim[src]

Returns a raw value of limit.

#[must_use]pub fn from_usize(n: usize) -> Self[src]

Converts usize to Rlim

Panics

Panics if the usize value can not be converted to RawRlim.

#[must_use]pub fn as_usize(self) -> usize[src]

Converts Rlim to usize

Panics

Panics if the wrapped RawRlim value can not be converted to usize.

impl Rlim[src]

pub fn checked_add(self, rhs: Self) -> Option<Self>[src]

Checked integer arithmetic. Returns None if overflow occurred.

pub fn checked_sub(self, rhs: Self) -> Option<Self>[src]

Checked integer arithmetic. Returns None if overflow occurred.

pub fn checked_mul(self, rhs: Self) -> Option<Self>[src]

Checked integer arithmetic. Returns None if overflow occurred.

pub fn checked_div(self, rhs: Self) -> Option<Self>[src]

Checked integer arithmetic. Returns None if overflow occurred.

impl Rlim[src]

#[must_use]pub fn wrapping_add(self, rhs: Self) -> Self[src]

Wrapping (modular) arithmetic. Wraps around at the boundary of the inner RawRlim.

#[must_use]pub fn wrapping_sub(self, rhs: Self) -> Self[src]

Wrapping (modular) arithmetic. Wraps around at the boundary of the inner RawRlim.

#[must_use]pub fn wrapping_mul(self, rhs: Self) -> Self[src]

Wrapping (modular) arithmetic. Wraps around at the boundary of the inner RawRlim.

#[must_use]pub fn wrapping_div(self, rhs: Self) -> Self[src]

Wrapping (modular) arithmetic. Wraps around at the boundary of the inner RawRlim.

Trait Implementations

impl Add<Rlim> for Rlim[src]

type Output = Self

The resulting type after applying the + operator.

impl Add<usize> for Rlim[src]

type Output = Self

The resulting type after applying the + operator.

impl AddAssign<Rlim> for Rlim[src]

impl AddAssign<usize> for Rlim[src]

impl Clone for Rlim[src]

impl Copy for Rlim[src]

impl Debug for Rlim[src]

impl Default for Rlim[src]

impl<'de> Deserialize<'de> for Rlim[src]

impl Display for Rlim[src]

impl Div<Rlim> for Rlim[src]

type Output = Self

The resulting type after applying the / operator.

impl Div<usize> for Rlim[src]

type Output = Self

The resulting type after applying the / operator.

impl DivAssign<Rlim> for Rlim[src]

impl DivAssign<usize> for Rlim[src]

impl Eq for Rlim[src]

impl FromStr for Rlim[src]

type Err = ParseIntError

The associated error which can be returned from parsing.

impl Hash for Rlim[src]

impl Mul<Rlim> for Rlim[src]

type Output = Self

The resulting type after applying the * operator.

impl Mul<usize> for Rlim[src]

type Output = Self

The resulting type after applying the * operator.

impl MulAssign<Rlim> for Rlim[src]

impl MulAssign<usize> for Rlim[src]

impl Ord for Rlim[src]

impl PartialEq<Rlim> for Rlim[src]

impl PartialOrd<Rlim> for Rlim[src]

impl Serialize for Rlim[src]

impl StructuralEq for Rlim[src]

impl StructuralPartialEq for Rlim[src]

impl Sub<Rlim> for Rlim[src]

type Output = Self

The resulting type after applying the - operator.

impl Sub<usize> for Rlim[src]

type Output = Self

The resulting type after applying the - operator.

impl SubAssign<Rlim> for Rlim[src]

impl SubAssign<usize> for Rlim[src]

impl TryFrom<Rlim> for usize[src]

type Error = TryFromIntError

The type returned in the event of a conversion error.

impl TryFrom<usize> for Rlim[src]

type Error = TryFromIntError

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for Rlim

impl Send for Rlim

impl Sync for Rlim

impl Unpin for Rlim

impl UnwindSafe for Rlim

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[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.