Trait proc_bitfield::Bit

source ·
pub trait Bit {
    // Required methods
    fn bit<const BIT: usize>(self) -> bool;
    fn set_bit<const BIT: usize>(self, value: bool) -> Self;
}
Expand description

A trait to read or modify a single bit inside a value.

Required Methods§

source

fn bit<const BIT: usize>(self) -> bool

Read the value of the given bit inside self.

source

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

Set the value of the given bit inside self to 1 if value is true, and 0 otherwise.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Bit for i8

source§

fn bit<const BIT: usize>(self) -> bool

source§

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

source§

impl Bit for i16

source§

fn bit<const BIT: usize>(self) -> bool

source§

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

source§

impl Bit for i32

source§

fn bit<const BIT: usize>(self) -> bool

source§

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

source§

impl Bit for i64

source§

fn bit<const BIT: usize>(self) -> bool

source§

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

source§

impl Bit for i128

source§

fn bit<const BIT: usize>(self) -> bool

source§

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

source§

impl Bit for isize

source§

fn bit<const BIT: usize>(self) -> bool

source§

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

source§

impl Bit for u8

source§

fn bit<const BIT: usize>(self) -> bool

source§

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

source§

impl Bit for u16

source§

fn bit<const BIT: usize>(self) -> bool

source§

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

source§

impl Bit for u32

source§

fn bit<const BIT: usize>(self) -> bool

source§

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

source§

impl Bit for u64

source§

fn bit<const BIT: usize>(self) -> bool

source§

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

source§

impl Bit for u128

source§

fn bit<const BIT: usize>(self) -> bool

source§

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

source§

impl Bit for usize

source§

fn bit<const BIT: usize>(self) -> bool

source§

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

Implementors§