Struct Output

Source
pub struct Output { /* private fields */ }
Expand description

Information about a transparent output within a transaction.

This struct is for representing transparent outputs in a partially-created transaction. If you have a fully-created transaction, use the regular TxOut struct.

Implementations§

Source§

impl Output

Source

pub fn parse( value: u64, script_pubkey: Vec<u8>, redeem_script: Option<Vec<u8>>, bip32_derivation: BTreeMap<[u8; 33], Bip32Derivation>, user_address: Option<String>, proprietary: BTreeMap<String, Vec<u8>>, ) -> Result<Self, ParseError>

Parses a PCZT output from its component parts.

Source§

impl Output

Source

pub fn verify(&self) -> Result<(), VerifyError>

Verifies the consistency of this transparent output.

If the redeem_script field is set, its validity will be checked.

Source§

impl Output

Source

pub fn value(&self) -> &Zatoshis

The value of the output.

Source

pub fn script_pubkey(&self) -> &Script

The script constraining how spending of this output must be authorized.

Source

pub fn redeem_script(&self) -> &Option<Script>

The script required to spend this output, if it is P2SH.

Set to None if this is a P2PKH output, or a P2SH with an unknown redeem script.

Source

pub fn bip32_derivation(&self) -> &BTreeMap<[u8; 33], Bip32Derivation>

A map from a pubkey to the BIP 32 derivation path at which its corresponding spending key can be found.

  • The pubkeys should appear in script_pubkey or redeem_script.
  • Each entry is set by an Updater.
  • Individual entries may be required by a Signer.
  • It is not required that the map include entries for all of the used pubkeys. In particular, it is not possible to include entries for non-BIP-32 pubkeys.
Source

pub fn user_address(&self) -> &Option<String>

The user-facing address to which this output is being sent, if any.

  • This is set by an Updater.
  • Signers must parse this address (if present) and confirm that it contains recipient (either directly, or e.g. as a receiver within a Unified Address).
Source

pub fn proprietary(&self) -> &BTreeMap<String, Vec<u8>>

Proprietary fields related to the transparent coin being created.

Trait Implementations§

Source§

impl Debug for Output

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Output

§

impl RefUnwindSafe for Output

§

impl Send for Output

§

impl Sync for Output

§

impl Unpin for Output

§

impl UnwindSafe for Output

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.
§

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

§

fn vzip(self) -> V