OutputInterface

Trait OutputInterface 

Source
pub trait OutputInterface: Sized {
    type KeyId: KeyIdInterface;
    type Input: Clone + Debug + PartialEq + Eq + PartialOrd + Ord;

    const POOL_TYPE: PoolType;

    // Required methods
    fn output_id(&self) -> OutputId;
    fn key_id(&self) -> Self::KeyId;
    fn spending_transaction(&self) -> Option<TxId>;
    fn set_spending_transaction(&mut self, spending_transaction: Option<TxId>);
    fn value(&self) -> u64;
    fn spend_link(&self) -> Option<Self::Input>;
    fn transaction_inputs(transaction: &WalletTransaction) -> Vec<&Self::Input>;
    fn transaction_outputs(transaction: &WalletTransaction) -> &[Self];
}
Expand description

Provides a common API for all output types.

Required Associated Constants§

Source

const POOL_TYPE: PoolType

Output’s associated pool type.

Required Associated Types§

Source

type KeyId: KeyIdInterface

Identifier for key used to decrypt output.

Source

type Input: Clone + Debug + PartialEq + Eq + PartialOrd + Ord

Transaction input type associated with spend detection of output.

Required Methods§

Source

fn output_id(&self) -> OutputId

Output ID.

Source

fn key_id(&self) -> Self::KeyId

Identifier for key used to decrypt output.

Source

fn spending_transaction(&self) -> Option<TxId>

Transaction ID of transaction this output was spent. If None, output is not spent.

Source

fn set_spending_transaction(&mut self, spending_transaction: Option<TxId>)

Sets spending transaction.

Source

fn value(&self) -> u64

Note value..

Returns the type used to link with transaction inputs for spend detection. Returns None in the case the nullifier is not available for shielded outputs.

Nullifier for shielded outputs. Outpoint for transparent outputs.

Source

fn transaction_inputs(transaction: &WalletTransaction) -> Vec<&Self::Input>

Inputs within transaction used to detect an output’s spend status.

Nullifiers for shielded outputs. Out points for transparent outputs.

Source

fn transaction_outputs(transaction: &WalletTransaction) -> &[Self]

Outputs within transaction.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§