Bit in typenum::marker_traits - Rust
Description: The marker trait for compile time bits.
Keywords: rust, rustlang, rust-lang, Bit

# Trait typenum::marker_traits::Bit

source ·

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

        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

## Implementors§

source§

### impl Bit for B0

source§

#### const U8: u8 = 0u8

source§

#### const BOOL: bool = false

source§

### impl Bit for B1

source§

#### const U8: u8 = 1u8

source§

#### const BOOL: bool = true