doc.rust-lang.org
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source.
method
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub mod cmp
Utilities for comparing and ordering values.
module
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
derive #[derive(Eq)]
Derive macro generating an impl of the trait Eq. The behavior of this macro is described in detail here.
derive_macro
core
Stable since 1.38.0
Version 1.100.0-nightly
doc.rust-lang.org
pub trait Eq
Trait for comparisons corresponding to equivalence relations.
trait
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
derive #[derive(Ord)]
Derive macro generating an impl of the trait Ord. The behavior of this macro is described in detail here.
derive_macro
core
Stable since 1.38.0
Version 1.100.0-nightly
doc.rust-lang.org
pub trait Ord
Trait for types that form a total order.
trait
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
fn clamp(self, min: Self, max: Self) -> Self
Restrict a value to a certain interval.
method
core
Stable since 1.50.0
Version 1.100.0-nightly
doc.rust-lang.org
fn cmp(&self, other: &Self) -> Ordering
This method returns an Ordering between self and other.
method
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values.
method
core
Stable since 1.21.0
Version 1.100.0-nightly
doc.rust-lang.org
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values.
method
core
Stable since 1.21.0
Version 1.100.0-nightly
doc.rust-lang.org
pub enum Ordering
An Ordering is the result of a comparison between two values.
enum
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn is_eq(self) -> bool
Returns true if the ordering is the Equal variant.
method
core
Stable since 1.53.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn is_ge(self) -> bool
Returns true if the ordering is either the Greater or Equal variant.
method
core
Stable since 1.53.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn is_gt(self) -> bool
Returns true if the ordering is the Greater variant.
method
core
Stable since 1.53.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn is_le(self) -> bool
Returns true if the ordering is either the Less or Equal variant.
method
core
Stable since 1.53.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn is_lt(self) -> bool
Returns true if the ordering is the Less variant.
method
core
Stable since 1.53.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn is_ne(self) -> bool
Returns true if the ordering is not the Equal variant.
method
core
Stable since 1.53.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn reverse(self) -> Ordering
Reverses the Ordering.
method
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn then(self, other: Ordering) -> Ordering
Chains two orderings.
method
core
Stable since 1.17.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn then_with<F>(self, f: F) -> Ordering
Chains the ordering with the given function.
method
core
Stable since 1.17.0
Version 1.100.0-nightly