Struct bdk_wallet::descriptor::policy::Policy
source · pub struct Policy {
pub id: String,
pub item: SatisfiableItem,
pub satisfaction: Satisfaction,
pub contribution: Satisfaction,
}
Expand description
Descriptor spending policy
Fields§
§id: String
Identifier for this policy node
item: SatisfiableItem
Type of this policy node
satisfaction: Satisfaction
How much a given PSBT already satisfies this policy node in terms of signatures
contribution: Satisfaction
How the wallet’s descriptor can satisfy this policy node
Implementations§
source§impl Policy
impl Policy
sourcepub fn requires_path(&self) -> bool
pub fn requires_path(&self) -> bool
Return whether or not a specific path in the policy tree is required to unambiguously create a transaction
What this means is that for some spending policies the user should select which paths in the tree it intends to satisfy while signing, because the transaction must be created differently based on that.
sourcepub fn get_condition(
&self,
path: &BTreeMap<String, Vec<usize>>
) -> Result<Condition, PolicyError>
pub fn get_condition( &self, path: &BTreeMap<String, Vec<usize>> ) -> Result<Condition, PolicyError>
Return the conditions that are set by the spending policy for a given path in the policy tree
Trait Implementations§
source§impl From<SatisfiableItem> for Policy
impl From<SatisfiableItem> for Policy
source§fn from(other: SatisfiableItem) -> Self
fn from(other: SatisfiableItem) -> Self
Converts to this type from the input type.
source§impl PartialEq for Policy
impl PartialEq for Policy
impl Eq for Policy
impl StructuralPartialEq for Policy
Auto Trait Implementations§
impl Freeze for Policy
impl RefUnwindSafe for Policy
impl Send for Policy
impl Sync for Policy
impl Unpin for Policy
impl UnwindSafe for Policy
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more