Trait bin_iter::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§