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.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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