pub struct Map(/* private fields */);Expand description
An ordered msgpack map: a list of key/value pairs in wire order.
Implementations§
Source§impl Map
impl Map
Sourcepub fn put(
self,
key: impl Into<Cow<'static, str>>,
value: impl Into<Value>,
) -> Self
pub fn put( self, key: impl Into<Cow<'static, str>>, value: impl Into<Value>, ) -> Self
Appends key and value at the end. A key already present is not replaced; both are kept.
Sourcepub fn put_some(
self,
key: impl Into<Cow<'static, str>>,
value: Option<impl Into<Value>>,
) -> Self
pub fn put_some( self, key: impl Into<Cow<'static, str>>, value: Option<impl Into<Value>>, ) -> Self
Map::put when value is Some; leaves the key out when it is None.
Sourcepub fn into_pairs(self) -> impl Iterator<Item = (Cow<'static, str>, Value)>
pub fn into_pairs(self) -> impl Iterator<Item = (Cow<'static, str>, Value)>
The pairs themselves, in wire order, for splicing one map into another.
Sourcepub fn get(&self, key: &str) -> Option<&Value>
pub fn get(&self, key: &str) -> Option<&Value>
The value under key, the first if the key repeats.
Sourcepub fn to_msgpack(&self) -> Vec<u8> ⓘ
pub fn to_msgpack(&self) -> Vec<u8> ⓘ
The map as msgpack bytes, keys in wire order.
Trait Implementations§
impl Eq for Map
Source§impl L1Action for Map
A map is an action already.
impl L1Action for Map
A map is an action already.
Source§fn action(&self) -> Map
fn action(&self) -> Map
The action’s keys and values in wire order, which is the hashed order.
Source§fn msgpack(&self) -> Vec<u8> ⓘ
fn msgpack(&self) -> Vec<u8> ⓘ
The action as msgpack bytes, the first part of the connection id’s hash.
Source§fn typed(
&self,
nonce: u64,
vault: Option<Address>,
network: Network,
) -> TypedStruct<'static>
fn typed( &self, nonce: u64, vault: Option<Address>, network: Network, ) -> TypedStruct<'static>
The phantom agent struct the key signs for this action.
Source§fn digest(
&self,
nonce: u64,
vault: Option<Address>,
network: Network,
) -> [u8; 32]
fn digest( &self, nonce: u64, vault: Option<Address>, network: Network, ) -> [u8; 32]
What the key signs for this action: the phantom agent’s digest under
Domain::EXCHANGE.impl StructuralPartialEq for Map
Auto Trait Implementations§
impl Forget for Map
impl Freeze for Map
impl Move for Map
impl RefUnwindSafe for Map
impl Send for Map
impl Sync for Map
impl Unpin for Map
impl UnsafeUnpin for Map
impl UnwindSafe for Map
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.