Skip to main content

InputMut

Struct InputMut 

Source
pub struct InputMut<'a>(/* private fields */);
Expand description

Mutable handle to an Input held inside a Selection.

Returned by Selection::input_mut and Selection::inputs_mut. This wrapper restricts mutation to operations that preserve Selection’s coin-selection invariants.

Read-only access to the underlying Input is available via Deref.

Implementations§

Source§

impl<'a> InputMut<'a>

Source

pub fn set_sequence( &mut self, sequence: Sequence, ) -> Result<(), SetSequenceError>

Methods from Deref<Target = Input>§

Source

pub fn plan(&self) -> Option<&Plan>

Plan

Source

pub fn psbt_input(&self) -> Option<&Input>

Psbt input

Source

pub fn prev_outpoint(&self) -> OutPoint

Previous outpoint.

Source

pub fn prev_txout(&self) -> &TxOut

Previous txout.

Source

pub fn prev_tx(&self) -> Option<&Transaction>

Previous tx (if any).

Source

pub fn status(&self) -> Option<ConfirmationStatus>

Confirmation status.

Source

pub fn is_coinbase(&self) -> bool

Whether prev output resides in coinbase.

Source

pub fn is_immature(&self, tip_height: Height) -> bool

Whether prev output is an immature coinbase output.

Source

pub fn is_block_timelocked(&self, tip_height: Height) -> bool

Whether this is locked by a block-based timelock (absolute or relative).

Source

pub fn is_time_timelocked(&self, tip_mtp: Time) -> Option<bool>

Whether this is locked by a time-based timelock (absolute or relative).

Returns None if ConfirmationStatus::prev_mtp is required but unavailable.

tip_mtp is MTP(tip), or MTP(spending_block - 1), as per BIP-0068.

Source

pub fn is_timelocked( &self, tip_height: Height, tip_mtp: Option<Time>, ) -> Option<bool>

Whether this is locked by any timelock constraint.

Returns None if a time-based lock exists but tip_mtp is not provided or ConfirmationStatus::prev_mtp is unavailable.

tip_mtp is MTP(tip), or MTP(spending_block - 1), as per BIP-0068.

Source

pub fn confirmations(&self, tip_height: Height) -> u32

Confirmations of this tx.

Source

pub fn is_spendable( &self, tip_height: Height, tip_mtp: Option<Time>, ) -> Option<bool>

Whether this output can be spent at the given height and mtp time.

tip_mtp is MTP(tip), or MTP(spending_block - 1), as per BIP-0068.

Source

pub fn absolute_timelock(&self) -> Option<LockTime>

Absolute timelock.

Source

pub fn relative_timelock(&self) -> Option<LockTime>

Relative timelock.

Source

pub fn sequence(&self) -> Option<Sequence>

Sequence value.

Source

pub fn satisfaction_weight(&self) -> u64

The weight in witness units needed for satisfying the Input.

The satisfaction weight is the combined size of the fully satisfied input’s witness and scriptSig expressed in weight units. See https://en.bitcoin.it/wiki/Weight_units.

Source

pub fn is_segwit(&self) -> bool

Is segwit.

Trait Implementations§

Source§

impl<'a> Debug for InputMut<'a>

Source§

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

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

impl Deref for InputMut<'_>

Source§

type Target = Input

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Input

Dereferences the value.

Auto Trait Implementations§

§

impl<'a> Freeze for InputMut<'a>

§

impl<'a> RefUnwindSafe for InputMut<'a>

§

impl<'a> Send for InputMut<'a>

§

impl<'a> Sync for InputMut<'a>

§

impl<'a> Unpin for InputMut<'a>

§

impl<'a> UnsafeUnpin for InputMut<'a>

§

impl<'a> !UnwindSafe for InputMut<'a>

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.
Source§

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

Source§

fn vzip(self) -> V

Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,