[−][src]Struct to_binary::BinaryUsage
Binary Usage
The BinaryUsage
Struct is used to perform functions or actions on Binary Strings
, such as:
- Adding/Removing Whitespace
- Asserting Binary Strings
- Asserting Binary Whitespace Strings
- Asserting Bytes
- Counting Bits
- Counting Bytes
Implementations
impl BinaryUsage
[src]
pub fn assert_binary(bin: String) -> bool
[src]
Asserts The Input Is A Binary String
, or a string with only:
0
1
This function is the same as assert_binary_string()
just with a different name
pub fn assert_binary_string(bin: String) -> bool
[src]
Asserts the Input Is A Binary String
, or a String with only:
0
1
- No Whitespace
pub fn assert_binary_whitespace(bin: String) -> bool
[src]
Asserts The Input Is A Binary Whitespace String
, or a String with only:
0
1
whitespace
TODO: Add a check for whitespace to be every 9nth character
pub fn assert_bytes(bin: String) -> bool
[src]
Asserts The Input Has (8
* n
) bits or contains full bytes using the remainder function
pub fn count_bits(bin: String) -> Result<usize, ()>
[src]
Count number of bits for both a "Binary String" and "Binary Whitespace String" and returns a Result of either a usize
or on error, empty response
pub fn count_bytes(bin: String) -> Result<usize, ()>
[src]
Count number of bytes for both a "Binary String" and "Binary Whitespace String" and returns a Result of either a usize
or on error, empty response
pub fn add_spaces(bin: String) -> Result<String, ()>
[src]
pub fn remove_spaces(bin: String) -> String
[src]
Removes All Whitespace From String And Returns String
Auto Trait Implementations
impl RefUnwindSafe for BinaryUsage
impl Send for BinaryUsage
impl Sync for BinaryUsage
impl Unpin for BinaryUsage
impl UnwindSafe for BinaryUsage
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,