#[repr(u8)]pub enum ScriptClass {
NonStandard = 0,
PubKey = 1,
PubKeyECDSA = 2,
ScriptHash = 3,
}
Expand description
Standard classes of script payment in the blockDAG
Variants§
NonStandard = 0
None of the recognized forms
PubKey = 1
Pay to pubkey
PubKeyECDSA = 2
Pay to pubkey ECDSA
ScriptHash = 3
Pay to script hash
Implementations§
Source§impl ScriptClass
impl ScriptClass
pub fn from_script(script_public_key: &ScriptPublicKey) -> Self
pub fn is_pay_to_pubkey(script_public_key: &[u8]) -> bool
Sourcepub fn is_pay_to_pubkey_ecdsa(script_public_key: &[u8]) -> bool
pub fn is_pay_to_pubkey_ecdsa(script_public_key: &[u8]) -> bool
transaction, false otherwise.
Sourcepub fn is_pay_to_script_hash(script_public_key: &[u8]) -> bool
pub fn is_pay_to_script_hash(script_public_key: &[u8]) -> bool
Returns true if the script is in the standard pay-to-script-hash (P2SH) format, false otherwise.
pub fn version(&self) -> ScriptPublicKeyVersion
Trait Implementations§
Source§impl BorshDeserialize for ScriptClass
impl BorshDeserialize for ScriptClass
fn deserialize_reader<__R: Read>(reader: &mut __R) -> Result<Self, Error>
Source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
Source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl BorshSerialize for ScriptClass
impl BorshSerialize for ScriptClass
Source§impl Clone for ScriptClass
impl Clone for ScriptClass
Source§fn clone(&self) -> ScriptClass
fn clone(&self) -> ScriptClass
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 ScriptClass
impl Debug for ScriptClass
Source§impl<'de> Deserialize<'de> for ScriptClass
impl<'de> Deserialize<'de> for ScriptClass
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 Display for ScriptClass
impl Display for ScriptClass
Source§impl EnumExt for ScriptClass
impl EnumExt for ScriptClass
Source§impl From<Version> for ScriptClass
impl From<Version> for ScriptClass
Source§impl FromStr for ScriptClass
impl FromStr for ScriptClass
Source§impl PartialEq for ScriptClass
impl PartialEq for ScriptClass
Source§impl Serialize for ScriptClass
impl Serialize for ScriptClass
Source§impl TryFrom<&str> for ScriptClass
impl TryFrom<&str> for ScriptClass
impl Eq for ScriptClass
impl StructuralPartialEq for ScriptClass
Auto Trait Implementations§
impl Freeze for ScriptClass
impl RefUnwindSafe for ScriptClass
impl Send for ScriptClass
impl Sync for ScriptClass
impl Unpin for ScriptClass
impl UnwindSafe for ScriptClass
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.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more