Struct ScriptHash
pub struct ScriptHash(/* private fields */);
Expand description
A hash of Bitcoin Script bytecode.
Implementations§
§impl ScriptHash
impl ScriptHash
pub fn from_raw_hash(inner: Hash) -> ScriptHash
pub fn from_raw_hash(inner: Hash) -> ScriptHash
Creates this wrapper type from the inner hash type.
pub fn to_raw_hash(self) -> Hash
pub fn to_raw_hash(self) -> Hash
Returns the inner hash (sha256, sh256d etc.).
pub fn as_raw_hash(&self) -> &Hash
pub fn as_raw_hash(&self) -> &Hash
Returns a reference to the inner hash (sha256, sh256d etc.).
Trait Implementations§
§impl AsRef<[u8]> for ScriptHash
impl AsRef<[u8]> for ScriptHash
§impl AsRef<[u8; 20]> for ScriptHash
impl AsRef<[u8; 20]> for ScriptHash
§impl AsRef<PushBytes> for ScriptHash
impl AsRef<PushBytes> for ScriptHash
§impl Borrow<[u8]> for ScriptHash
impl Borrow<[u8]> for ScriptHash
§impl Clone for ScriptHash
impl Clone for ScriptHash
§fn clone(&self) -> ScriptHash
fn clone(&self) -> ScriptHash
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 more§impl Debug for ScriptHash
impl Debug for ScriptHash
§impl<'de> Deserialize<'de> for ScriptHash
impl<'de> Deserialize<'de> for ScriptHash
§fn deserialize<D>(d: D) -> Result<ScriptHash, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(d: D) -> Result<ScriptHash, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl Display for ScriptHash
impl Display for ScriptHash
§impl From<&Script> for ScriptHash
impl From<&Script> for ScriptHash
§fn from(script: &Script) -> ScriptHash
fn from(script: &Script) -> ScriptHash
Converts to this type from the input type.
§impl From<&ScriptBuf> for ScriptHash
impl From<&ScriptBuf> for ScriptHash
§fn from(script: &ScriptBuf) -> ScriptHash
fn from(script: &ScriptBuf) -> ScriptHash
Converts to this type from the input type.
§impl From<Hash> for ScriptHash
impl From<Hash> for ScriptHash
§fn from(inner: Hash) -> ScriptHash
fn from(inner: Hash) -> ScriptHash
Converts to this type from the input type.
§impl From<ScriptBuf> for ScriptHash
impl From<ScriptBuf> for ScriptHash
§fn from(script: ScriptBuf) -> ScriptHash
fn from(script: ScriptBuf) -> ScriptHash
Converts to this type from the input type.
§impl From<ScriptHash> for Hash
impl From<ScriptHash> for Hash
§fn from(hashtype: ScriptHash) -> Hash
fn from(hashtype: ScriptHash) -> Hash
Converts to this type from the input type.
§impl From<ScriptHash> for PushBytesBuf
impl From<ScriptHash> for PushBytesBuf
§fn from(hash: ScriptHash) -> PushBytesBuf
fn from(hash: ScriptHash) -> PushBytesBuf
Converts to this type from the input type.
§impl FromStr for ScriptHash
impl FromStr for ScriptHash
§type Err = HexToArrayError
type Err = HexToArrayError
The associated error which can be returned from parsing.
§fn from_str(s: &str) -> Result<ScriptHash, <ScriptHash as FromStr>::Err>
fn from_str(s: &str) -> Result<ScriptHash, <ScriptHash as FromStr>::Err>
Parses a string
s
to return a value of this type. Read more§impl Hash for ScriptHash
impl Hash for ScriptHash
§impl Hash for ScriptHash
impl Hash for ScriptHash
§const DISPLAY_BACKWARD: bool = false
const DISPLAY_BACKWARD: bool = false
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.§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.§fn engine() -> <ScriptHash as Hash>::Engine
fn engine() -> <ScriptHash as Hash>::Engine
Constructs a new engine.
§fn from_engine(e: <ScriptHash as Hash>::Engine) -> ScriptHash
fn from_engine(e: <ScriptHash as Hash>::Engine) -> ScriptHash
Produces a hash from the current state of a given engine.
§fn from_slice(sl: &[u8]) -> Result<ScriptHash, FromSliceError>
fn from_slice(sl: &[u8]) -> Result<ScriptHash, FromSliceError>
Copies a byte slice into a hash object.
§fn from_byte_array(bytes: <ScriptHash as Hash>::Bytes) -> ScriptHash
fn from_byte_array(bytes: <ScriptHash as Hash>::Bytes) -> ScriptHash
Constructs a hash from the underlying byte array.
§fn to_byte_array(self) -> <ScriptHash as Hash>::Bytes
fn to_byte_array(self) -> <ScriptHash as Hash>::Bytes
Returns the underlying byte array.
§fn as_byte_array(&self) -> &<ScriptHash as Hash>::Bytes
fn as_byte_array(&self) -> &<ScriptHash as Hash>::Bytes
Returns a reference to the underlying byte array.
§fn all_zeros() -> ScriptHash
fn all_zeros() -> ScriptHash
Returns an all zero hash. Read more
§fn hash_byte_chunks<B, I>(byte_slices: I) -> Self
fn hash_byte_chunks<B, I>(byte_slices: I) -> Self
Hashes all the byte slices retrieved from the iterator together.
§impl<I> Index<I> for ScriptHashwhere
I: SliceIndex<[u8]>,
impl<I> Index<I> for ScriptHashwhere
I: SliceIndex<[u8]>,
§impl LowerHex for ScriptHash
impl LowerHex for ScriptHash
§impl Ord for ScriptHash
impl Ord for ScriptHash
§impl PartialEq for ScriptHash
impl PartialEq for ScriptHash
§impl PartialOrd for ScriptHash
impl PartialOrd for ScriptHash
§impl SerdeHash for ScriptHash
impl SerdeHash for ScriptHash
§fn from_slice_delegated(sl: &[u8]) -> Result<ScriptHash, FromSliceError>
fn from_slice_delegated(sl: &[u8]) -> Result<ScriptHash, FromSliceError>
Helper function to turn a deserialized slice into the correct hash type.
§fn serialize<S>(
&self,
s: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
s: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Do serde serialization.
§fn deserialize<'de, D>(d: D) -> Result<Self, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<'de, D>(d: D) -> Result<Self, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Do serde deserialization.
§impl Serialize for ScriptHash
impl Serialize for ScriptHash
§fn serialize<S>(
&self,
s: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
s: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
§impl UpperHex for ScriptHash
impl UpperHex for ScriptHash
impl Copy for ScriptHash
impl Eq 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 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more