pub struct HexCodecConfig { /* private fields */ }Expand description
Configuration shared by crate::HexCodec encoding and decoding
operations.
The configuration is intentionally separate from the codec value so the same formatting and decoding policy can be reused by multiple codecs.
Implementations§
Source§impl HexCodecConfig
impl HexCodecConfig
Sourcepub fn with_uppercase(self, uppercase: bool) -> Self
pub fn with_uppercase(self, uppercase: bool) -> Self
Sets whether encoded digits should be uppercase.
Sourcepub fn with_prefix(self, prefix: impl Into<String>) -> Self
pub fn with_prefix(self, prefix: impl Into<String>) -> Self
Sets a whole-output prefix.
Sourcepub fn with_byte_prefix(self, prefix: impl Into<String>) -> Self
pub fn with_byte_prefix(self, prefix: impl Into<String>) -> Self
Sets a per-byte prefix.
Sourcepub fn with_separator(self, separator: impl Into<String>) -> Self
pub fn with_separator(self, separator: impl Into<String>) -> Self
Sets a separator between encoded bytes.
Sourcepub fn with_ignored_ascii_whitespace(self, ignore: bool) -> Self
pub fn with_ignored_ascii_whitespace(self, ignore: bool) -> Self
Sets whether ASCII whitespace is ignored while decoding.
Sourcepub fn with_ignore_prefix_case(self, ignore: bool) -> Self
pub fn with_ignore_prefix_case(self, ignore: bool) -> Self
Sets whether configured prefixes are matched case-insensitively.
Sourcepub fn is_uppercase(&self) -> bool
pub fn is_uppercase(&self) -> bool
Returns whether encoded digits use uppercase characters.
Sourcepub fn byte_prefix(&self) -> Option<&str>
pub fn byte_prefix(&self) -> Option<&str>
Returns the configured per-byte prefix.
Sourcepub fn ignores_ascii_whitespace(&self) -> bool
pub fn ignores_ascii_whitespace(&self) -> bool
Returns whether ASCII whitespace is ignored while decoding.
Sourcepub fn ignores_prefix_case(&self) -> bool
pub fn ignores_prefix_case(&self) -> bool
Returns whether configured prefixes are matched case-insensitively.
Trait Implementations§
Source§impl Clone for HexCodecConfig
impl Clone for HexCodecConfig
Source§fn clone(&self) -> HexCodecConfig
fn clone(&self) -> HexCodecConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HexCodecConfig
impl Debug for HexCodecConfig
Source§impl Default for HexCodecConfig
impl Default for HexCodecConfig
impl Eq for HexCodecConfig
Source§impl PartialEq for HexCodecConfig
impl PartialEq for HexCodecConfig
impl StructuralPartialEq for HexCodecConfig
Auto Trait Implementations§
impl Freeze for HexCodecConfig
impl RefUnwindSafe for HexCodecConfig
impl Send for HexCodecConfig
impl Sync for HexCodecConfig
impl Unpin for HexCodecConfig
impl UnsafeUnpin for HexCodecConfig
impl UnwindSafe for HexCodecConfig
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