#[non_exhaustive]pub struct InitializeRequestParams {
pub meta: Option<Meta>,
pub protocol_version: ProtocolVersion,
pub capabilities: ClientCapabilities,
pub client_info: Implementation,
}Expand description
Parameters sent by a client when initializing a connection to an MCP server.
This contains the client’s protocol version, capabilities, and implementation information, allowing the server to understand what the client supports.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.meta: Option<Meta>Protocol-level metadata for this request (SEP-1319)
protocol_version: ProtocolVersionThe MCP protocol version this client supports
capabilities: ClientCapabilitiesThe capabilities this client supports (sampling, roots, etc.)
client_info: ImplementationInformation about the client implementation
Implementations§
Source§impl InitializeRequestParams
impl InitializeRequestParams
Sourcepub fn new(
capabilities: ClientCapabilities,
client_info: Implementation,
) -> Self
pub fn new( capabilities: ClientCapabilities, client_info: Implementation, ) -> Self
Create a new InitializeRequestParams.
pub fn with_protocol_version(self, protocol_version: ProtocolVersion) -> Self
Trait Implementations§
Source§impl Clone for InitializeRequestParams
impl Clone for InitializeRequestParams
Source§fn clone(&self) -> InitializeRequestParams
fn clone(&self) -> InitializeRequestParams
Returns a duplicate of the value. Read more
1.0.0 · 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 InitializeRequestParams
impl Debug for InitializeRequestParams
Source§impl<'de> Deserialize<'de> for InitializeRequestParams
impl<'de> Deserialize<'de> for InitializeRequestParams
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
Source§impl JsonSchema for InitializeRequestParams
impl JsonSchema for InitializeRequestParams
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for InitializeRequestParams
impl PartialEq for InitializeRequestParams
Source§impl RequestParamsMeta for InitializeRequestParams
impl RequestParamsMeta for InitializeRequestParams
Source§fn progress_token(&self) -> Option<ProgressToken>
fn progress_token(&self) -> Option<ProgressToken>
Get the progress token from meta, if present
Source§fn set_progress_token(&mut self, token: ProgressToken)
fn set_progress_token(&mut self, token: ProgressToken)
Set a progress token in meta
Source§impl Serialize for InitializeRequestParams
impl Serialize for InitializeRequestParams
impl StructuralPartialEq for InitializeRequestParams
Auto Trait Implementations§
impl Freeze for InitializeRequestParams
impl RefUnwindSafe for InitializeRequestParams
impl Send for InitializeRequestParams
impl Sync for InitializeRequestParams
impl Unpin for InitializeRequestParams
impl UnsafeUnpin for InitializeRequestParams
impl UnwindSafe for InitializeRequestParams
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,
Source§impl<R, S> DynService<R> for Swhere
R: ServiceRole,
S: Service<R>,
impl<R, S> DynService<R> for Swhere
R: ServiceRole,
S: Service<R>,
Source§fn handle_request(
&self,
request: <R as ServiceRole>::PeerReq,
context: RequestContext<R>,
) -> Pin<Box<dyn Future<Output = Result<<R as ServiceRole>::Resp, ErrorData>> + Send + '_>>
fn handle_request( &self, request: <R as ServiceRole>::PeerReq, context: RequestContext<R>, ) -> Pin<Box<dyn Future<Output = Result<<R as ServiceRole>::Resp, ErrorData>> + Send + '_>>
Available on (crate features
client or server) and non-crate feature local only.Source§fn handle_notification(
&self,
notification: <R as ServiceRole>::PeerNot,
context: NotificationContext<R>,
) -> Pin<Box<dyn Future<Output = Result<(), ErrorData>> + Send + '_>>
fn handle_notification( &self, notification: <R as ServiceRole>::PeerNot, context: NotificationContext<R>, ) -> Pin<Box<dyn Future<Output = Result<(), ErrorData>> + Send + '_>>
Available on (crate features
client or server) and non-crate feature local only.Source§fn get_info(&self) -> <R as ServiceRole>::Info
fn get_info(&self) -> <R as ServiceRole>::Info
Available on (crate features
client or server) and non-crate feature local only.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<H> Service<RoleClient> for Hwhere
H: ClientHandler,
impl<H> Service<RoleClient> for Hwhere
H: ClientHandler,
Source§async fn handle_request(
&self,
request: <RoleClient as ServiceRole>::PeerReq,
context: RequestContext<RoleClient>,
) -> Result<<RoleClient as ServiceRole>::Resp, ErrorData>
async fn handle_request( &self, request: <RoleClient as ServiceRole>::PeerReq, context: RequestContext<RoleClient>, ) -> Result<<RoleClient as ServiceRole>::Resp, ErrorData>
Available on (crate features
client or server) and non-crate feature local only.Source§async fn handle_notification(
&self,
notification: <RoleClient as ServiceRole>::PeerNot,
context: NotificationContext<RoleClient>,
) -> Result<(), ErrorData>
async fn handle_notification( &self, notification: <RoleClient as ServiceRole>::PeerNot, context: NotificationContext<RoleClient>, ) -> Result<(), ErrorData>
Available on (crate features
client or server) and non-crate feature local only.Source§fn get_info(&self) -> <RoleClient as ServiceRole>::Info
fn get_info(&self) -> <RoleClient as ServiceRole>::Info
Available on (crate features
client or server) and non-crate feature local only.Source§impl<S> ServiceExt<RoleClient> for Swhere
S: Service<RoleClient>,
impl<S> ServiceExt<RoleClient> for Swhere
S: Service<RoleClient>,
Source§fn serve_with_ct<T, E, A>(
self,
transport: T,
ct: CancellationToken,
) -> impl Future<Output = Result<RunningService<RoleClient, S>, ClientInitializeError>> + MaybeSendFuture
fn serve_with_ct<T, E, A>( self, transport: T, ct: CancellationToken, ) -> impl Future<Output = Result<RunningService<RoleClient, S>, ClientInitializeError>> + MaybeSendFuture
Available on crate features
client or server only.Source§fn into_dyn(self) -> Box<dyn DynService<R>>
fn into_dyn(self) -> Box<dyn DynService<R>>
Available on crate features
client or server only.Convert this service to a dynamic boxed service Read more
Source§fn serve<T, E, A>(
self,
transport: T,
) -> impl Future<Output = Result<RunningService<R, Self>, R::InitializeError>> + MaybeSendFuture
fn serve<T, E, A>( self, transport: T, ) -> impl Future<Output = Result<RunningService<R, Self>, R::InitializeError>> + MaybeSendFuture
Available on crate features
client or server only.