pub struct ScriptHash(/* private fields */);Expand description
A hash of Bitcoin Script bytecode.
Implementations§
Source§impl ScriptHash
impl ScriptHash
Sourcepub const fn from_byte_array(bytes: <Hash as Hash>::Bytes) -> Self
pub const fn from_byte_array(bytes: <Hash as Hash>::Bytes) -> Self
Constructs a new hash from the underlying byte array.
Sourcepub const fn to_byte_array(self) -> <Hash as Hash>::Bytes
pub const fn to_byte_array(self) -> <Hash as Hash>::Bytes
Returns the underlying byte array.
Sourcepub const fn as_byte_array(&self) -> &<Hash as Hash>::Bytes
pub const fn as_byte_array(&self) -> &<Hash as Hash>::Bytes
Returns a reference to the underlying byte array.
Source§impl ScriptHash
impl ScriptHash
Sourcepub fn hash_script(s: &Script) -> Self
pub fn hash_script(s: &Script) -> Self
Computes the ScriptHash of a script.
Trait Implementations§
Source§impl AsRef<[u8]> for ScriptHash
impl AsRef<[u8]> for ScriptHash
Source§impl Borrow<[u8]> for ScriptHash
impl Borrow<[u8]> for ScriptHash
Source§impl Clone for ScriptHash
impl Clone for ScriptHash
Source§fn clone(&self) -> ScriptHash
fn clone(&self) -> ScriptHash
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 ScriptHash
Source§impl Debug for ScriptHash
impl Debug for ScriptHash
Source§impl Display for ScriptHash
impl Display for ScriptHash
impl Eq for ScriptHash
Source§impl FromStr for ScriptHash
impl FromStr for ScriptHash
Source§impl Hash for ScriptHash
impl Hash for ScriptHash
Source§impl Hash for ScriptHash
impl Hash for ScriptHash
Source§const DISPLAY_BACKWARD: bool = <hash160::Hash as ::bitcoin_hashes::Hash>::DISPLAY_BACKWARD
const DISPLAY_BACKWARD: bool = <hash160::Hash as ::bitcoin_hashes::Hash>::DISPLAY_BACKWARD
Flag indicating whether user-visible serializations of this hash should be backward. Read more
Source§fn from_byte_array(bytes: Self::Bytes) -> Self
fn from_byte_array(bytes: Self::Bytes) -> Self
Constructs a new 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 LowerHex for ScriptHash
impl LowerHex for ScriptHash
Source§impl Ord for ScriptHash
impl Ord for ScriptHash
Source§fn cmp(&self, other: &ScriptHash) -> Ordering
fn cmp(&self, other: &ScriptHash) -> Ordering
1.21.0 (const: unstable) · 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 ScriptHash
impl PartialEq for ScriptHash
Source§impl PartialOrd for ScriptHash
impl PartialOrd for ScriptHash
impl StructuralPartialEq for ScriptHash
Auto Trait Implementations§
impl Freeze for ScriptHash
impl RefUnwindSafe for ScriptHash
impl Send for ScriptHash
impl Sync for ScriptHash
impl Unpin for ScriptHash
impl UnsafeUnpin for ScriptHash
impl UnwindSafe for ScriptHash
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