Struct casper_types::ContractWasmHash
source · pub struct ContractWasmHash(/* private fields */);
Expand description
A newtype wrapping a HashAddr
which is the raw bytes of
the ContractWasmHash
Implementations§
source§impl ContractWasmHash
impl ContractWasmHash
sourcepub const fn new(value: HashAddr) -> ContractWasmHash
pub const fn new(value: HashAddr) -> ContractWasmHash
Constructs a new ContractWasmHash
from the raw bytes of the contract wasm hash.
sourcepub fn to_formatted_string(self) -> String
pub fn to_formatted_string(self) -> String
Formats the ContractWasmHash
for users getting and putting.
sourcepub fn from_formatted_str(input: &str) -> Result<Self, FromStrError>
pub fn from_formatted_str(input: &str) -> Result<Self, FromStrError>
Parses a string formatted as per Self::to_formatted_string()
into a
ContractWasmHash
.
Trait Implementations§
source§impl AsRef<[u8]> for ContractWasmHash
impl AsRef<[u8]> for ContractWasmHash
source§impl Clone for ContractWasmHash
impl Clone for ContractWasmHash
source§fn clone(&self) -> ContractWasmHash
fn clone(&self) -> ContractWasmHash
Returns a copy 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 ContractWasmHash
impl Debug for ContractWasmHash
source§impl Default for ContractWasmHash
impl Default for ContractWasmHash
source§fn default() -> ContractWasmHash
fn default() -> ContractWasmHash
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for ContractWasmHash
impl<'de> Deserialize<'de> for ContractWasmHash
source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for ContractWasmHash
impl Display for ContractWasmHash
source§impl From<ContractWasmHash> for Key
impl From<ContractWasmHash> for Key
source§fn from(wasm_hash: ContractWasmHash) -> Key
fn from(wasm_hash: ContractWasmHash) -> Key
Converts to this type from the input type.
source§impl FromBytes for ContractWasmHash
impl FromBytes for ContractWasmHash
source§impl Hash for ContractWasmHash
impl Hash for ContractWasmHash
source§impl Ord for ContractWasmHash
impl Ord for ContractWasmHash
source§fn cmp(&self, other: &ContractWasmHash) -> Ordering
fn cmp(&self, other: &ContractWasmHash) -> Ordering
1.21.0 · 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 PartialEq for ContractWasmHash
impl PartialEq for ContractWasmHash
source§fn eq(&self, other: &ContractWasmHash) -> bool
fn eq(&self, other: &ContractWasmHash) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for ContractWasmHash
impl PartialOrd for ContractWasmHash
source§fn partial_cmp(&self, other: &ContractWasmHash) -> Option<Ordering>
fn partial_cmp(&self, other: &ContractWasmHash) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for ContractWasmHash
impl Serialize for ContractWasmHash
source§impl ToBytes for ContractWasmHash
impl ToBytes for ContractWasmHash
source§fn serialized_length(&self) -> usize
fn serialized_length(&self) -> usize
Returns the length of the
Vec<u8>
which would be returned from a successful call to
to_bytes()
or into_bytes()
. The data is not actually serialized, so this call is
relatively cheap.source§impl TryFrom<&[u8]> for ContractWasmHash
impl TryFrom<&[u8]> for ContractWasmHash
impl Copy for ContractWasmHash
impl Eq for ContractWasmHash
impl StructuralEq for ContractWasmHash
impl StructuralPartialEq for ContractWasmHash
Auto Trait Implementations§
impl RefUnwindSafe for ContractWasmHash
impl Send for ContractWasmHash
impl Sync for ContractWasmHash
impl Unpin for ContractWasmHash
impl UnwindSafe for ContractWasmHash
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
source§impl<T> ToHex for Twhere
T: AsRef<[u8]>,
impl<T> ToHex for Twhere T: AsRef<[u8]>,
source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Lower case
letters are used (e.g. f9b4ca
)source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Upper case
letters are used (e.g. F9B4CA
)