pub struct ShardlineHash { /* private fields */ }Expand description
A 32-byte protocol hash.
Implementations§
Source§impl ShardlineHash
impl ShardlineHash
Sourcepub const fn from_bytes(bytes: [u8; 32]) -> Self
pub const fn from_bytes(bytes: [u8; 32]) -> Self
Creates a hash from raw bytes.
Sourcepub fn parse_hex(value: &str) -> Result<Self, HashParseError>
pub fn parse_hex(value: &str) -> Result<Self, HashParseError>
Parses a hash from canonical lowercase hexadecimal text.
§Errors
Returns HashParseError when the string has the wrong length, contains
non-lowercase hexadecimal characters, or cannot be decoded into 32 bytes.
Sourcepub fn hex_string(&self) -> String
pub fn hex_string(&self) -> String
Returns canonical lowercase hexadecimal text.
Trait Implementations§
Source§impl Clone for ShardlineHash
impl Clone for ShardlineHash
Source§fn clone(&self) -> ShardlineHash
fn clone(&self) -> ShardlineHash
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 moreimpl Copy for ShardlineHash
Source§impl Debug for ShardlineHash
impl Debug for ShardlineHash
Source§impl<'de> Deserialize<'de> for ShardlineHash
impl<'de> Deserialize<'de> for ShardlineHash
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ShardlineHash
Source§impl Hash for ShardlineHash
impl Hash for ShardlineHash
Source§impl PartialEq for ShardlineHash
impl PartialEq for ShardlineHash
Source§fn eq(&self, other: &ShardlineHash) -> bool
fn eq(&self, other: &ShardlineHash) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ShardlineHash
impl Serialize for ShardlineHash
impl StructuralPartialEq for ShardlineHash
Auto Trait Implementations§
impl Freeze for ShardlineHash
impl RefUnwindSafe for ShardlineHash
impl Send for ShardlineHash
impl Sync for ShardlineHash
impl Unpin for ShardlineHash
impl UnsafeUnpin for ShardlineHash
impl UnwindSafe for ShardlineHash
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