Trait ForEachKey

Source
pub trait ForEachKey<Pk: MiniscriptKey> {
    // Required method
    fn for_each_key<'a, F: FnMut(ForEach<'a, Pk>) -> bool>(
        &'a self,
        pred: F,
    ) -> bool
       where Pk: 'a,
             Pk::Hash: 'a;

    // Provided method
    fn for_any_key<'a, F: FnMut(ForEach<'a, Pk>) -> bool>(
        &'a self,
        pred: F,
    ) -> bool
       where Pk: 'a,
             Pk::Hash: 'a { ... }
}
Expand description

Trait describing the ability to iterate over every key

Required Methods§

Source

fn for_each_key<'a, F: FnMut(ForEach<'a, Pk>) -> bool>( &'a self, pred: F, ) -> bool
where Pk: 'a, Pk::Hash: 'a,

Run a predicate on every key in the descriptor, returning whether the predicate returned true for every key

Provided Methods§

Source

fn for_any_key<'a, F: FnMut(ForEach<'a, Pk>) -> bool>(&'a self, pred: F) -> bool
where Pk: 'a, Pk::Hash: 'a,

Run a predicate on every key in the descriptor, returning whether the predicate returned true for any key

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§

Source§

impl<Pk: MiniscriptKey> ForEachKey<Pk> for Descriptor<Pk>

Source§

impl<Pk: MiniscriptKey> ForEachKey<Pk> for sapio_miniscript::policy::concrete::Policy<Pk>

Source§

impl<Pk: MiniscriptKey> ForEachKey<Pk> for sapio_miniscript::policy::semantic::Policy<Pk>

Source§

impl<Pk: MiniscriptKey> ForEachKey<Pk> for Bare<Pk>

Source§

impl<Pk: MiniscriptKey> ForEachKey<Pk> for Pkh<Pk>

Source§

impl<Pk: MiniscriptKey> ForEachKey<Pk> for Sh<Pk>

Source§

impl<Pk: MiniscriptKey> ForEachKey<Pk> for Tr<Pk>

Source§

impl<Pk: MiniscriptKey> ForEachKey<Pk> for Wpkh<Pk>

Source§

impl<Pk: MiniscriptKey> ForEachKey<Pk> for Wsh<Pk>

Source§

impl<Pk: MiniscriptKey, Ctx: ScriptContext> ForEachKey<Pk> for Terminal<Pk, Ctx>

Source§

impl<Pk: MiniscriptKey, Ctx: ScriptContext> ForEachKey<Pk> for SortedMultiVec<Pk, Ctx>

Source§

impl<Pk: MiniscriptKey, Ctx: ScriptContext> ForEachKey<Pk> for Miniscript<Pk, Ctx>