pub struct ClientDataHash(/* private fields */);Expand description
A validated client data hash (must be exactly 32 bytes)
This newtype ensures that client data hashes are always the correct length, preventing runtime validation errors.
Implementations§
Source§impl ClientDataHash
impl ClientDataHash
Sourcepub fn from_slice(slice: &[u8]) -> Result<Self>
pub fn from_slice(slice: &[u8]) -> Result<Self>
Create a ClientDataHash from a slice
§Errors
Returns Error::InvalidClientDataHash if the slice is not exactly 32 bytes.
Trait Implementations§
Source§impl AsRef<[u8]> for ClientDataHash
impl AsRef<[u8]> for ClientDataHash
Source§impl Clone for ClientDataHash
impl Clone for ClientDataHash
Source§fn clone(&self) -> ClientDataHash
fn clone(&self) -> ClientDataHash
Returns a duplicate of the value. Read more
1.0.0 · 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 ClientDataHash
impl Debug for ClientDataHash
Source§impl PartialEq for ClientDataHash
impl PartialEq for ClientDataHash
impl Copy for ClientDataHash
impl Eq for ClientDataHash
impl StructuralPartialEq for ClientDataHash
Auto Trait Implementations§
impl Freeze for ClientDataHash
impl RefUnwindSafe for ClientDataHash
impl Send for ClientDataHash
impl Sync for ClientDataHash
impl Unpin for ClientDataHash
impl UnwindSafe for ClientDataHash
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