Trait WithBit

Source
pub trait WithBit {
    // Required method
    fn with_bit<const BIT: usize>(self, value: bool) -> Self;
}
Expand description

Return a value with a single bit modified.

Required Methods§

Source

fn with_bit<const BIT: usize>(self, value: bool) -> Self

Returns self with the the specified bit set to 1 if value is true, and 0 otherwise.

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

Source§

fn with_bit<const BIT: usize>(self, value: bool) -> Self

Source§

impl WithBit for i16

Source§

fn with_bit<const BIT: usize>(self, value: bool) -> Self

Source§

impl WithBit for i32

Source§

fn with_bit<const BIT: usize>(self, value: bool) -> Self

Source§

impl WithBit for i64

Source§

fn with_bit<const BIT: usize>(self, value: bool) -> Self

Source§

impl WithBit for i128

Source§

fn with_bit<const BIT: usize>(self, value: bool) -> Self

Source§

impl WithBit for isize

Source§

fn with_bit<const BIT: usize>(self, value: bool) -> Self

Source§

impl WithBit for u8

Source§

fn with_bit<const BIT: usize>(self, value: bool) -> Self

Source§

impl WithBit for u16

Source§

fn with_bit<const BIT: usize>(self, value: bool) -> Self

Source§

impl WithBit for u32

Source§

fn with_bit<const BIT: usize>(self, value: bool) -> Self

Source§

impl WithBit for u64

Source§

fn with_bit<const BIT: usize>(self, value: bool) -> Self

Source§

impl WithBit for u128

Source§

fn with_bit<const BIT: usize>(self, value: bool) -> Self

Source§

impl WithBit for usize

Source§

fn with_bit<const BIT: usize>(self, value: bool) -> Self

Source§

impl<const N: usize> WithBit for [i8; N]

Source§

fn with_bit<const BIT: usize>(self, value: bool) -> Self

Source§

impl<const N: usize> WithBit for [i16; N]

Source§

fn with_bit<const BIT: usize>(self, value: bool) -> Self

Source§

impl<const N: usize> WithBit for [i32; N]

Source§

fn with_bit<const BIT: usize>(self, value: bool) -> Self

Source§

impl<const N: usize> WithBit for [i64; N]

Source§

fn with_bit<const BIT: usize>(self, value: bool) -> Self

Source§

impl<const N: usize> WithBit for [i128; N]

Source§

fn with_bit<const BIT: usize>(self, value: bool) -> Self

Source§

impl<const N: usize> WithBit for [isize; N]

Source§

fn with_bit<const BIT: usize>(self, value: bool) -> Self

Source§

impl<const N: usize> WithBit for [u8; N]

Source§

fn with_bit<const BIT: usize>(self, value: bool) -> Self

Source§

impl<const N: usize> WithBit for [u16; N]

Source§

fn with_bit<const BIT: usize>(self, value: bool) -> Self

Source§

impl<const N: usize> WithBit for [u32; N]

Source§

fn with_bit<const BIT: usize>(self, value: bool) -> Self

Source§

impl<const N: usize> WithBit for [u64; N]

Source§

fn with_bit<const BIT: usize>(self, value: bool) -> Self

Source§

impl<const N: usize> WithBit for [u128; N]

Source§

fn with_bit<const BIT: usize>(self, value: bool) -> Self

Source§

impl<const N: usize> WithBit for [usize; N]

Source§

fn with_bit<const BIT: usize>(self, value: bool) -> Self

Implementors§