pub struct Bytes32(pub [u8; 32]);Expand description
A 32-byte value (a store id, a root hash, a retrieval key, or a merkle node).
Rendered canonically as lowercase hex on the wire; parsing rejects any input that is not exactly 64 hex digits.
Tuple Fields§
§0: [u8; 32]Implementations§
Source§impl Bytes32
impl Bytes32
Sourcepub fn from_hex(hex_str: &str) -> Result<Bytes32, InvalidBytes32>
pub fn from_hex(hex_str: &str) -> Result<Bytes32, InvalidBytes32>
Parse exactly 64 hex digits into 32 bytes. Rejects wrong-length or non-hex input.
Uppercase hex is accepted on input (so an over-tolerant producer round-trips), but
Bytes32::to_hex always re-emits lowercase — the canonical form.
Trait Implementations§
impl Copy for Bytes32
impl Eq for Bytes32
Source§impl Ord for Bytes32
impl Ord for Bytes32
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Bytes32
impl PartialOrd for Bytes32
impl StructuralPartialEq for Bytes32
Auto Trait Implementations§
impl Freeze for Bytes32
impl RefUnwindSafe for Bytes32
impl Send for Bytes32
impl Sync for Bytes32
impl Unpin for Bytes32
impl UnsafeUnpin for Bytes32
impl UnwindSafe for Bytes32
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