Struct elements::issuance::ContractHash
source · pub struct ContractHash(/* private fields */);
Expand description
The hash of an asset contract.“, tru)
Implementations§
source§impl ContractHash
impl ContractHash
sourcepub fn from_raw_hash(inner: Hash) -> ContractHash
pub fn from_raw_hash(inner: Hash) -> ContractHash
Creates this wrapper type from the inner hash type.
sourcepub fn to_raw_hash(self) -> Hash
pub fn to_raw_hash(self) -> Hash
Returns the inner hash (sha256, sh256d etc.).
sourcepub fn as_raw_hash(&self) -> &Hash
pub fn as_raw_hash(&self) -> &Hash
Returns a reference to the inner hash (sha256, sh256d etc.).
source§impl ContractHash
impl ContractHash
sourcepub fn from_json_contract(json: &str) -> Result<ContractHash, Error>
pub fn from_json_contract(json: &str) -> Result<ContractHash, Error>
Calculate the contract hash of a JSON contract object.
This method does not perform any validation of the contents of the contract. After basic JSON syntax validation, the object is formatted in a standard way to calculate the hash.
Trait Implementations§
source§impl AsRef<[u8]> for ContractHash
impl AsRef<[u8]> for ContractHash
source§impl Borrow<[u8]> for ContractHash
impl Borrow<[u8]> for ContractHash
source§impl Clone for ContractHash
impl Clone for ContractHash
source§fn clone(&self) -> ContractHash
fn clone(&self) -> ContractHash
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 ContractHash
impl Debug for ContractHash
source§impl Display for ContractHash
impl Display for ContractHash
source§impl From<ContractHash> for Hash
impl From<ContractHash> for Hash
source§fn from(hashtype: ContractHash) -> Hash
fn from(hashtype: ContractHash) -> Hash
Converts to this type from the input type.
source§impl From<Hash> for ContractHash
impl From<Hash> for ContractHash
source§fn from(inner: Hash) -> ContractHash
fn from(inner: Hash) -> ContractHash
Converts to this type from the input type.
source§impl FromStr for ContractHash
impl FromStr for ContractHash
source§impl Hash for ContractHash
impl Hash for ContractHash
§type Engine = <Hash as Hash>::Engine
type Engine = <Hash as Hash>::Engine
A hashing engine which bytes can be serialized into. It is expected
to implement the
io::Write
trait, and to never return errors under
any conditions.source§const DISPLAY_BACKWARD: bool = true
const DISPLAY_BACKWARD: bool = true
Flag indicating whether user-visible serializations of this hash
should be backward. For some reason Satoshi decided this should be
true for
Sha256dHash
, so here we are.source§fn from_engine(e: Self::Engine) -> Self
fn from_engine(e: Self::Engine) -> Self
Produces a hash from the current state of a given engine.
source§fn from_slice(sl: &[u8]) -> Result<ContractHash, FromSliceError>
fn from_slice(sl: &[u8]) -> Result<ContractHash, FromSliceError>
Copies a byte slice into a hash object.
source§fn from_byte_array(bytes: Self::Bytes) -> Self
fn from_byte_array(bytes: Self::Bytes) -> Self
Constructs a hash from the underlying byte array.
source§fn to_byte_array(self) -> Self::Bytes
fn to_byte_array(self) -> Self::Bytes
Returns the underlying byte array.
source§fn as_byte_array(&self) -> &Self::Bytes
fn as_byte_array(&self) -> &Self::Bytes
Returns a reference to the underlying byte array.
source§impl Hash for ContractHash
impl Hash for ContractHash
source§impl<I: SliceIndex<[u8]>> Index<I> for ContractHash
impl<I: SliceIndex<[u8]>> Index<I> for ContractHash
source§impl LowerHex for ContractHash
impl LowerHex for ContractHash
source§impl Ord for ContractHash
impl Ord for ContractHash
source§fn cmp(&self, other: &ContractHash) -> Ordering
fn cmp(&self, other: &ContractHash) -> 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 ContractHash
impl PartialEq for ContractHash
source§fn eq(&self, other: &ContractHash) -> bool
fn eq(&self, other: &ContractHash) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for ContractHash
impl PartialOrd for ContractHash
source§fn partial_cmp(&self, other: &ContractHash) -> Option<Ordering>
fn partial_cmp(&self, other: &ContractHash) -> 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 UpperHex for ContractHash
impl UpperHex for ContractHash
impl Copy for ContractHash
impl Eq for ContractHash
impl StructuralPartialEq for ContractHash
Auto Trait Implementations§
impl RefUnwindSafe for ContractHash
impl Send for ContractHash
impl Sync for ContractHash
impl Unpin for ContractHash
impl UnwindSafe for ContractHash
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