Type Alias BitPattern

Source
pub type BitPattern = BitVec<usize, Msb0>;

Aliased Type§

struct BitPattern { /* private fields */ }

Trait Implementations§

Source§

impl BitPatternExt for BitPattern

Source§

fn from_value<T>(val: T) -> Self
where T: BitStore,

Source§

fn from_str(s: &str) -> Result<Self, Error>

Create from the given string. The radix is deduced from the first 2 chars. ‘0b’ => binary, ‘0x’ => hexadecimal, ‘0o’ => octal, ‘0d’ => decimal.
Source§

fn from_bin_str(s: &str) -> Self

Create from the given binary string. Any character other than ‘0’ or ‘1’ is ignored.
Source§

fn from_dec_str(s: &str) -> Self

Create from the given decimal string. Any character other than decimal digits is ignored.
Source§

fn from_oct_str(s: &str) -> Self

Create from the given octal string. Any character other than octal digits is ignored.
Source§

fn from_hex_str(s: &str) -> Self

Create from the given hexadecimal string. Any character other than hexadecimal digits is ignored.
Source§

fn is_all_one(&self) -> bool

Check if the bit pattern is all one.
Source§

fn is_all_zero(&self) -> bool

Check if the bit pattern is all zero.
Source§

fn to_bin_string(&self) -> String

Convert the bit pattern to a string representing the binary value.
Source§

fn to_oct_string(&self) -> String

Convert the bit pattern to a string representing the decimal value.
Source§

fn to_dec_string(&self) -> String

Convert the bit pattern to a string representing the hexadecimal value.
Source§

fn to_hex_string(&self) -> String

Convert the bit pattern to a string representing the hexadecimal value.