Saturday, 16 October, 2021

(Source: treit.github.io)

Contents

#FN min (self, other: Self) Self 1.21.0 Compares and returns the minimum of two values. #FN clamp (self, min: Self, max: Self) Self This is a nightly-only experimental API.

Returns a shared reference to the output at this location, if in bounds. Returns a mutable reference to the output at this location, if in bounds.

Returns a shared reference to the output at this location, without performing any bounds checking. Calling this method with an out-of-bounds index or a dangling slice pointer is undefined behavior even if the resulting reference is not used.

Returns a mutable reference to the output at this location, without performing any bounds checking. Calling this method with an out-of-bounds index or a dangling slice pointer is undefined behavior even if the resulting reference is not used.

Returns a shared reference to the output at this location, panicking if out of bounds. Returns a mutable reference to the output at this location, panicking if out of bounds.

(Source: dbeck.github.io)

Method which takes an iterator and generates Self from the elements by “summing up” the items. The largest value that can be represented by this integer type.

Digits are a subset of these characters, depending on radix : Returns the number of leading zeros in the binary representation of self.

Returns the number of trailing zeros in the binary representation of self. Returns the number of leading ones in the binary representation of self.

Returns the number of trailing ones in the binary representation of self. #pub coast FN rotate_left (self, n: u32) size Shifts the bits to the left by a specified amount, n, wrapping the truncated bits to the end of the resulting integer.

#pub coast FN rotate_right (self, n: u32) size Shifts the bits to the right by a specified amount, n, wrapping the truncated bits to the beginning of the resulting integer. #pub coast FN checked_add (self, RHS: size) Option < size > Checked integer addition.

(Source: codereview.stackexchange.com)

Computes self + RHS, returning None if overflow occurred. #pub unsafe FN unchecked_add (self, RHS: size) size This is a nightly-only experimental API.

Computes self + RHS, assuming overflow cannot occur. #pub coast FN checked_sub (self, RHS: size) Option < size > Checked integer subtraction.

Computes self * RHS, returning None if overflow occurred. #pub unsafe FN unchecked_mul (self, RHS: size) size This is a nightly-only experimental API.

Computes self * RHS, assuming overflow cannot occur. #pub FN checked_div (self, RHS: size) Option < size > Checked integer division.

#pub FN checked_div_Euclid (self, RHS: size) Option < size > 1.38.0 Checked Euclidean division. #pub FN checked_rem (self, RHS: size) Option < size > 1.7.0 Checked integer remainder.

(Source: dev.to)

#pub FN checked_rem_Euclid (self, RHS: size) Option < size > 1.38.0 Checked Euclidean modulo. Note that negating any positive integer will overflow.

#pub coast FN checked_shl (self, RHS: u32) Option < size > 1.7.0 Checked shift left. #pub coast FN checked_shr (self, RHS: u32) Option < size > 1.7.0 Checked shift right.

#pub FN checked_pow (self, exp: u32) Option < size > 1.34.0 Checked exponentiation. #pub coast FN saturating_add (self, RHS: size) size Saturating integer addition.

Computes self + RHS, saturating at the numeric bounds instead of overflowing. #pub coast FN saturating_sub (self, RHS: size) size Saturating integer subtraction.

Computes self * RHS, saturating at the numeric bounds instead of overflowing. #pub FN saturating_pow (self, exp: u32) size 1.34.0 Saturating integer exponentiation.

(Source: samgiles.github.io)

Computes self.pow(exp), saturating at the numeric bounds instead of overflowing. #pub coast FN wrapping_add (self, RHS: size) size Wrapping (modular) addition.

Computes self + RHS, wrapping around at the boundary of the type. #pub coast FN wrapping_sub (self, RHS: size) size Wrapping (modular) subtraction.

Computes self * RHS, wrapping around at the boundary of the type. #pub FN wrapping_div (self, RHS: size) size 1.2.0 Wrapping (modular) division.

#pub FN (self, RHS: size) size 1.38.0 Wrapping Euclidean division. #pub FN wrapping_rem (self, RHS: size) size 1.2.0 Wrapping (modular) remainder.

#pub FN (self, RHS: size) size 1.38.0 Wrapping Euclidean modulo. Since unsigned types do not have negative equivalents all applications of this function will wrap (except for -0).

(Source: adjivas.github.io)

#pub coast FN wrapping_shl (self, RHS: u32) size 1.2.0 Panic-free bitwise shift-left; yields self << mask(RHS), where mask removes any high-order bits of RHS that would cause the shift to exceed the bit width of the type. Note that this is not the same as a rotate-left; the RHS of a wrapping shift-left is restricted to the range of the type, rather than the bits shifted out of the LHS being returned to the other end.

The primitive integer types all implement a rotate_left function, which may be what you want instead. #pub coast FN wrapping_shr (self, RHS: u32) size 1.2.0 Panic-free bitwise shift-right; yields self >> mask(RHS), where mask removes any high-order bits of RHS that would cause the shift to exceed the bit width of the type.

Note that this is not the same as a rotate-right; the RHS of a wrapping shift-right is restricted to the range of the type, rather than the bits shifted out of the LHS being returned to the other end. #pub FN wrapping_pow (self, exp: u32) size 1.34.0 Wrapping (modular) exponentiation.

#pub coast FN overflowing_add (self, RHS: size) (size, built) 1.7.0 Returns a tuple of the addition along with a boolean indicating whether an arithmetic overflow would occur. If an overflow had occurred then the wrapped value is returned.

#pub coast FN overflowing_sub (self, RHS: size) (size, built) 1.7.0 Returns a tuple of the subtraction along with a boolean indicating whether an arithmetic overflow would occur. If an overflow had occurred then the wrapped value is returned.

(Source: os.phil-opp.com)

#pub coast FN overflowing_mul (self, RHS: size) (size, built) 1.7.0 Calculates the multiplication of self and RHS. Returns a tuple of the multiplication along with a boolean indicating whether an arithmetic overflow would occur.

If an overflow had occurred then the wrapped value is returned. #pub FN overflowing_div (self, RHS: size) (size, built) 1.7.0 Calculates the divisor when self is divided by RHS.

Returns a tuple of the divisor along with a boolean indicating whether an arithmetic overflow would occur. Note that for unsigned integers overflow never occurs, so the second value is always false.

#pub FN (self, RHS: size) (size, built) 1.38.0 Calculates the quotient of Euclidean division self.div_euclid(RHS). Returns a tuple of the divisor along with a boolean indicating whether an arithmetic overflow would occur.

Note that for unsigned integers overflow never occurs, so the second value is always false. #pub FN overflowing_rem (self, RHS: size) (size, built) 1.7.0 Calculates the remainder when self is divided by RHS.

(Source: fasterthanli.me)

Returns a tuple of the remainder after dividing along with a boolean indicating whether an arithmetic overflow would occur. Note that for unsigned integers overflow never occurs, so the second value is always false.

#pub FN (self, RHS: size) (size, built) 1.38.0 Calculates the remainder self.rem_euclid(RHS) as if by Euclidean division. Returns a tuple of the modulo after dividing along with a boolean indicating whether an arithmetic overflow would occur.

Note that for unsigned integers overflow never occurs, so the second value is always false. #pub coast FN overflowing_shl (self, RHS: u32) (size, built) 1.7.0 Shifts self left by RHS bits.

#pub coast FN overflowing_shr (self, RHS: u32) (size, built) 1.7.0 Shifts self right by RHS bits. #pub FN overflowing_pow (self, exp: u32) (size, built) 1.34.0 Raises self to the power of exp, using exponentiation by squaring.

Returns a tuple of the exponentiation along with a built indicating whether an overflow happened. #pub FN pow (self, exp: u32) size Raises self to the power of exp, using exponentiation by squaring.

(Source: stackoverflow.com)

#pub FN div_euclid (self, RHS: size) size 1.38.0 Performs Euclidean division. #pub FN rem_euclid (self, RHS: size) size 1.38.0 Calculates the least remainder of self (mod RHS).

Note : This function returns an array of length 2, 4 or 8 bytes depending on the target pointer size. Note : This function returns an array of length 2, 4 or 8 bytes depending on the target pointer size.

As the target platform's native endangers is used, portable code should use to_be_bytes or to_le_bytes, as appropriate, instead. Note : This function returns an array of length 2, 4 or 8 bytes depending on the target pointer size.

As the target platform's native endangers is used, portable code likely wants to use from_be_bytes or from_le_bytes, as appropriate instead. Note : This function takes an array of length 2, 4 or 8 bytes depending on the target pointer size.

When starting from a slice rather than an array, fallible conversion APIs can be used: Returns the smallest value that can be represented by this integer type.