pub struct KeyValuePair {
pub key: VarInt,
pub value: KvpValue,
}Expand description
A MoQT Key-Value Pair (used for parameters in control messages).
Fields§
§key: VarIntParameter key (even = varint value, odd = byte string value).
value: KvpValueParameter value.
Implementations§
Source§impl KeyValuePair
impl KeyValuePair
Sourcepub fn encode_list(pairs: &[KeyValuePair], buf: &mut impl BufMut)
pub fn encode_list(pairs: &[KeyValuePair], buf: &mut impl BufMut)
Encode a list of key-value pairs (count-prefixed).
Sourcepub fn decode_list(buf: &mut impl Buf) -> Result<Vec<KeyValuePair>, KvpError>
pub fn decode_list(buf: &mut impl Buf) -> Result<Vec<KeyValuePair>, KvpError>
Decode a list of key-value pairs (count-prefixed).
Sourcepub fn decode_d07(buf: &mut impl Buf) -> Result<Self, KvpError>
pub fn decode_d07(buf: &mut impl Buf) -> Result<Self, KvpError>
Decode a single KVP using draft-07 format (all values are length-prefixed bytes).
Sourcepub fn encode_d07(&self, buf: &mut impl BufMut)
pub fn encode_d07(&self, buf: &mut impl BufMut)
Encode a single KVP using draft-07 format (all values are length-prefixed).
Sourcepub fn decode_list_d07(
buf: &mut impl Buf,
) -> Result<Vec<KeyValuePair>, KvpError>
pub fn decode_list_d07( buf: &mut impl Buf, ) -> Result<Vec<KeyValuePair>, KvpError>
Decode a list of KVPs using draft-07 format.
Sourcepub fn encode_list_d07(pairs: &[KeyValuePair], buf: &mut impl BufMut)
pub fn encode_list_d07(pairs: &[KeyValuePair], buf: &mut impl BufMut)
Encode a list of KVPs using draft-07 format.
Trait Implementations§
Source§impl Clone for KeyValuePair
impl Clone for KeyValuePair
Source§fn clone(&self) -> KeyValuePair
fn clone(&self) -> KeyValuePair
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 KeyValuePair
impl Debug for KeyValuePair
Source§impl PartialEq for KeyValuePair
impl PartialEq for KeyValuePair
impl Eq for KeyValuePair
impl StructuralPartialEq for KeyValuePair
Auto Trait Implementations§
impl Freeze for KeyValuePair
impl RefUnwindSafe for KeyValuePair
impl Send for KeyValuePair
impl Sync for KeyValuePair
impl Unpin for KeyValuePair
impl UnsafeUnpin for KeyValuePair
impl UnwindSafe for KeyValuePair
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