Method lrs::num::W8::rotate_left

Rotates the value to the right.

Syntax

impl W8 {
    fn rotate_left(self, bits: usize) -> W8
}

Arguments

NameDescription
bits

The number of bits to rotate.

Remarks

The bits argument must be in the range (0, width), otherwise the behavior is undefined. Here, width is the width of the type in bits.

This method is implemented for signed types due to a compiler limitation. It should only be used on unsigned values.

Examples

let x = 1u32;
assert!(x.rotate_left(1) == 3);