Skip to main content

Case

Trait Case 

Source
pub trait Case: Sealed {
    // Required methods
    fn encode(bytes: &[u8]) -> String;
    fn is_valid(c: char) -> bool;
}
Expand description

Provides encoding and validation for hexadecimal strings according to the case.

This trait is sealed to prevent external implementations, ensuring that only Lowercase and Uppercase can be used as cases.

Required Methods§

Source

fn encode(bytes: &[u8]) -> String

Encodes the given bytes into a hexadecimal string according to the case.

Source

fn is_valid(c: char) -> bool

Checks if the given character is a valid hexadecimal character according to the case.

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.

Implementors§