pub struct ServerCapabilitiesBuilder<S = ServerCapabilitiesBuilderState> {
pub experimental: Option<BTreeMap<String, Map<String, Value>>>,
pub extensions: Option<BTreeMap<String, Map<String, Value>>>,
pub logging: Option<Map<String, Value>>,
pub completions: Option<Map<String, Value>>,
pub prompts: Option<PromptsCapability>,
pub resources: Option<ResourcesCapability>,
pub tools: Option<ToolsCapability>,
pub state: PhantomData<S>,
}Fields§
§experimental: Option<BTreeMap<String, Map<String, Value>>>§extensions: Option<BTreeMap<String, Map<String, Value>>>§logging: Option<Map<String, Value>>§completions: Option<Map<String, Value>>§prompts: Option<PromptsCapability>§resources: Option<ResourcesCapability>§tools: Option<ToolsCapability>§state: PhantomData<S>Implementations§
Source§impl<S> ServerCapabilitiesBuilder<S>
impl<S> ServerCapabilitiesBuilder<S>
pub fn build(self) -> ServerCapabilities
Source§impl<const EXTENSIONS: bool, const LOGGING: bool, const COMPLETIONS: bool, const PROMPTS: bool, const RESOURCES: bool, const TOOLS: bool> ServerCapabilitiesBuilder<ServerCapabilitiesBuilderState<false, EXTENSIONS, LOGGING, COMPLETIONS, PROMPTS, RESOURCES, TOOLS>>
impl<const EXTENSIONS: bool, const LOGGING: bool, const COMPLETIONS: bool, const PROMPTS: bool, const RESOURCES: bool, const TOOLS: bool> ServerCapabilitiesBuilder<ServerCapabilitiesBuilderState<false, EXTENSIONS, LOGGING, COMPLETIONS, PROMPTS, RESOURCES, TOOLS>>
pub fn enable_experimental( self, ) -> ServerCapabilitiesBuilder<ServerCapabilitiesBuilderState<true, EXTENSIONS, LOGGING, COMPLETIONS, PROMPTS, RESOURCES, TOOLS>>
pub fn enable_experimental_with( self, experimental: BTreeMap<String, Map<String, Value>>, ) -> ServerCapabilitiesBuilder<ServerCapabilitiesBuilderState<true, EXTENSIONS, LOGGING, COMPLETIONS, PROMPTS, RESOURCES, TOOLS>>
Source§impl<const EXPERIMENTAL: bool, const LOGGING: bool, const COMPLETIONS: bool, const PROMPTS: bool, const RESOURCES: bool, const TOOLS: bool> ServerCapabilitiesBuilder<ServerCapabilitiesBuilderState<EXPERIMENTAL, false, LOGGING, COMPLETIONS, PROMPTS, RESOURCES, TOOLS>>
impl<const EXPERIMENTAL: bool, const LOGGING: bool, const COMPLETIONS: bool, const PROMPTS: bool, const RESOURCES: bool, const TOOLS: bool> ServerCapabilitiesBuilder<ServerCapabilitiesBuilderState<EXPERIMENTAL, false, LOGGING, COMPLETIONS, PROMPTS, RESOURCES, TOOLS>>
pub fn enable_extensions( self, ) -> ServerCapabilitiesBuilder<ServerCapabilitiesBuilderState<EXPERIMENTAL, true, LOGGING, COMPLETIONS, PROMPTS, RESOURCES, TOOLS>>
pub fn enable_extensions_with( self, extensions: BTreeMap<String, Map<String, Value>>, ) -> ServerCapabilitiesBuilder<ServerCapabilitiesBuilderState<EXPERIMENTAL, true, LOGGING, COMPLETIONS, PROMPTS, RESOURCES, TOOLS>>
Source§impl<const EXPERIMENTAL: bool, const EXTENSIONS: bool, const COMPLETIONS: bool, const PROMPTS: bool, const RESOURCES: bool, const TOOLS: bool> ServerCapabilitiesBuilder<ServerCapabilitiesBuilderState<EXPERIMENTAL, EXTENSIONS, false, COMPLETIONS, PROMPTS, RESOURCES, TOOLS>>
impl<const EXPERIMENTAL: bool, const EXTENSIONS: bool, const COMPLETIONS: bool, const PROMPTS: bool, const RESOURCES: bool, const TOOLS: bool> ServerCapabilitiesBuilder<ServerCapabilitiesBuilderState<EXPERIMENTAL, EXTENSIONS, false, COMPLETIONS, PROMPTS, RESOURCES, TOOLS>>
pub fn enable_logging( self, ) -> ServerCapabilitiesBuilder<ServerCapabilitiesBuilderState<EXPERIMENTAL, EXTENSIONS, true, COMPLETIONS, PROMPTS, RESOURCES, TOOLS>>
👎Deprecated since 1.8.0:
Logging is deprecated by SEP-2577 and will be removed in a future release. See https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2577
pub fn enable_logging_with( self, logging: Map<String, Value>, ) -> ServerCapabilitiesBuilder<ServerCapabilitiesBuilderState<EXPERIMENTAL, EXTENSIONS, true, COMPLETIONS, PROMPTS, RESOURCES, TOOLS>>
👎Deprecated since 1.8.0:
Logging is deprecated by SEP-2577 and will be removed in a future release. See https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2577
Source§impl<const EXPERIMENTAL: bool, const EXTENSIONS: bool, const LOGGING: bool, const PROMPTS: bool, const RESOURCES: bool, const TOOLS: bool> ServerCapabilitiesBuilder<ServerCapabilitiesBuilderState<EXPERIMENTAL, EXTENSIONS, LOGGING, false, PROMPTS, RESOURCES, TOOLS>>
impl<const EXPERIMENTAL: bool, const EXTENSIONS: bool, const LOGGING: bool, const PROMPTS: bool, const RESOURCES: bool, const TOOLS: bool> ServerCapabilitiesBuilder<ServerCapabilitiesBuilderState<EXPERIMENTAL, EXTENSIONS, LOGGING, false, PROMPTS, RESOURCES, TOOLS>>
pub fn enable_completions( self, ) -> ServerCapabilitiesBuilder<ServerCapabilitiesBuilderState<EXPERIMENTAL, EXTENSIONS, LOGGING, true, PROMPTS, RESOURCES, TOOLS>>
pub fn enable_completions_with( self, completions: Map<String, Value>, ) -> ServerCapabilitiesBuilder<ServerCapabilitiesBuilderState<EXPERIMENTAL, EXTENSIONS, LOGGING, true, PROMPTS, RESOURCES, TOOLS>>
Source§impl<const EXPERIMENTAL: bool, const EXTENSIONS: bool, const LOGGING: bool, const COMPLETIONS: bool, const RESOURCES: bool, const TOOLS: bool> ServerCapabilitiesBuilder<ServerCapabilitiesBuilderState<EXPERIMENTAL, EXTENSIONS, LOGGING, COMPLETIONS, false, RESOURCES, TOOLS>>
impl<const EXPERIMENTAL: bool, const EXTENSIONS: bool, const LOGGING: bool, const COMPLETIONS: bool, const RESOURCES: bool, const TOOLS: bool> ServerCapabilitiesBuilder<ServerCapabilitiesBuilderState<EXPERIMENTAL, EXTENSIONS, LOGGING, COMPLETIONS, false, RESOURCES, TOOLS>>
pub fn enable_prompts( self, ) -> ServerCapabilitiesBuilder<ServerCapabilitiesBuilderState<EXPERIMENTAL, EXTENSIONS, LOGGING, COMPLETIONS, true, RESOURCES, TOOLS>>
pub fn enable_prompts_with( self, prompts: PromptsCapability, ) -> ServerCapabilitiesBuilder<ServerCapabilitiesBuilderState<EXPERIMENTAL, EXTENSIONS, LOGGING, COMPLETIONS, true, RESOURCES, TOOLS>>
Source§impl<const EXPERIMENTAL: bool, const EXTENSIONS: bool, const LOGGING: bool, const COMPLETIONS: bool, const PROMPTS: bool, const TOOLS: bool> ServerCapabilitiesBuilder<ServerCapabilitiesBuilderState<EXPERIMENTAL, EXTENSIONS, LOGGING, COMPLETIONS, PROMPTS, false, TOOLS>>
impl<const EXPERIMENTAL: bool, const EXTENSIONS: bool, const LOGGING: bool, const COMPLETIONS: bool, const PROMPTS: bool, const TOOLS: bool> ServerCapabilitiesBuilder<ServerCapabilitiesBuilderState<EXPERIMENTAL, EXTENSIONS, LOGGING, COMPLETIONS, PROMPTS, false, TOOLS>>
pub fn enable_resources( self, ) -> ServerCapabilitiesBuilder<ServerCapabilitiesBuilderState<EXPERIMENTAL, EXTENSIONS, LOGGING, COMPLETIONS, PROMPTS, true, TOOLS>>
pub fn enable_resources_with( self, resources: ResourcesCapability, ) -> ServerCapabilitiesBuilder<ServerCapabilitiesBuilderState<EXPERIMENTAL, EXTENSIONS, LOGGING, COMPLETIONS, PROMPTS, true, TOOLS>>
Source§impl<const EXPERIMENTAL: bool, const EXTENSIONS: bool, const LOGGING: bool, const COMPLETIONS: bool, const PROMPTS: bool, const RESOURCES: bool> ServerCapabilitiesBuilder<ServerCapabilitiesBuilderState<EXPERIMENTAL, EXTENSIONS, LOGGING, COMPLETIONS, PROMPTS, RESOURCES>>
impl<const EXPERIMENTAL: bool, const EXTENSIONS: bool, const LOGGING: bool, const COMPLETIONS: bool, const PROMPTS: bool, const RESOURCES: bool> ServerCapabilitiesBuilder<ServerCapabilitiesBuilderState<EXPERIMENTAL, EXTENSIONS, LOGGING, COMPLETIONS, PROMPTS, RESOURCES>>
pub fn enable_tools( self, ) -> ServerCapabilitiesBuilder<ServerCapabilitiesBuilderState<EXPERIMENTAL, EXTENSIONS, LOGGING, COMPLETIONS, PROMPTS, RESOURCES, true>>
pub fn enable_tools_with( self, tools: ToolsCapability, ) -> ServerCapabilitiesBuilder<ServerCapabilitiesBuilderState<EXPERIMENTAL, EXTENSIONS, LOGGING, COMPLETIONS, PROMPTS, RESOURCES, true>>
Source§impl<const E: bool, const EXT: bool, const L: bool, const C: bool, const P: bool, const R: bool> ServerCapabilitiesBuilder<ServerCapabilitiesBuilderState<E, EXT, L, C, P, R, true>>
impl<const E: bool, const EXT: bool, const L: bool, const C: bool, const P: bool, const R: bool> ServerCapabilitiesBuilder<ServerCapabilitiesBuilderState<E, EXT, L, C, P, R, true>>
pub fn enable_tool_list_changed( self, ) -> ServerCapabilitiesBuilder<ServerCapabilitiesBuilderState<E, EXT, L, C, P, R, true>>
Source§impl<const E: bool, const EXT: bool, const L: bool, const C: bool, const R: bool, const T: bool> ServerCapabilitiesBuilder<ServerCapabilitiesBuilderState<E, EXT, L, C, true, R, T>>
impl<const E: bool, const EXT: bool, const L: bool, const C: bool, const R: bool, const T: bool> ServerCapabilitiesBuilder<ServerCapabilitiesBuilderState<E, EXT, L, C, true, R, T>>
pub fn enable_prompts_list_changed( self, ) -> ServerCapabilitiesBuilder<ServerCapabilitiesBuilderState<E, EXT, L, C, true, R, T>>
Source§impl<const E: bool, const EXT: bool, const L: bool, const C: bool, const P: bool, const T: bool> ServerCapabilitiesBuilder<ServerCapabilitiesBuilderState<E, EXT, L, C, P, true, T>>
impl<const E: bool, const EXT: bool, const L: bool, const C: bool, const P: bool, const T: bool> ServerCapabilitiesBuilder<ServerCapabilitiesBuilderState<E, EXT, L, C, P, true, T>>
pub fn enable_resources_list_changed( self, ) -> ServerCapabilitiesBuilder<ServerCapabilitiesBuilderState<E, EXT, L, C, P, true, T>>
pub fn enable_resources_subscribe( self, ) -> ServerCapabilitiesBuilder<ServerCapabilitiesBuilderState<E, EXT, L, C, P, true, T>>
Source§impl<S> ServerCapabilitiesBuilder<S>
impl<S> ServerCapabilitiesBuilder<S>
Sourcepub fn enable_tasks(self) -> ServerCapabilitiesBuilder<S>
pub fn enable_tasks(self) -> ServerCapabilitiesBuilder<S>
Declare support for the io.modelcontextprotocol/tasks extension
(SEP-2663) in the extensions capability map.
Trait Implementations§
Source§impl<S> Debug for ServerCapabilitiesBuilder<S>where
S: Debug,
impl<S> Debug for ServerCapabilitiesBuilder<S>where
S: Debug,
Source§impl<S> Default for ServerCapabilitiesBuilder<S>where
S: Default,
impl<S> Default for ServerCapabilitiesBuilder<S>where
S: Default,
Source§fn default() -> ServerCapabilitiesBuilder<S>
fn default() -> ServerCapabilitiesBuilder<S>
Returns the “default value” for a type. Read more
Source§impl<S> From<ServerCapabilitiesBuilder<S>> for ServerCapabilities
impl<S> From<ServerCapabilitiesBuilder<S>> for ServerCapabilities
Source§fn from(builder: ServerCapabilitiesBuilder<S>) -> ServerCapabilities
fn from(builder: ServerCapabilitiesBuilder<S>) -> ServerCapabilities
Converts to this type from the input type.
Auto Trait Implementations§
impl<S> Freeze for ServerCapabilitiesBuilder<S>where
PhantomData<S>: Freeze,
impl<S> RefUnwindSafe for ServerCapabilitiesBuilder<S>where
PhantomData<S>: RefUnwindSafe,
impl<S> Send for ServerCapabilitiesBuilder<S>where
PhantomData<S>: Send,
impl<S> Sync for ServerCapabilitiesBuilder<S>where
PhantomData<S>: Sync,
impl<S> Unpin for ServerCapabilitiesBuilder<S>where
PhantomData<S>: Unpin,
impl<S> UnsafeUnpin for ServerCapabilitiesBuilder<S>where
PhantomData<S>: UnsafeUnpin,
impl<S> UnwindSafe for ServerCapabilitiesBuilder<S>where
PhantomData<S>: UnwindSafe,
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> 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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.