pub struct AdditionalParams(/* private fields */);Expand description
Nonempty JSON object of provider-specific content metadata, serialized as
an object under a named additional_params field rather than flattened.
Constructors return None for empty maps. Bare deserialization rejects
empty or non-object values; optional_additional_params maps null and
empty objects to absence. Providers must replay only their own metadata.
Implementations§
Source§impl AdditionalParams
impl AdditionalParams
Sourcepub fn new(map: Map<String, Value>) -> Option<Self>
pub fn new(map: Map<String, Value>) -> Option<Self>
The canonical constructor: None when the map is empty.
Sourcepub fn from_entries<K, I>(entries: I) -> Option<Self>
pub fn from_entries<K, I>(entries: I) -> Option<Self>
Build from (key, value) entries; None when the iterator yields
none. Option<(K, Value)> is such an iterator, so a conditional
single-key params reads as
AdditionalParams::from_entries(guard.then(|| (key, value))).
Sourcepub fn into_value(self) -> Value
pub fn into_value(self) -> Value
The params as a bare JSON object value.
Sourcepub fn merge(&mut self, incoming: Self)
pub fn merge(&mut self, incoming: Self)
Deep-merge incoming into self: arrays concatenate (streamed
citation deltas), objects merge recursively, scalars take the
incoming value.
Sourcepub fn wire_extras(&self, wire_key: &str) -> Option<&Map<String, Value>>
pub fn wire_extras(&self, wire_key: &str) -> Option<&Map<String, Value>>
Returns the object under the provider’s own key, or None for absent
or non-object values. Use Self::get to diagnose malformed values.
Sourcepub fn into_wire_extras(self, wire_key: &str) -> Option<Map<String, Value>>
pub fn into_wire_extras(self, wire_key: &str) -> Option<Map<String, Value>>
Owned counterpart of Self::wire_extras for serialization paths
that already own the params (the common replay case): extracts the
wire’s object without cloning. Same gate semantics.
Trait Implementations§
Source§impl Clone for AdditionalParams
impl Clone for AdditionalParams
Source§impl Debug for AdditionalParams
impl Debug for AdditionalParams
Source§impl<'de> Deserialize<'de> for AdditionalParams
impl<'de> Deserialize<'de> for AdditionalParams
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Source§impl From<AdditionalParams> for Value
impl From<AdditionalParams> for Value
Source§fn from(params: AdditionalParams) -> Self
fn from(params: AdditionalParams) -> Self
Source§impl Index<&str> for AdditionalParams
impl Index<&str> for AdditionalParams
Source§impl PartialEq for AdditionalParams
impl PartialEq for AdditionalParams
Source§impl Serialize for AdditionalParams
impl Serialize for AdditionalParams
impl StructuralPartialEq for AdditionalParams
Auto Trait Implementations§
impl Freeze for AdditionalParams
impl RefUnwindSafe for AdditionalParams
impl Send for AdditionalParams
impl Sync for AdditionalParams
impl Unpin for AdditionalParams
impl UnsafeUnpin for AdditionalParams
impl UnwindSafe for AdditionalParams
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
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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> ⓘ
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> ⓘ
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