pub struct Wtxid(/* private fields */);Expand description
A bitcoin witness transaction ID.
Implementations§
Source§impl Wtxid
impl Wtxid
Sourcepub fn from_raw_hash(inner: Hash) -> Wtxid
pub fn from_raw_hash(inner: Hash) -> Wtxid
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 Decodable for Wtxid
impl Decodable for Wtxid
Source§impl<'de> Deserialize<'de> for Wtxid
impl<'de> Deserialize<'de> for Wtxid
Source§fn deserialize<D>(d: D) -> Result<Wtxid, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(d: D) -> Result<Wtxid, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&Transaction> for Wtxid
impl From<&Transaction> for Wtxid
Source§fn from(tx: &Transaction) -> Wtxid
fn from(tx: &Transaction) -> Wtxid
Converts to this type from the input type.
Source§impl From<Transaction> for Wtxid
impl From<Transaction> for Wtxid
Source§fn from(tx: Transaction) -> Wtxid
fn from(tx: Transaction) -> Wtxid
Converts to this type from the input type.
Source§impl Hash for Wtxid
impl Hash for Wtxid
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§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§fn from_engine(e: <Wtxid as Hash>::Engine) -> Wtxid
fn from_engine(e: <Wtxid as Hash>::Engine) -> Wtxid
Produces a hash from the current state of a given engine.
Source§fn from_slice(sl: &[u8]) -> Result<Wtxid, FromSliceError>
fn from_slice(sl: &[u8]) -> Result<Wtxid, FromSliceError>
Copies a byte slice into a hash object.
Source§fn from_byte_array(bytes: <Wtxid as Hash>::Bytes) -> Wtxid
fn from_byte_array(bytes: <Wtxid as Hash>::Bytes) -> Wtxid
Constructs a hash from the underlying byte array.
Source§fn as_byte_array(&self) -> &<Wtxid as Hash>::Bytes
fn as_byte_array(&self) -> &<Wtxid as Hash>::Bytes
Returns a reference to the underlying byte array.
Source§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.
Source§impl Ord for Wtxid
impl Ord for Wtxid
Source§impl PartialOrd for Wtxid
impl PartialOrd for Wtxid
Source§impl SerdeHash for Wtxid
impl SerdeHash for Wtxid
Source§fn from_slice_delegated(sl: &[u8]) -> Result<Wtxid, FromSliceError>
fn from_slice_delegated(sl: &[u8]) -> Result<Wtxid, 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 Wtxid
impl Serialize for Wtxid
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,
Serialize this value into the given Serde serializer. Read more
impl Copy for Wtxid
impl Eq for Wtxid
impl StructuralPartialEq for Wtxid
Auto Trait Implementations§
impl Freeze for Wtxid
impl RefUnwindSafe for Wtxid
impl Send for Wtxid
impl Sync for Wtxid
impl Unpin for Wtxid
impl UnwindSafe for Wtxid
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,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>
fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.