[−][src]Struct bdk::keys::SortedMultiVec
Contents of a "sortedmulti" descriptor
Fields
k: usize
signatures required
pks: Vec<Pk, Global>
public keys inside sorted Multi
Implementations
impl<Pk, Ctx> SortedMultiVec<Pk, Ctx> where
Pk: MiniscriptKey,
Ctx: ScriptContext,
[src]
Pk: MiniscriptKey,
Ctx: ScriptContext,
pub fn new(
k: usize,
pks: Vec<Pk, Global>
) -> Result<SortedMultiVec<Pk, Ctx>, Error>
[src]
k: usize,
pks: Vec<Pk, Global>
) -> Result<SortedMultiVec<Pk, Ctx>, Error>
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
.
impl<Pk, Ctx> SortedMultiVec<Pk, Ctx> where
Pk: MiniscriptKey,
Ctx: ScriptContext,
[src]
Pk: MiniscriptKey,
Ctx: ScriptContext,
pub fn translate_pk<FPk, Q, FuncError>(
&self,
translatefpk: &mut FPk
) -> Result<SortedMultiVec<Q, Ctx>, FuncError> where
Q: MiniscriptKey,
FPk: FnMut(&Pk) -> Result<Q, FuncError>,
[src]
&self,
translatefpk: &mut FPk
) -> Result<SortedMultiVec<Q, Ctx>, FuncError> where
Q: MiniscriptKey,
FPk: FnMut(&Pk) -> Result<Q, FuncError>,
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.
impl<Pk, Ctx> SortedMultiVec<Pk, Ctx> where
Pk: MiniscriptKey,
Ctx: ScriptContext,
[src]
Pk: MiniscriptKey,
Ctx: ScriptContext,
pub fn sorted_node<ToPkCtx>(&self, to_pk_ctx: ToPkCtx) -> Terminal<Pk, Ctx> where
Pk: ToPublicKey<ToPkCtx>,
ToPkCtx: Copy,
[src]
Pk: ToPublicKey<ToPkCtx>,
ToPkCtx: Copy,
Create Terminal::Multi containing sorted pubkeys
pub fn encode<ToPkCtx>(&self, to_pk_ctx: ToPkCtx) -> Script where
Pk: ToPublicKey<ToPkCtx>,
ToPkCtx: Copy,
[src]
Pk: ToPublicKey<ToPkCtx>,
ToPkCtx: Copy,
Encode as a Bitcoin script
pub fn satisfy<ToPkCtx, S>(
&self,
satisfier: S,
to_pk_ctx: ToPkCtx
) -> Result<Vec<Vec<u8, Global>, Global>, Error> where
Pk: ToPublicKey<ToPkCtx>,
S: Satisfier<ToPkCtx, Pk>,
ToPkCtx: Copy,
[src]
&self,
satisfier: S,
to_pk_ctx: ToPkCtx
) -> Result<Vec<Vec<u8, Global>, Global>, Error> where
Pk: ToPublicKey<ToPkCtx>,
S: Satisfier<ToPkCtx, Pk>,
ToPkCtx: Copy,
Attempt to produce a satisfying witness for the witness script represented by the parse tree
pub fn script_size<ToPkCtx>(&self, to_pk_ctx: ToPkCtx) -> usize where
Pk: ToPublicKey<ToPkCtx>,
ToPkCtx: Copy,
[src]
Pk: ToPublicKey<ToPkCtx>,
ToPkCtx: Copy,
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.
pub fn max_satisfaction_witness_elements(&self) -> usize
[src]
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.)
pub fn max_satisfaction_size(&self, usize) -> usize
[src]
Maximum size, in bytes, of a satisfying witness. For Segwit outputs
one_cost
should be set to 2, since the number 1
requires two
bytes to encode. For non-segwit outputs one_cost
should be set to
1, since OP_1
is available in scriptSigs.
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.
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.)
Trait Implementations
impl<Pk, Ctx> Clone for SortedMultiVec<Pk, Ctx> where
Pk: MiniscriptKey + Clone,
Ctx: ScriptContext + Clone,
[src]
Pk: MiniscriptKey + Clone,
Ctx: ScriptContext + Clone,
pub fn clone(&self) -> SortedMultiVec<Pk, Ctx>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<Pk, Ctx> Debug for SortedMultiVec<Pk, Ctx> where
Pk: MiniscriptKey,
Ctx: ScriptContext,
[src]
Pk: MiniscriptKey,
Ctx: ScriptContext,
impl<Pk, Ctx> Display for SortedMultiVec<Pk, Ctx> where
Pk: MiniscriptKey,
Ctx: ScriptContext,
[src]
Pk: MiniscriptKey,
Ctx: ScriptContext,
impl<Pk, Ctx> Eq for SortedMultiVec<Pk, Ctx> where
Pk: MiniscriptKey + Eq,
Ctx: ScriptContext + Eq,
[src]
Pk: MiniscriptKey + Eq,
Ctx: ScriptContext + Eq,
impl<Pk, Ctx> Liftable<Pk> for SortedMultiVec<Pk, Ctx> where
Pk: MiniscriptKey,
Ctx: ScriptContext,
[src]
Pk: MiniscriptKey,
Ctx: ScriptContext,
impl<Pk, Ctx> Ord for SortedMultiVec<Pk, Ctx> where
Pk: MiniscriptKey + Ord,
Ctx: ScriptContext + Ord,
[src]
Pk: MiniscriptKey + Ord,
Ctx: ScriptContext + Ord,
pub fn cmp(&self, other: &SortedMultiVec<Pk, Ctx>) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl<Pk, Ctx> PartialEq<SortedMultiVec<Pk, Ctx>> for SortedMultiVec<Pk, Ctx> where
Pk: MiniscriptKey + PartialEq<Pk>,
Ctx: ScriptContext + PartialEq<Ctx>,
[src]
Pk: MiniscriptKey + PartialEq<Pk>,
Ctx: ScriptContext + PartialEq<Ctx>,
pub fn eq(&self, other: &SortedMultiVec<Pk, Ctx>) -> bool
[src]
pub fn ne(&self, other: &SortedMultiVec<Pk, Ctx>) -> bool
[src]
impl<Pk, Ctx> PartialOrd<SortedMultiVec<Pk, Ctx>> for SortedMultiVec<Pk, Ctx> where
Pk: MiniscriptKey + PartialOrd<Pk>,
Ctx: ScriptContext + PartialOrd<Ctx>,
[src]
Pk: MiniscriptKey + PartialOrd<Pk>,
Ctx: ScriptContext + PartialOrd<Ctx>,
pub fn partial_cmp(&self, other: &SortedMultiVec<Pk, Ctx>) -> Option<Ordering>
[src]
pub fn lt(&self, other: &SortedMultiVec<Pk, Ctx>) -> bool
[src]
pub fn le(&self, other: &SortedMultiVec<Pk, Ctx>) -> bool
[src]
pub fn gt(&self, other: &SortedMultiVec<Pk, Ctx>) -> bool
[src]
pub fn ge(&self, other: &SortedMultiVec<Pk, Ctx>) -> bool
[src]
impl<Pk, Ctx> StructuralEq for SortedMultiVec<Pk, Ctx> where
Pk: MiniscriptKey,
Ctx: ScriptContext,
[src]
Pk: MiniscriptKey,
Ctx: ScriptContext,
impl<Pk, Ctx> StructuralPartialEq for SortedMultiVec<Pk, Ctx> where
Pk: MiniscriptKey,
Ctx: ScriptContext,
[src]
Pk: MiniscriptKey,
Ctx: ScriptContext,
Auto Trait Implementations
impl<Pk, Ctx> RefUnwindSafe for SortedMultiVec<Pk, Ctx> where
Ctx: RefUnwindSafe,
Pk: RefUnwindSafe,
[src]
Ctx: RefUnwindSafe,
Pk: RefUnwindSafe,
impl<Pk, Ctx> Send for SortedMultiVec<Pk, Ctx> where
Ctx: Send,
Pk: Send,
[src]
Ctx: Send,
Pk: Send,
impl<Pk, Ctx> Sync for SortedMultiVec<Pk, Ctx> where
Ctx: Sync,
Pk: Sync,
[src]
Ctx: Sync,
Pk: Sync,
impl<Pk, Ctx> Unpin for SortedMultiVec<Pk, Ctx> where
Ctx: Unpin,
Pk: Unpin,
[src]
Ctx: Unpin,
Pk: Unpin,
impl<Pk, Ctx> UnwindSafe for SortedMultiVec<Pk, Ctx> where
Ctx: UnwindSafe,
Pk: UnwindSafe,
[src]
Ctx: UnwindSafe,
Pk: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
[src]
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
pub fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,