BinIter

Trait BinIter 

Source
pub trait BinIter {
    type Iter: Iterator<Item = bool>;

    // Required method
    fn bin_iter(&self) -> Self::Iter;
}
Expand description

2 進法のイテレータ。

assert!(0_u32.bin_iter().eq([]));
assert!(1_u32.bin_iter().map(u32::from).eq([1]));
assert!(0b_1001011_u64.bin_iter().map(u32::from).eq([1, 1, 0, 1, 0, 0, 1]));
assert!((!0_u128).bin_iter().map(u32::from).eq([1; 128]));

Required Associated Types§

Source

type Iter: Iterator<Item = bool>

Required Methods§

Source

fn bin_iter(&self) -> Self::Iter

Implementations on Foreign Types§

Source§

impl BinIter for u8

Source§

type Iter = UIntIter<u8>

Source§

fn bin_iter(&self) -> Self::Iter

Source§

impl BinIter for u16

Source§

type Iter = UIntIter<u16>

Source§

fn bin_iter(&self) -> Self::Iter

Source§

impl BinIter for u32

Source§

type Iter = UIntIter<u32>

Source§

fn bin_iter(&self) -> Self::Iter

Source§

impl BinIter for u64

Source§

type Iter = UIntIter<u64>

Source§

fn bin_iter(&self) -> Self::Iter

Source§

impl BinIter for u128

Source§

type Iter = UIntIter<u128>

Source§

fn bin_iter(&self) -> Self::Iter

Source§

impl BinIter for usize

Source§

type Iter = UIntIter<usize>

Source§

fn bin_iter(&self) -> Self::Iter

Implementors§