pub enum ScriptType {
P2pkh,
P2sh,
P2wpkh,
P2wsh,
P2tr,
OpReturn,
Unknown,
}Expand description
Bitcoin script types
Variants§
P2pkh
Pay to Public Key Hash (legacy)
P2sh
Pay to Script Hash
P2wpkh
Pay to Witness Public Key Hash (native SegWit)
P2wsh
Pay to Witness Script Hash
P2tr
Pay to Taproot
OpReturn
OP_RETURN (data output)
Unknown
Unknown or non-standard
Implementations§
Source§impl ScriptType
impl ScriptType
Sourcepub fn from_address(address: &str) -> Self
pub fn from_address(address: &str) -> Self
Determine script type from address prefix
Trait Implementations§
Source§impl Clone for ScriptType
impl Clone for ScriptType
Source§fn clone(&self) -> ScriptType
fn clone(&self) -> ScriptType
Returns a duplicate 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 ScriptType
impl Debug for ScriptType
Source§impl<'de> Deserialize<'de> for ScriptType
impl<'de> Deserialize<'de> for ScriptType
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ScriptType
impl PartialEq for ScriptType
Source§impl Serialize for ScriptType
impl Serialize for ScriptType
impl Copy for ScriptType
impl Eq for ScriptType
impl StructuralPartialEq for ScriptType
Auto Trait Implementations§
impl Freeze for ScriptType
impl RefUnwindSafe for ScriptType
impl Send for ScriptType
impl Sync for ScriptType
impl Unpin for ScriptType
impl UnwindSafe for ScriptType
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> 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.