pub struct ContextDict { /* private fields */ }Expand description
A dictionary whose keys and values use owned concrete Flow codecs.
Implementations§
Source§impl ContextDict
impl ContextDict
Sourcepub fn new(
key: ContextCodec,
value: ContextCodec,
entries: Vec<(Json, Json)>,
) -> Result<Self, DecodeError>
pub fn new( key: ContextCodec, value: ContextCodec, entries: Vec<(Json, Json)>, ) -> Result<Self, DecodeError>
Normalizes and orders entries, refusing duplicate typed keys.
Sourcepub fn key_codec(&self) -> &ContextCodec
pub fn key_codec(&self) -> &ContextCodec
The owned key codec.
Sourcepub fn value_codec(&self) -> &ContextCodec
pub fn value_codec(&self) -> &ContextCodec
The owned value codec.
Sourcepub fn iter(&self) -> impl ExactSizeIterator<Item = &(Json, Json)>
pub fn iter(&self) -> impl ExactSizeIterator<Item = &(Json, Json)>
Entries in Flow key order.
Sourcepub fn canonical_json(&self) -> Json
pub fn canonical_json(&self) -> Json
Text keys form an object; other keys form pairs.
Trait Implementations§
Source§impl Clone for ContextDict
impl Clone for ContextDict
Auto Trait Implementations§
impl Freeze for ContextDict
impl RefUnwindSafe for ContextDict
impl Send for ContextDict
impl Sync for ContextDict
impl Unpin for ContextDict
impl UnsafeUnpin for ContextDict
impl UnwindSafe for ContextDict
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