Struct deranged::I64[][src]

#[repr(transparent)]
pub struct I64<const MIN: i64, const MAX: i64>(_);
Expand description

An i64 that is known to be in the range MIN..=MAX.

Implementations

The smallest value that can be represented by this type.

The largest value that can be represented by this type.

Creates a ranged integer without checking the value.

Safety

The value must be within the range MIN..=MAX.

Creates a ranged integer if the given value is in the range MIN..=MAX.

Returns the value as a primitive type.

Checked integer addition. Computes self + rhs, returning None if the resulting value is out of range.

Checked integer addition. Computes self - rhs, returning None if the resulting value is out of range.

Checked integer addition. Computes self * rhs, returning None if the resulting value is out of range.

Checked integer addition. Computes self / rhs, returning None if rhs == 0 or if the resulting value is out of range.

Checked Euclidean division. Computes self.div_euclid(rhs), returning None if rhs == 0 or if the resulting value is out of range.

Checked integer remainder. Computes self % rhs, returning None if rhs == 0 or if the resulting value is out of range.

Checked Euclidean remainder. Computes self.rem_euclid(rhs), returning None if rhs == 0 or if the resulting value is out of range.

Checked negation. Computes -self, returning None if the resulting value is out of range.

Checked shift left. Computes self << rhs, returning None if the resulting value is out of range.

Checked shift right. Computes self >> rhs, returning None if the resulting value is out of range.

Checked absolute value. Computes self.abs(), returning None if the resulting value is out of range.

Checked exponentiation. Computes self.pow(exp), returning None if the resulting value is out of range.

Saturating integer addition. Computes self + rhs, saturating at the numeric bounds.

Saturating integer subtraction. Computes self - rhs, saturating at the numeric bounds.

Saturating integer negation. Computes self - rhs, saturating at the numeric bounds.

Saturating absolute value. Computes self.abs(), saturating at the numeric bounds.

Saturating integer multiplication. Computes self * rhs, saturating at the numeric bounds.

Saturating integer exponentiation. Computes self.pow(exp), saturating at the numeric bounds.

Trait Implementations

Performs the conversion.

Formats the value using the given formatter.

Immutably borrows from an owned value. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Formats the value using the given formatter. Read more

Generate a random value of T, using rng as the source of randomness.

Create an iterator that generates random values of T, using rng as the source of randomness. Read more

Create a distribution of values of ‘S’ by mapping the output of Self through the closure F Read more

Performs the conversion.

Performs the conversion.

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

Formats the value using the given formatter.

Formats the value using the given formatter.

Formats the value using the given formatter.

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

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

This method tests for !=.

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

This method tests for !=.

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

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Serialize this value into the given Serde serializer. 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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

Formats the value using the given formatter.

Formats the value using the given formatter.

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)

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

Converts the given value to a String. 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.