InPlaceTotallyOrderable

Trait InPlaceTotallyOrderable 

Source
pub trait InPlaceTotallyOrderable: TotallyOrderable + Sized {
    type Transformed: Ord + Hash + Sized;

    // Required methods
    unsafe fn total_order_transform(&mut self);
    unsafe fn total_order_inverse_transform(&mut self);
}
Expand description

Implement this for types that are not directly Ord + Eq, but can be transformed in place in such a way that the associated type Transformed is. Implemented for f32 and f64.

Required Associated Types§

Source

type Transformed: Ord + Hash + Sized

Associated type that is Ord, must be the same size as Self

Required Methods§

Source

unsafe fn total_order_transform(&mut self)

Transform Self into Transformed in place.

§Safety

The resulting value must no longer be treated as a Self, but as a Transformed, until the inverse transform total_order_inverse_transform is called. Transformed shall only be used for comparisons, hashing and swapping / moves.

Source

unsafe fn total_order_inverse_transform(&mut self)

Apply the inverse transformation of total_order_transform

§Safety

This function may only be called on values previously transformed via total_order_transform.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl InPlaceTotallyOrderable for f32

Source§

impl InPlaceTotallyOrderable for f64

Implementors§