Trait lrs::num::SaturatingCast

Objects that can be cast to another object in a saturating way.

Syntax

trait SaturatingCast<T> {
    /* Required methods */
    fn saturating_cast(self) -> T
}

Methods

ReceiverNameDescription
selfsaturating_cast

Remarks

This is used to cast between integer type so that 256.saturating_cast():u8 == 255.