Skip to main content

IsolateLowestOne

Trait IsolateLowestOne 

Source
pub trait IsolateLowestOne: Sized {
    type Output;

    // Required method
    fn isolate_lowest_one(self) -> Self::Output;
}
Expand description

Isolates the lowest one-bit, branchlessly.

Required Associated Types§

Source

type Output

Returns self with only its lowest one-bit kept, or 0 if the value is zero.

use const_num_traits::IsolateLowestOne;

assert_eq!(IsolateLowestOne::isolate_lowest_one(0b0101_0000u8), 0b0001_0000);

Required Methods§

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 IsolateLowestOne for i8

Source§

impl IsolateLowestOne for i16

Source§

impl IsolateLowestOne for i32

Source§

impl IsolateLowestOne for i64

Source§

impl IsolateLowestOne for i128

Source§

impl IsolateLowestOne for isize

Source§

impl IsolateLowestOne for u8

Source§

impl IsolateLowestOne for u16

Source§

impl IsolateLowestOne for u32

Source§

impl IsolateLowestOne for u64

Source§

impl IsolateLowestOne for u128

Source§

impl IsolateLowestOne for usize

Implementors§