pub struct KeyValuePairs(pub Vec<KeyValuePair>);Expand description
A collection of KeyValuePair entries, where the number of key-value-pairs are encoded/decoded first. This structure is appropriate for Control message parameters. Since duplicate parameters are allowed for unknown parameters, we don’t do duplicate checking here.
Tuple Fields§
§0: Vec<KeyValuePair>Implementations§
Source§impl KeyValuePairs
impl KeyValuePairs
pub fn new() -> Self
Sourcepub fn set(&mut self, kvp: KeyValuePair)
pub fn set(&mut self, kvp: KeyValuePair)
Insert or replace a KeyValuePair with the same key.
pub fn set_intvalue(&mut self, key: u64, value: u64)
pub fn set_bytesvalue(&mut self, key: u64, value: Vec<u8>)
pub fn has(&self, key: u64) -> bool
pub fn get(&self, key: u64) -> Option<&KeyValuePair>
Trait Implementations§
Source§impl Clone for KeyValuePairs
impl Clone for KeyValuePairs
Source§fn clone(&self) -> KeyValuePairs
fn clone(&self) -> KeyValuePairs
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KeyValuePairs
impl Debug for KeyValuePairs
Source§impl Decode for KeyValuePairs
impl Decode for KeyValuePairs
Source§impl Default for KeyValuePairs
impl Default for KeyValuePairs
Source§fn default() -> KeyValuePairs
fn default() -> KeyValuePairs
Returns the “default value” for a type. Read more
Source§impl Encode for KeyValuePairs
impl Encode for KeyValuePairs
Source§impl PartialEq for KeyValuePairs
impl PartialEq for KeyValuePairs
impl Eq for KeyValuePairs
impl StructuralPartialEq for KeyValuePairs
Auto Trait Implementations§
impl Freeze for KeyValuePairs
impl RefUnwindSafe for KeyValuePairs
impl Send for KeyValuePairs
impl Sync for KeyValuePairs
impl Unpin for KeyValuePairs
impl UnsafeUnpin for KeyValuePairs
impl UnwindSafe for KeyValuePairs
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
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.