pub struct ResultMeta {
pub server_info: Option<Implementation>,
/* private fields */
}Expand description
Result metadata common to complete and input-required results.
Fields§
§server_info: Option<Implementation>Compatibility view of a locally authored server identity.
Final encoding moves this identity into
_meta.io.modelcontextprotocol/serverInfo; it is never emitted as a
top-level result member.
Implementations§
Source§impl ResultMeta
impl ResultMeta
Sourcepub const fn empty() -> Self
pub const fn empty() -> Self
Creates empty metadata for a locally authored result.
This preserves the absence of the optional _meta member on the wire.
Sourcepub fn server_generated(server_info: Implementation) -> Self
pub fn server_generated(server_info: Implementation) -> Self
Creates metadata for a locally constructed successful result.
Sourcepub fn with_metadata(self, metadata: OpenMetadata) -> Self
pub fn with_metadata(self, metadata: OpenMetadata) -> Self
Attaches final common metadata without synthesizing it when absent.
Sourcepub fn metadata(&self) -> MetadataView<'_>
pub fn metadata(&self) -> MetadataView<'_>
Returns a view that behaves as an empty metadata object when _meta was
absent, without causing serialization to synthesize _meta.
Sourcepub fn final_server_info(
&self,
) -> Result<Option<Implementation>, ResultDecodeError>
pub fn final_server_info( &self, ) -> Result<Option<Implementation>, ResultDecodeError>
Decodes the final server identity from its reserved metadata location.
Trait Implementations§
Source§impl Clone for ResultMeta
impl Clone for ResultMeta
Source§fn clone(&self) -> ResultMeta
fn clone(&self) -> ResultMeta
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 moreAuto Trait Implementations§
impl Freeze for ResultMeta
impl RefUnwindSafe for ResultMeta
impl Send for ResultMeta
impl Sync for ResultMeta
impl Unpin for ResultMeta
impl UnsafeUnpin for ResultMeta
impl UnwindSafe for ResultMeta
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).