Struct bitcoin::script::WScriptHash
source · pub struct WScriptHash(/* private fields */);
Expand description
SegWit version of a Bitcoin Script bytecode hash.
Implementations§
source§impl WScriptHash
impl WScriptHash
sourcepub fn from_raw_hash(inner: Hash) -> WScriptHash
pub fn from_raw_hash(inner: Hash) -> WScriptHash
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.).
Trait Implementations§
source§impl AsRef<[u8]> for WScriptHash
impl AsRef<[u8]> for WScriptHash
source§impl AsRef<PushBytes> for WScriptHash
impl AsRef<PushBytes> for WScriptHash
source§impl Borrow<[u8]> for WScriptHash
impl Borrow<[u8]> for WScriptHash
source§impl Clone for WScriptHash
impl Clone for WScriptHash
source§fn clone(&self) -> WScriptHash
fn clone(&self) -> WScriptHash
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 WScriptHash
impl Debug for WScriptHash
source§impl<'de> Deserialize<'de> for WScriptHash
impl<'de> Deserialize<'de> for WScriptHash
source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<WScriptHash, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<WScriptHash, D::Error>
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for WScriptHash
impl Display for WScriptHash
source§impl From<&Script> for WScriptHash
impl From<&Script> for WScriptHash
source§fn from(script: &Script) -> WScriptHash
fn from(script: &Script) -> WScriptHash
Converts to this type from the input type.
source§impl From<&ScriptBuf> for WScriptHash
impl From<&ScriptBuf> for WScriptHash
source§fn from(script: &ScriptBuf) -> WScriptHash
fn from(script: &ScriptBuf) -> WScriptHash
Converts to this type from the input type.
source§impl From<Hash> for WScriptHash
impl From<Hash> for WScriptHash
source§fn from(inner: Hash) -> WScriptHash
fn from(inner: Hash) -> WScriptHash
Converts to this type from the input type.
source§impl From<ScriptBuf> for WScriptHash
impl From<ScriptBuf> for WScriptHash
source§fn from(script: ScriptBuf) -> WScriptHash
fn from(script: ScriptBuf) -> WScriptHash
Converts to this type from the input type.
source§impl From<WScriptHash> for Hash
impl From<WScriptHash> for Hash
source§fn from(hashtype: WScriptHash) -> Hash
fn from(hashtype: WScriptHash) -> Hash
Converts to this type from the input type.
source§impl From<WScriptHash> for PushBytesBuf
impl From<WScriptHash> for PushBytesBuf
source§fn from(hash: WScriptHash) -> Self
fn from(hash: WScriptHash) -> Self
Converts to this type from the input type.
source§impl FromStr for WScriptHash
impl FromStr for WScriptHash
source§impl Hash for WScriptHash
impl Hash for WScriptHash
source§impl Hash for WScriptHash
impl Hash for WScriptHash
§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 = 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.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<WScriptHash, FromSliceError>
fn from_slice(sl: &[u8]) -> Result<WScriptHash, 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§fn hash_byte_chunks<B, I>(byte_slices: I) -> Selfwhere
B: AsRef<[u8]>,
I: IntoIterator<Item = B>,
fn hash_byte_chunks<B, I>(byte_slices: I) -> Selfwhere B: AsRef<[u8]>, I: IntoIterator<Item = B>,
Hashes all the byte slices retrieved from the iterator together.
source§impl<I: SliceIndex<[u8]>> Index<I> for WScriptHash
impl<I: SliceIndex<[u8]>> Index<I> for WScriptHash
source§impl LowerHex for WScriptHash
impl LowerHex for WScriptHash
source§impl Ord for WScriptHash
impl Ord for WScriptHash
source§fn cmp(&self, other: &WScriptHash) -> Ordering
fn cmp(&self, other: &WScriptHash) -> 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<WScriptHash> for WScriptHash
impl PartialEq<WScriptHash> for WScriptHash
source§fn eq(&self, other: &WScriptHash) -> bool
fn eq(&self, other: &WScriptHash) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<WScriptHash> for WScriptHash
impl PartialOrd<WScriptHash> for WScriptHash
source§fn partial_cmp(&self, other: &WScriptHash) -> Option<Ordering>
fn partial_cmp(&self, other: &WScriptHash) -> 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 SerdeHash for WScriptHash
impl SerdeHash for WScriptHash
source§fn from_slice_delegated(sl: &[u8]) -> Result<Self, FromSliceError>
fn from_slice_delegated(sl: &[u8]) -> Result<Self, FromSliceError>
Helper function to turn a deserialized slice into the correct hash type.
source§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.
source§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.
source§impl Serialize for WScriptHash
impl Serialize for WScriptHash
source§impl UpperHex for WScriptHash
impl UpperHex for WScriptHash
impl Copy for WScriptHash
impl Eq for WScriptHash
impl StructuralEq for WScriptHash
impl StructuralPartialEq for WScriptHash
Auto Trait Implementations§
impl RefUnwindSafe for WScriptHash
impl Send for WScriptHash
impl Sync for WScriptHash
impl Unpin for WScriptHash
impl UnwindSafe for WScriptHash
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