pub trait BitPatternExtwhere
Self: Sized,{
// Required methods
fn from_value<T>(val: T) -> Self
where T: BitStore;
fn from_str(s: &str) -> Result<Self, Error>;
fn from_bin_str(s: &str) -> Self;
fn from_dec_str(s: &str) -> Self;
fn from_oct_str(s: &str) -> Self;
fn from_hex_str(s: &str) -> Self;
fn is_all_one(&self) -> bool;
fn is_all_zero(&self) -> bool;
fn to_bin_string(&self) -> String;
fn to_oct_string(&self) -> String;
fn to_dec_string(&self) -> String;
fn to_hex_string(&self) -> String;
}
Required Methods§
fn from_value<T>(val: T) -> Selfwhere
T: BitStore,
Sourcefn from_str(s: &str) -> Result<Self, Error>
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.
Sourcefn from_bin_str(s: &str) -> Self
fn from_bin_str(s: &str) -> Self
Create from the given binary string. Any character other than ‘0’ or ‘1’ is ignored.
Sourcefn from_dec_str(s: &str) -> Self
fn from_dec_str(s: &str) -> Self
Create from the given decimal string. Any character other than decimal digits is ignored.
Sourcefn from_oct_str(s: &str) -> Self
fn from_oct_str(s: &str) -> Self
Create from the given octal string. Any character other than octal digits is ignored.
Sourcefn from_hex_str(s: &str) -> Self
fn from_hex_str(s: &str) -> Self
Create from the given hexadecimal string. Any character other than hexadecimal digits is ignored.
Sourcefn is_all_one(&self) -> bool
fn is_all_one(&self) -> bool
Check if the bit pattern is all one.
Sourcefn is_all_zero(&self) -> bool
fn is_all_zero(&self) -> bool
Check if the bit pattern is all zero.
Sourcefn to_bin_string(&self) -> String
fn to_bin_string(&self) -> String
Convert the bit pattern to a string representing the binary value.
Sourcefn to_oct_string(&self) -> String
fn to_oct_string(&self) -> String
Convert the bit pattern to a string representing the decimal value.
Sourcefn to_dec_string(&self) -> String
fn to_dec_string(&self) -> String
Convert the bit pattern to a string representing the hexadecimal value.
Sourcefn to_hex_string(&self) -> String
fn to_hex_string(&self) -> String
Convert the bit pattern to a string representing the hexadecimal value.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.