Skip to main content

BitIndexOps

Trait BitIndexOps 

Source
pub trait BitIndexOps: Sized {
    type Output;

    // Required methods
    fn shl_index(self, index: BitIndex<Self>) -> Self::Output;
    fn shr_index(self, index: BitIndex<Self>) -> Self::Output;
}
Expand description

Operations that consume a BitIndex proof to shift without the overflow-check branch: the amount is proven < BITS, so there is no debug-time panic and no unbounded_* masking.

Owned results carry an associated Output so non-Copy types can implement the trait for their reference type.

Required Associated Types§

Source

type Output

The owned result type (Self for the primitive impls).

Required Methods§

Source

fn shl_index(self, index: BitIndex<Self>) -> Self::Output

self << index, total because index < BITS.

Source

fn shr_index(self, index: BitIndex<Self>) -> Self::Output

self >> index, total because index < BITS.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl BitIndexOps for i8

Source§

type Output = i8

Source§

fn shl_index(self, index: BitIndex<i8>) -> i8

Source§

fn shr_index(self, index: BitIndex<i8>) -> i8

Source§

impl BitIndexOps for i16

Source§

type Output = i16

Source§

fn shl_index(self, index: BitIndex<i16>) -> i16

Source§

fn shr_index(self, index: BitIndex<i16>) -> i16

Source§

impl BitIndexOps for i32

Source§

type Output = i32

Source§

fn shl_index(self, index: BitIndex<i32>) -> i32

Source§

fn shr_index(self, index: BitIndex<i32>) -> i32

Source§

impl BitIndexOps for i64

Source§

type Output = i64

Source§

fn shl_index(self, index: BitIndex<i64>) -> i64

Source§

fn shr_index(self, index: BitIndex<i64>) -> i64

Source§

impl BitIndexOps for i128

Source§

type Output = i128

Source§

fn shl_index(self, index: BitIndex<i128>) -> i128

Source§

fn shr_index(self, index: BitIndex<i128>) -> i128

Source§

impl BitIndexOps for isize

Source§

impl BitIndexOps for u8

Source§

type Output = u8

Source§

fn shl_index(self, index: BitIndex<u8>) -> u8

Source§

fn shr_index(self, index: BitIndex<u8>) -> u8

Source§

impl BitIndexOps for u16

Source§

type Output = u16

Source§

fn shl_index(self, index: BitIndex<u16>) -> u16

Source§

fn shr_index(self, index: BitIndex<u16>) -> u16

Source§

impl BitIndexOps for u32

Source§

type Output = u32

Source§

fn shl_index(self, index: BitIndex<u32>) -> u32

Source§

fn shr_index(self, index: BitIndex<u32>) -> u32

Source§

impl BitIndexOps for u64

Source§

type Output = u64

Source§

fn shl_index(self, index: BitIndex<u64>) -> u64

Source§

fn shr_index(self, index: BitIndex<u64>) -> u64

Source§

impl BitIndexOps for u128

Source§

type Output = u128

Source§

fn shl_index(self, index: BitIndex<u128>) -> u128

Source§

fn shr_index(self, index: BitIndex<u128>) -> u128

Source§

impl BitIndexOps for usize

Implementors§