pub trait FilterVtxos {
// Required method
fn matches(&self, vtxo: &WalletVtxo) -> Result<bool>;
// Provided method
fn filter_vtxos<V: Borrow<WalletVtxo>>(
&self,
vtxos: &mut Vec<V>,
) -> Result<()> { ... }
}Expand description
Trait needed to be implemented to filter wallet VTXOs.
See Wallet::vtxos_with. For easy filtering, see VtxoFilter.
This trait is also implemented for Fn(&WalletVtxo) -> anyhow::Result<bool>.
Required Methods§
Sourcefn matches(&self, vtxo: &WalletVtxo) -> Result<bool>
fn matches(&self, vtxo: &WalletVtxo) -> Result<bool>
Check whether the VTXO mathes this filter
Provided Methods§
Sourcefn filter_vtxos<V: Borrow<WalletVtxo>>(&self, vtxos: &mut Vec<V>) -> Result<()>
fn filter_vtxos<V: Borrow<WalletVtxo>>(&self, vtxos: &mut Vec<V>) -> Result<()>
Eliminate from the vector all non-matching VTXOs
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.