pub struct Hash256(/* private fields */);Expand description
A 32-byte hash used for transaction and block identifiers on Neo N3.
Hash256 wraps exactly 32 bytes and provides validated construction.
Implementations§
Source§impl Hash256
impl Hash256
Sourcepub const fn from_bytes(bytes: [u8; 32]) -> Self
pub const fn from_bytes(bytes: [u8; 32]) -> Self
Creates a Hash256 from a 32-byte array.
Sourcepub fn try_from_slice(slice: &[u8]) -> NeoResult<Self>
pub fn try_from_slice(slice: &[u8]) -> NeoResult<Self>
Attempts to create a Hash256 from a byte slice.
Returns Err(NeoError::InvalidArgument) if the slice length is not exactly 32.
Sourcepub fn to_byte_string(&self) -> NeoByteString
pub fn to_byte_string(&self) -> NeoByteString
Converts this Hash256 into a NeoByteString.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Hash256
impl<'de> Deserialize<'de> for Hash256
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 Hash256
Source§impl From<Hash256> for NeoByteString
impl From<Hash256> for NeoByteString
impl StructuralPartialEq for Hash256
Source§impl TryFrom<NeoByteString> for Hash256
impl TryFrom<NeoByteString> for Hash256
Auto Trait Implementations§
impl Freeze for Hash256
impl RefUnwindSafe for Hash256
impl Send for Hash256
impl Sync for Hash256
impl Unpin for Hash256
impl UnsafeUnpin for Hash256
impl UnwindSafe for Hash256
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