[−][src]Struct rlimit::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]
#[must_use]pub fn as_usize(self) -> usize
[src]
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.
fn add(self, rhs: Self) -> Self::Output
[src]
impl Add<usize> for Rlim
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, rhs: usize) -> Self::Output
[src]
impl AddAssign<Rlim> for Rlim
[src]
fn add_assign(&mut self, rhs: Self)
[src]
impl AddAssign<usize> for Rlim
[src]
fn add_assign(&mut self, rhs: usize)
[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]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Display for Rlim
[src]
impl Div<Rlim> for Rlim
[src]
type Output = Self
The resulting type after applying the /
operator.
fn div(self, rhs: Self) -> Self::Output
[src]
impl Div<usize> for Rlim
[src]
type Output = Self
The resulting type after applying the /
operator.
fn div(self, rhs: usize) -> Self::Output
[src]
impl DivAssign<Rlim> for Rlim
[src]
fn div_assign(&mut self, rhs: Self)
[src]
impl DivAssign<usize> for Rlim
[src]
fn div_assign(&mut self, rhs: usize)
[src]
impl Eq for Rlim
[src]
impl FromStr for Rlim
[src]
type Err = ParseIntError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl Hash for Rlim
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Mul<Rlim> for Rlim
[src]
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, rhs: Self) -> Self::Output
[src]
impl Mul<usize> for Rlim
[src]
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, rhs: usize) -> Self::Output
[src]
impl MulAssign<Rlim> for Rlim
[src]
fn mul_assign(&mut self, rhs: Self)
[src]
impl MulAssign<usize> for Rlim
[src]
fn mul_assign(&mut self, rhs: usize)
[src]
impl Ord for Rlim
[src]
fn cmp(&self, other: &Rlim) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Rlim> for Rlim
[src]
impl PartialOrd<Rlim> for Rlim
[src]
fn partial_cmp(&self, other: &Rlim) -> Option<Ordering>
[src]
fn lt(&self, other: &Rlim) -> bool
[src]
fn le(&self, other: &Rlim) -> bool
[src]
fn gt(&self, other: &Rlim) -> bool
[src]
fn ge(&self, other: &Rlim) -> bool
[src]
impl Serialize for Rlim
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
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.
fn sub(self, rhs: Self) -> Self::Output
[src]
impl Sub<usize> for Rlim
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, rhs: usize) -> Self::Output
[src]
impl SubAssign<Rlim> for Rlim
[src]
fn sub_assign(&mut self, rhs: Self)
[src]
impl SubAssign<usize> for Rlim
[src]
fn sub_assign(&mut self, rhs: usize)
[src]
impl TryFrom<Rlim> for usize
[src]
type Error = TryFromIntError
The type returned in the event of a conversion error.
fn try_from(r: Rlim) -> Result<Self, Self::Error>
[src]
impl TryFrom<usize> for Rlim
[src]
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,