pub enum ExtensionEntry {
Structured {
info: Value,
schema: Option<Value>,
},
Raw(Value),
}Expand description
Payload attached to a single extension key.
Two shapes are permitted by the spec:
ExtensionEntry::Structured— the canonical{info, schema}envelope recommended for new extensions.schemais optional and, when present, should describe the expected shape of client-submitted data.ExtensionEntry::Raw— an opaque JSON value, forwarded verbatim. Used when an extension predates the canonical envelope or needs a non-object top-level value.
Serialization preserves the original form: structured values emit
{info, schema?}; raw values emit their stored JSON directly.
Variants§
Implementations§
Source§impl ExtensionEntry
impl ExtensionEntry
Sourcepub const fn with_schema(info: Value, schema: Value) -> Self
pub const fn with_schema(info: Value, schema: Value) -> Self
Constructs a structured entry with info and schema.
Sourcepub const fn raw(value: Value) -> Self
pub const fn raw(value: Value) -> Self
Constructs a raw entry wrapping the supplied JSON value.
Trait Implementations§
Source§impl Clone for ExtensionEntry
impl Clone for ExtensionEntry
Source§fn clone(&self) -> ExtensionEntry
fn clone(&self) -> ExtensionEntry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ExtensionEntry
impl Debug for ExtensionEntry
Source§impl<'de> Deserialize<'de> for ExtensionEntry
impl<'de> Deserialize<'de> for ExtensionEntry
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ExtensionEntry
Source§impl From<Value> for ExtensionEntry
impl From<Value> for ExtensionEntry
Source§impl PartialEq for ExtensionEntry
impl PartialEq for ExtensionEntry
Source§impl Serialize for ExtensionEntry
impl Serialize for ExtensionEntry
impl StructuralPartialEq for ExtensionEntry
Auto Trait Implementations§
impl Freeze for ExtensionEntry
impl RefUnwindSafe for ExtensionEntry
impl Send for ExtensionEntry
impl Sync for ExtensionEntry
impl Unpin for ExtensionEntry
impl UnsafeUnpin for ExtensionEntry
impl UnwindSafe for ExtensionEntry
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.