#[repr(u8)]
pub enum ScriptClass {
    NonStandard,
    PubKey,
    PubKeyECDSA,
    ScriptHash,
}
Expand description

Standard classes of script payment in the blockDAG

Variants§

§

NonStandard

None of the recognized forms

§

PubKey

Pay to pubkey

§

PubKeyECDSA

Pay to pubkey ECDSA

§

ScriptHash

Pay to script hash

Implementations§

source§

impl ScriptClass

source

pub fn from_script(script_public_key: &ScriptPublicKey) -> Self

source

pub fn is_pay_to_pubkey(script_public_key: &[u8]) -> bool

source

pub fn is_pay_to_pubkey_ecdsa(script_public_key: &[u8]) -> bool

transaction, false otherwise.

source

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.

source

pub fn version(&self) -> ScriptPublicKeyVersion

Trait Implementations§

source§

impl BorshDeserialize for ScriptClass

source§

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>

Deserialize this instance from a slice of bytes.
source§

impl BorshSchema for ScriptClass

source§

fn declaration() -> Declaration

Get the name of the type without brackets.
source§

fn add_definitions_recursively( definitions: &mut HashMap<Declaration, Definition> )

Recursively, using DFS, add type definitions required for this type. For primitive types this is an empty map. Type definition explains how to serialize/deserialize a type.
source§

fn add_definition( declaration: String, definition: Definition, definitions: &mut HashMap<String, Definition, RandomState> )

Helper method to add a single type definition to the map.
source§

fn schema_container() -> BorshSchemaContainer

source§

impl BorshSerialize for ScriptClass

source§

fn serialize<W: Write>(&self, writer: &mut W) -> Result<(), Error>

source§

fn try_to_vec(&self) -> Result<Vec<u8, Global>, Error>

Serialize this instance into a vector of bytes.
source§

impl Clone for ScriptClass

source§

fn clone(&self) -> ScriptClass

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ScriptClass

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for ScriptClass

source§

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

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<Version> for ScriptClass

source§

fn from(value: Version) -> Self

Converts to this type from the input type.
source§

impl FromStr for ScriptClass

§

type Err = Error

The associated error which can be returned from parsing.
source§

fn from_str(script_class: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl PartialEq<ScriptClass> for ScriptClass

source§

fn eq(&self, other: &ScriptClass) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for ScriptClass

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl TryFrom<&str> for ScriptClass

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(script_class: &str) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl Eq for ScriptClass

source§

impl StructuralEq for ScriptClass

source§

impl StructuralPartialEq for ScriptClass

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere T: Any,

§

fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send + 'static>

source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<S> CastArc for Swhere S: CastFromSync + ?Sized,

§

fn cast<T>(self: Arc<S>) -> Result<Arc<T>, Arc<S>>where T: 'static + ?Sized,

Casts an Arc for this trait into that for type T.
§

impl<S> CastBox for Swhere S: CastFrom + ?Sized,

§

fn cast<T>(self: Box<S, Global>) -> Result<Box<T, Global>, Box<S, Global>>where T: 'static + ?Sized,

Casts a box to this trait into that of type T. If fails, returns the receiver.
§

impl<T> CastFrom for Twhere T: Any + 'static,

§

fn ref_any(&self) -> &(dyn Any + 'static)

Returns a immutable reference to Any, which is backed by the type implementing this trait.
§

fn mut_any(&mut self) -> &mut (dyn Any + 'static)

Returns a mutable reference to Any, which is backed by the type implementing this trait.
§

fn box_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>

Returns a Box of Any, which is backed by the type implementing this trait.
§

fn rc_any(self: Rc<T>) -> Rc<dyn Any + 'static>

Returns an Rc of Any, which is backed by the type implementing this trait.
§

impl<T> CastFromSync for Twhere T: Sync + Send + 'static,

§

fn arc_any(self: Arc<T>) -> Arc<dyn Any + Sync + Send + 'static>

§

impl<S> CastMut for Swhere S: CastFrom + ?Sized,

§

fn cast<T>(&mut self) -> Option<&mut T>where T: 'static + ?Sized,

Casts a mutable reference to this trait into that of type T.
§

impl<S> CastRc for Swhere S: CastFrom + ?Sized,

§

fn cast<T>(self: Rc<S>) -> Result<Rc<T>, Rc<S>>where T: 'static + ?Sized,

Casts an Rc for this trait into that for type T.
§

impl<S> CastRef for Swhere S: CastFrom + ?Sized,

§

fn cast<T>(&self) -> Option<&T>where T: 'static + ?Sized,

Casts a reference to this trait into that of type T.
§

fn impls<T>(&self) -> boolwhere T: 'static + ?Sized,

Tests if this trait object can be cast into T.
source§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<T, U> ExactFrom<T> for Uwhere U: TryFrom<T>,

§

fn exact_from(value: T) -> U

§

impl<T, U> ExactInto<U> for Twhere U: ExactFrom<T>,

§

fn exact_into(self) -> U

source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T, U> OverflowingInto<U> for Twhere U: OverflowingFrom<T>,

§

fn overflowing_into(self) -> (U, bool)

§

impl<T, U> RoundingInto<U> for Twhere U: RoundingFrom<T>,

§

fn rounding_into(self, rm: RoundingMode) -> U

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
§

impl<T, U> SaturatingInto<U> for Twhere U: SaturatingFrom<T>,

§

fn saturating_into(self) -> U

§

impl<T> ToDebugString for Twhere T: Debug,

§

fn to_debug_string(&self) -> String

Returns the String produced by Ts Debug implementation.

Examples
use malachite_base::strings::ToDebugString;

assert_eq!([1, 2, 3].to_debug_string(), "[1, 2, 3]");
assert_eq!(
    [vec![2, 3], vec![], vec![4]].to_debug_string(),
    "[[2, 3], [], [4]]"
);
assert_eq!(Some(5).to_debug_string(), "Some(5)");
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T, U> WrappingInto<U> for Twhere U: WrappingFrom<T>,

§

fn wrapping_into(self) -> U

source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,