pub struct Base16 {}Expand description
Simply encodes and decodes Hex as described in RFC 4648
Implementations§
Trait Implementations§
Source§impl BinaryText for Base16
impl BinaryText for Base16
Source§fn n_bytes_encode(&self) -> usize
fn n_bytes_encode(&self) -> usize
Returns the chunk size for encoding.
Source§fn n_bytes_decode(&self) -> usize
fn n_bytes_decode(&self) -> usize
Returns the chunk size for decoding.
Source§fn encode_byte(&self, byte: u8) -> Result<u8, BinTxtError>
fn encode_byte(&self, byte: u8) -> Result<u8, BinTxtError>
Encodes a single byte using the encoding lookup table.
The byte is the position in the LUT.
Source§fn encode_into_vec(
&self,
input: &[u8],
res: &mut Vec<u8>,
) -> Result<(), BinTxtError>
fn encode_into_vec( &self, input: &[u8], res: &mut Vec<u8>, ) -> Result<(), BinTxtError>
Encodes a slice of bytes into a Vec of bytes.
Source§fn decode_byte(&self, byte: u8) -> Result<u8, BinTxtError>
fn decode_byte(&self, byte: u8) -> Result<u8, BinTxtError>
Decodes a single byte or returns DecodingError if the byte is not a valid character.
Source§fn decode_into_vec(
&self,
input: &[u8],
res: &mut Vec<u8>,
) -> Result<(), BinTxtError>
fn decode_into_vec( &self, input: &[u8], res: &mut Vec<u8>, ) -> Result<(), BinTxtError>
Decodes a slice of bytes into a Vec of bytes or returns a decoding error.
Source§fn is_decodable(&self, input: &str) -> bool
fn is_decodable(&self, input: &str) -> bool
Checks if a string is decodeable.
Source§fn encode_and_return(&self, input: &[u8]) -> Result<Vec<u8>, BinTxtError>
fn encode_and_return(&self, input: &[u8]) -> Result<Vec<u8>, BinTxtError>
Encodes a slice of bytes into a string and returns it.
Source§fn decode_and_return(&self, input: &[u8]) -> Result<Vec<u8>, BinTxtError>
fn decode_and_return(&self, input: &[u8]) -> Result<Vec<u8>, BinTxtError>
Decodes a slice of bytes into a string and returns it.
Source§fn encode_from_str(&self, input: &str) -> Result<String, BinTxtError>
fn encode_from_str(&self, input: &str) -> Result<String, BinTxtError>
Encodes a string and returns a UTF-8 string instead of a slice of bytes.
Source§fn decode_from_str(&self, input: &str) -> Result<String, BinTxtError>
fn decode_from_str(&self, input: &str) -> Result<String, BinTxtError>
Decodes a string and returns a UTF-8 string instead of a slice of bytes.
Source§fn encode_u128(&self, int: u128) -> Result<String, BinTxtError>
fn encode_u128(&self, int: u128) -> Result<String, BinTxtError>
Encodes an unsigned integer of 128 bit width.
Source§fn encode_u64(&self, int: u64) -> Result<String, BinTxtError>
fn encode_u64(&self, int: u64) -> Result<String, BinTxtError>
Encodes an unsigned integer of 64 bit width.
Source§fn decode_u128(&self, input: &[u8]) -> Result<u128, BinTxtError>
fn decode_u128(&self, input: &[u8]) -> Result<u128, BinTxtError>
Decodes a slice of bytes into an unsigned integer of 128 bits width.
Source§fn decode_u64(&self, input: &[u8]) -> Result<u64, BinTxtError>
fn decode_u64(&self, input: &[u8]) -> Result<u64, BinTxtError>
Decodes a slice of bytes into an unsigned integer of 64 bits width.
Auto Trait Implementations§
impl Freeze for Base16
impl RefUnwindSafe for Base16
impl Send for Base16
impl Sync for Base16
impl Unpin for Base16
impl UnsafeUnpin for Base16
impl UnwindSafe for Base16
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more