pub struct ServerDiscoverResult { /* private fields */ }Expand description
Typed server/discover result whose wire vocabulary is fixed to final MCP.
Implementations§
Source§impl ServerDiscoverResult
impl ServerDiscoverResult
Sourcepub fn new(
capabilities: ServerDiscoverCapabilities,
server_info: ServerInfo,
instructions: Option<ServerInstructions>,
cache_hints: DiscoveryCacheHints,
) -> Self
pub fn new( capabilities: ServerDiscoverCapabilities, server_info: ServerInfo, instructions: Option<ServerInstructions>, cache_hints: DiscoveryCacheHints, ) -> Self
Creates a final discovery response with its exact supported-version
list, server identity in _meta, and required cache hints.
Sourcepub fn with_implementation(self, implementation: Implementation) -> Self
pub fn with_implementation(self, implementation: Implementation) -> Self
Replaces discovery _meta server identity with a final Implementation.
Exact-2024 initialize still projects name and version only. This richer
identity is for modern server/discover.
Sourcepub fn implementation(&self) -> Option<&Implementation>
pub fn implementation(&self) -> Option<&Implementation>
Returns the final Implementation identity when one was stored.
Sourcepub fn supported_versions(&self) -> &[String]
pub fn supported_versions(&self) -> &[String]
Returns the protocol versions advertised by this server.
Sourcepub fn result_type(&self) -> &str
pub fn result_type(&self) -> &str
Returns the admitted final discovery discriminator.
An absent peer discriminator is normalized to the compatibility default
complete; Self::peer_diagnostic distinguishes that wire omission
from an explicitly emitted discriminator.
Sourcepub const fn peer_diagnostic(&self) -> Option<ResultPeerDiagnostic>
pub const fn peer_diagnostic(&self) -> Option<ResultPeerDiagnostic>
Returns bounded evidence for a final peer whose otherwise-valid
discovery result omitted its required resultType discriminator.
Re-encoding canonicalizes the peer omission to the required
resultType: "complete", so compatibility evidence cannot cause a
locally emitted final discovery result to omit its discriminator.
Sourcepub fn capabilities(&self) -> &ServerDiscoverCapabilities
pub fn capabilities(&self) -> &ServerDiscoverCapabilities
Returns the derived capability shape.
Sourcepub fn server_info(&self) -> Option<&ServerInfo>
pub fn server_info(&self) -> Option<&ServerInfo>
Returns the self-reported server identity when the peer supplied one.
Sourcepub fn instructions(&self) -> Option<&ServerInstructions>
pub fn instructions(&self) -> Option<&ServerInstructions>
Returns optional server guidance without assigning it any authority.
Sourcepub const fn cache_hints(&self) -> &DiscoveryCacheHints
pub const fn cache_hints(&self) -> &DiscoveryCacheHints
Returns the required cache hints attached to this discovery result.
Trait Implementations§
Source§impl Clone for ServerDiscoverResult
impl Clone for ServerDiscoverResult
Source§fn clone(&self) -> ServerDiscoverResult
fn clone(&self) -> ServerDiscoverResult
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more