Skip to main content

Bit

Trait Bit 

Source
pub trait Bit:
    Sealed
    + Copy
    + Default
    + 'static {
    const U8: u8;
    const BOOL: bool;

    // Required methods
    fn new() -> Self;
    fn to_u8() -> u8;
    fn to_bool() -> bool;
}
Expand description

The marker trait for compile time bits.

Required Associated Constants§

Source

const U8: u8

Source

const BOOL: bool

Required Methods§

Source

fn new() -> Self

Instantiates a singleton representing this bit.

Source

fn to_u8() -> u8

Source

fn to_bool() -> bool

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl Bit for B0

Source§

const U8: u8 = 0

Source§

const BOOL: bool = false

Source§

impl Bit for B1

Source§

const U8: u8 = 1

Source§

const BOOL: bool = true