pub struct OpenMetadata(/* private fields */);Expand description
Open _meta values with typed access to final reserved keys.
Implementations§
Source§impl OpenMetadata
impl OpenMetadata
Sourcepub fn try_from_entries(
entries: impl IntoIterator<Item = (String, Value)>,
) -> Result<Self, CommonTypeError>
pub fn try_from_entries( entries: impl IntoIterator<Item = (String, Value)>, ) -> Result<Self, CommonTypeError>
Validates every key and preserves valid unknown peer entries exactly.
Sourcepub fn try_from_notification_entries(
entries: impl IntoIterator<Item = (String, Value)>,
) -> Result<Self, CommonTypeError>
pub fn try_from_notification_entries( entries: impl IntoIterator<Item = (String, Value)>, ) -> Result<Self, CommonTypeError>
Validates notification-role metadata without assigning request/result semantics to otherwise schema-open reserved keys.
The final schema gives only subscriptionId a typed meaning in
notification metadata. Every other syntactically valid key/value is
retained exactly and remains inert.
Sourcepub fn get(&self, key: &str) -> Option<&Value>
pub fn get(&self, key: &str) -> Option<&Value>
Returns the exact retained entry for a valid unknown key.
Sourcepub fn entries(&self) -> &BTreeMap<String, Value>
pub fn entries(&self) -> &BTreeMap<String, Value>
Returns all retained entries without granting them authority.
Sourcepub fn protocol_version(&self) -> Result<Option<&str>, CommonTypeError>
pub fn protocol_version(&self) -> Result<Option<&str>, CommonTypeError>
Reads the typed protocol version, if this metadata role declares it.
Sourcepub fn client_capabilities(
&self,
) -> Result<Option<&Map<String, Value>>, CommonTypeError>
pub fn client_capabilities( &self, ) -> Result<Option<&Map<String, Value>>, CommonTypeError>
Reads typed client capabilities, if present.
Sourcepub fn client_info(&self) -> Result<Option<Implementation>, CommonTypeError>
pub fn client_info(&self) -> Result<Option<Implementation>, CommonTypeError>
Decodes the self-reported client identity without treating it as authority.
Sourcepub fn server_info(&self) -> Result<Option<Implementation>, CommonTypeError>
pub fn server_info(&self) -> Result<Option<Implementation>, CommonTypeError>
Decodes the self-reported server identity from final result metadata.
Final result envelopes carry this only under
io.modelcontextprotocol/serverInfo in _meta.
Sourcepub fn log_level(&self) -> Result<Option<LoggingLevel>, CommonTypeError>
pub fn log_level(&self) -> Result<Option<LoggingLevel>, CommonTypeError>
Reads the exact optional logging-level metadata value.
Trait Implementations§
Source§impl Clone for OpenMetadata
impl Clone for OpenMetadata
Source§fn clone(&self) -> OpenMetadata
fn clone(&self) -> OpenMetadata
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OpenMetadata
impl Debug for OpenMetadata
Source§impl Default for OpenMetadata
impl Default for OpenMetadata
Source§fn default() -> OpenMetadata
fn default() -> OpenMetadata
Source§impl<'de> Deserialize<'de> for OpenMetadata
impl<'de> Deserialize<'de> for OpenMetadata
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>,
impl Eq for OpenMetadata
Source§impl PartialEq for OpenMetadata
impl PartialEq for OpenMetadata
Source§impl Serialize for OpenMetadata
impl Serialize for OpenMetadata
impl StructuralPartialEq for OpenMetadata
Auto Trait Implementations§
impl Freeze for OpenMetadata
impl RefUnwindSafe for OpenMetadata
impl Send for OpenMetadata
impl Sync for OpenMetadata
impl Unpin for OpenMetadata
impl UnsafeUnpin for OpenMetadata
impl UnwindSafe for OpenMetadata
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<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
key and return true if they are equal.