pub struct OpenMap { /* private fields */ }Expand description
A decoded text-keyed CBOR map, drained field by field into a signed record.
Implementations§
Source§impl OpenMap
impl OpenMap
Sourcepub fn deserialize<'de, D: Deserializer<'de>>(
record: &'static str,
d: D,
) -> Result<Self, D::Error>
pub fn deserialize<'de, D: Deserializer<'de>>( record: &'static str, d: D, ) -> Result<Self, D::Error>
Decode d as a map with only text keys and no duplicate key. record names the record
in every error and log line.
§Errors
When the input is not a map, holds a non-text key, or repeats a key.
Sourcepub fn take_opt<T: DeserializeOwned, E: Error>(
&mut self,
key: &'static str,
) -> Result<Option<T>, E>
pub fn take_opt<T: DeserializeOwned, E: Error>( &mut self, key: &'static str, ) -> Result<Option<T>, E>
Take an optional field: an absent key and a present null both read as None.
§Errors
When a present, non-null value does not decode as T.
Sourcepub fn into_unknown(self) -> BTreeMap<String, Value>
pub fn into_unknown(self) -> BTreeMap<String, Value>
The keys no take claimed: the record’s unknown map, preserved verbatim.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OpenMap
impl RefUnwindSafe for OpenMap
impl Send for OpenMap
impl Sync for OpenMap
impl Unpin for OpenMap
impl UnsafeUnpin for OpenMap
impl UnwindSafe for OpenMap
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more