Struct barter_data::subscription::Map
source · pub struct Map<T>(pub HashMap<SubscriptionId, T>);Expand description
New typeHashMap that maps a SubscriptionId to some associated type T.
Used by ExchangeTransformers to identify the
Barter Instrument associated with incoming exchange messages.
Tuple Fields§
§0: HashMap<SubscriptionId, T>Implementations§
source§impl<T> Map<T>
impl<T> Map<T>
sourcepub fn find(&self, id: &SubscriptionId) -> Result<T, SocketError>where
T: Clone,
pub fn find(&self, id: &SubscriptionId) -> Result<T, SocketError>where
T: Clone,
Find the T associated with the provided SubscriptionId.
sourcepub fn find_mut(&mut self, id: &SubscriptionId) -> Result<&mut T, SocketError>
pub fn find_mut(&mut self, id: &SubscriptionId) -> Result<&mut T, SocketError>
Find the mutable reference to T associated with the provided SubscriptionId.
Trait Implementations§
source§impl<'de, T> Deserialize<'de> for Map<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Map<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
source§impl<T> FromIterator<(SubscriptionId, T)> for Map<T>
impl<T> FromIterator<(SubscriptionId, T)> for Map<T>
source§fn from_iter<Iter>(iter: Iter) -> Selfwhere
Iter: IntoIterator<Item = (SubscriptionId, T)>,
fn from_iter<Iter>(iter: Iter) -> Selfwhere
Iter: IntoIterator<Item = (SubscriptionId, T)>,
Creates a value from an iterator. Read more
source§impl<T: PartialEq> PartialEq<Map<T>> for Map<T>
impl<T: PartialEq> PartialEq<Map<T>> for Map<T>
impl<T: Eq> Eq for Map<T>
impl<T> StructuralEq for Map<T>
impl<T> StructuralPartialEq for Map<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for Map<T>where
T: RefUnwindSafe,
impl<T> Send for Map<T>where
T: Send,
impl<T> Sync for Map<T>where
T: Sync,
impl<T> Unpin for Map<T>where
T: Unpin,
impl<T> UnwindSafe for Map<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.