pub struct SigMap<T> {
pub by_outcome: BTreeMap<Outcome, T>,
pub by_win_condition: BTreeMap<WinCondition, T>,
}Expand description
Represents a mapping of different signature requirements to some arbitrary type T.
This can be used to efficiently look up signatures, nonces, etc, for each
outcome transaction, and for different WinConditions within each split transaction.
Fields§
§by_outcome: BTreeMap<Outcome, T>Corresponds to the set of outcome transactions which the player needs to sign.
by_win_condition: BTreeMap<WinCondition, T>Corresponds to the set of split transaction spending conditions which the player needs to sign.
Implementations§
Source§impl<T> SigMap<T>
impl<T> SigMap<T>
Sourcepub fn map<V, F1, F2>(
self,
map_outcomes: F1,
map_win_conditions: F2,
) -> SigMap<V>
pub fn map<V, F1, F2>( self, map_outcomes: F1, map_win_conditions: F2, ) -> SigMap<V>
Map each outcome and win condition to values of a specific type using distinct map functions.
Sourcepub fn map_values<V, F>(self, map_fn: F) -> SigMap<V>where
F: FnMut(T) -> V,
pub fn map_values<V, F>(self, map_fn: F) -> SigMap<V>where
F: FnMut(T) -> V,
Map each outcome and win condition to values of a specific type.
Trait Implementations§
Source§impl<'de, T> Deserialize<'de> for SigMap<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for SigMap<T>where
T: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<T: Eq> Eq for SigMap<T>
impl<T> StructuralPartialEq for SigMap<T>
Auto Trait Implementations§
impl<T> Freeze for SigMap<T>
impl<T> RefUnwindSafe for SigMap<T>where
T: RefUnwindSafe,
impl<T> Send for SigMap<T>where
T: Send,
impl<T> Sync for SigMap<T>where
T: Sync,
impl<T> Unpin for SigMap<T>
impl<T> UnwindSafe for SigMap<T>where
T: RefUnwindSafe,
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