Struct bdk::keys::SortedMultiVec [−][src]
pub struct SortedMultiVec<Pk, Ctx> where
Pk: MiniscriptKey,
Ctx: ScriptContext, {
pub k: usize,
pub pks: Vec<Pk, Global>,
// some fields omitted
}
Expand description
Contents of a “sortedmulti” descriptor
Fields
k: usize
signatures required
pks: Vec<Pk, Global>
public keys inside sorted Multi
Implementations
Create a new instance of SortedMultiVec
given a list of keys and the threshold
Internally checks all the applicable size limits and pubkey types limitations according to the current Ctx
.
Parse an expression tree into a SortedMultiVec
pub fn translate_pk<FPk, Q, FuncError>(
&self,
translatefpk: &mut FPk
) -> Result<SortedMultiVec<Q, Ctx>, FuncError> where
FPk: FnMut(&Pk) -> Result<Q, FuncError>,
Q: MiniscriptKey,
pub fn translate_pk<FPk, Q, FuncError>(
&self,
translatefpk: &mut FPk
) -> Result<SortedMultiVec<Q, Ctx>, FuncError> where
FPk: FnMut(&Pk) -> Result<Q, FuncError>,
Q: MiniscriptKey,
This will panic if translatefpk returns an uncompressed key when converting to a Segwit descriptor. To prevent this panic, ensure translatefpk returns an error in this case instead.
utility function to sanity a sorted multi vec
Create Terminal::Multi containing sorted pubkeys
Encode as a Bitcoin script
Attempt to produce a satisfying witness for the witness script represented by the parse tree
Size, in bytes of the script-pubkey. If this Miniscript is used outside of segwit (e.g. in a bare or P2SH descriptor), this quantity should be multiplied by 4 to compute the weight.
In general, it is not recommended to use this function directly, but
to instead call the corresponding function on a Descriptor
, which
will handle the segwit/non-segwit technicalities for you.
Maximum number of witness elements used to satisfy the Miniscript
fragment, including the witness script itself. Used to estimate
the weight of the VarInt
that specifies this number in a serialized
transaction.
This function may panic on malformed Miniscript
objects which do
not correspond to semantically sane Scripts. (Such scripts should be
rejected at parse time. Any exceptions are bugs.)
Maximum size, in bytes, of a satisfying witness.
In general, it is not recommended to use this function directly, but
to instead call the corresponding function on a Descriptor
, which
will handle the segwit/non-segwit technicalities for you.
All signatures are assumed to be 73 bytes in size, including the length prefix (segwit) or push opcode (pre-segwit) and sighash postfix.
Trait Implementations
impl<Pk, Ctx> Clone for SortedMultiVec<Pk, Ctx> where
Pk: Clone + MiniscriptKey,
Ctx: Clone + ScriptContext,
impl<Pk, Ctx> Clone for SortedMultiVec<Pk, Ctx> where
Pk: Clone + MiniscriptKey,
Ctx: Clone + ScriptContext,
impl<Pk, Ctx> ForEachKey<Pk> for SortedMultiVec<Pk, Ctx> where
Pk: MiniscriptKey,
Ctx: ScriptContext,
impl<Pk, Ctx> ForEachKey<Pk> for SortedMultiVec<Pk, Ctx> where
Pk: MiniscriptKey,
Ctx: ScriptContext,
pub fn for_each_key<'a, F>(&'a self, pred: F) -> bool where
F: FnMut(ForEach<'a, Pk>) -> bool,
Pk: 'a,
<Pk as MiniscriptKey>::Hash: 'a,
pub fn for_each_key<'a, F>(&'a self, pred: F) -> bool where
F: FnMut(ForEach<'a, Pk>) -> bool,
Pk: 'a,
<Pk as MiniscriptKey>::Hash: 'a,
Run a predicate on every key in the descriptor, returning whether the predicate returned true for every key Read more
fn for_any_key<'a, F>(&'a self, pred: F) -> bool where
F: FnMut(ForEach<'a, Pk>) -> bool,
Pk: 'a,
<Pk as MiniscriptKey>::Hash: 'a,
fn for_any_key<'a, F>(&'a self, pred: F) -> bool where
F: FnMut(ForEach<'a, Pk>) -> bool,
Pk: 'a,
<Pk as MiniscriptKey>::Hash: 'a,
Run a predicate on every key in the descriptor, returning whether the predicate returned true for any key Read more
impl<Pk, Ctx> Hash for SortedMultiVec<Pk, Ctx> where
Pk: Hash + MiniscriptKey,
Ctx: Hash + ScriptContext,
impl<Pk, Ctx> Hash for SortedMultiVec<Pk, Ctx> where
Pk: Hash + MiniscriptKey,
Ctx: Hash + ScriptContext,
impl<Pk, Ctx> Liftable<Pk> for SortedMultiVec<Pk, Ctx> where
Pk: MiniscriptKey,
Ctx: ScriptContext,
impl<Pk, Ctx> Liftable<Pk> for SortedMultiVec<Pk, Ctx> where
Pk: MiniscriptKey,
Ctx: ScriptContext,
impl<Pk, Ctx> Ord for SortedMultiVec<Pk, Ctx> where
Pk: Ord + MiniscriptKey,
Ctx: Ord + ScriptContext,
impl<Pk, Ctx> Ord for SortedMultiVec<Pk, Ctx> where
Pk: Ord + MiniscriptKey,
Ctx: Ord + ScriptContext,
impl<Pk, Ctx> PartialEq<SortedMultiVec<Pk, Ctx>> for SortedMultiVec<Pk, Ctx> where
Pk: PartialEq<Pk> + MiniscriptKey,
Ctx: PartialEq<Ctx> + ScriptContext,
impl<Pk, Ctx> PartialEq<SortedMultiVec<Pk, Ctx>> for SortedMultiVec<Pk, Ctx> where
Pk: PartialEq<Pk> + MiniscriptKey,
Ctx: PartialEq<Ctx> + ScriptContext,
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
impl<Pk, Ctx> PartialOrd<SortedMultiVec<Pk, Ctx>> for SortedMultiVec<Pk, Ctx> where
Pk: PartialOrd<Pk> + MiniscriptKey,
Ctx: PartialOrd<Ctx> + ScriptContext,
impl<Pk, Ctx> PartialOrd<SortedMultiVec<Pk, Ctx>> for SortedMultiVec<Pk, Ctx> where
Pk: PartialOrd<Pk> + MiniscriptKey,
Ctx: PartialOrd<Ctx> + ScriptContext,
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
impl<Pk, Ctx> Eq for SortedMultiVec<Pk, Ctx> where
Pk: Eq + MiniscriptKey,
Ctx: Eq + ScriptContext,
impl<Pk, Ctx> StructuralEq for SortedMultiVec<Pk, Ctx> where
Pk: MiniscriptKey,
Ctx: ScriptContext,
impl<Pk, Ctx> StructuralPartialEq for SortedMultiVec<Pk, Ctx> where
Pk: MiniscriptKey,
Ctx: ScriptContext,
Auto Trait Implementations
impl<Pk, Ctx> RefUnwindSafe for SortedMultiVec<Pk, Ctx> where
Ctx: RefUnwindSafe,
Pk: RefUnwindSafe,
impl<Pk, Ctx> Send for SortedMultiVec<Pk, Ctx> where
Ctx: Send,
Pk: Send,
impl<Pk, Ctx> Sync for SortedMultiVec<Pk, Ctx> where
Ctx: Sync,
Pk: Sync,
impl<Pk, Ctx> Unpin for SortedMultiVec<Pk, Ctx> where
Ctx: Unpin,
Pk: Unpin,
impl<Pk, Ctx> UnwindSafe for SortedMultiVec<Pk, Ctx> where
Ctx: UnwindSafe,
Pk: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more