Skip to main content

StrToBits

Trait StrToBits 

Source
pub trait StrToBits<'a> {
    // Required method
    fn iter_bits(&'a self) -> StrBitIter<'a> ;

    // Provided method
    fn to_bit_vec(&'a self) -> Vec<bool> { ... }
}
Expand description

Trait for converting bit strings into a bit iterator.

Required Methods§

Source

fn iter_bits(&'a self) -> StrBitIter<'a>

Converts a bit string into a bit iterator.

The returned iterator will yield true for any character that is not '0',

Provided Methods§

Source

fn to_bit_vec(&'a self) -> Vec<bool>

Converts a bit string into a bit vector.

The returned vector will contain true for any character that is not '0',

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<'a> StrToBits<'a> for str

Source§

fn iter_bits(&'a self) -> StrBitIter<'a>

Implementors§