pub struct Negotiated {
pub protocol_version: String,
pub capabilities: ServerCapabilities,
pub server_info: Option<Implementation>,
pub instructions: Option<String>,
pub tools_ttl_ms: Option<u64>,
pub tools_cache_scope: Option<CacheScope>,
pub stateful: bool,
}Available on crate feature
client only.Expand description
What negotiation learned about a server.
Fields§
§protocol_version: StringThe revision both sides will speak.
capabilities: ServerCapabilities§server_info: Option<Implementation>Present when the server identified itself; server/discover does not
carry an identity, so a stateless negotiation leaves this None until
a result’s _meta supplies one.
instructions: Option<String>Guidance the server offers about how to use it.
tools_ttl_ms: Option<u64>How long a tools/list result may be considered fresh, and whether a
shared cache may serve it across authorization contexts. Only
server/discover reports these.
tools_cache_scope: Option<CacheScope>§stateful: boolTrue when the server was reached through the initialize handshake
rather than server/discover, and is therefore keeping session state.
Implementations§
Source§impl Negotiated
impl Negotiated
Sourcepub fn initialized_notification(&self) -> Option<JsonRpcNotification>
pub fn initialized_notification(&self) -> Option<JsonRpcNotification>
The confirmation a stateful server is waiting for. Send it before the
first ordinary request; a stateless server needs nothing, and this is
None.
Trait Implementations§
Source§impl Clone for Negotiated
impl Clone for Negotiated
Source§fn clone(&self) -> Negotiated
fn clone(&self) -> Negotiated
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 Negotiated
impl RefUnwindSafe for Negotiated
impl Send for Negotiated
impl Sync for Negotiated
impl Unpin for Negotiated
impl UnsafeUnpin for Negotiated
impl UnwindSafe for Negotiated
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