pub enum CheckCase {
None,
Lower,
Upper,
}Expand description
Which ASCII letter cases are accepted when checking or decoding hex.
None is the default and accepts mixed case; it does not
disable character validation. All policies accept ASCII digits 0 through
9 and reject prefixes, whitespace and non-ASCII characters. They do not
change the length rules of the operation using them.
Encoding selects lowercase or uppercase through separate functions, so an encoding operation never needs this policy.
§Examples
use faster_hex::{hex_decode_with_case, CheckCase};
let mut bytes = [0; 2];
assert_eq!(hex_decode_with_case(b"AB01", &mut bytes, CheckCase::Upper)?,
&[0xab, 1]);
assert!(hex_decode_with_case(b"ab01", &mut bytes, CheckCase::Upper).is_err());Variants§
None
Accept uppercase and lowercase, including a mixture of both.
Lower
Accept digits and lowercase a through f only.
Upper
Accept digits and uppercase A through F only.
Trait Implementations§
impl Copy for CheckCase
impl Eq for CheckCase
impl StructuralPartialEq for CheckCase
Auto Trait Implementations§
impl Freeze for CheckCase
impl RefUnwindSafe for CheckCase
impl Send for CheckCase
impl Sync for CheckCase
impl Unpin for CheckCase
impl UnsafeUnpin for CheckCase
impl UnwindSafe for CheckCase
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