pub struct StreamableHttpHandler { /* private fields */ }Available on crate feature
http only.Expand description
Streamable HTTP transport handler
Implementations§
Source§impl StreamableHttpHandler
impl StreamableHttpHandler
Sourcepub fn new(
config: Arc<ServerConfig>,
dispatcher: Arc<JsonRpcDispatcher<McpError>>,
session_storage: Arc<dyn SessionStorage<Error = SessionStorageError>>,
stream_manager: Arc<StreamManager>,
server_capabilities: ServerCapabilities,
middleware_stack: Arc<MiddlewareStack>,
tool_fingerprint: Option<String>,
) -> StreamableHttpHandler
pub fn new( config: Arc<ServerConfig>, dispatcher: Arc<JsonRpcDispatcher<McpError>>, session_storage: Arc<dyn SessionStorage<Error = SessionStorageError>>, stream_manager: Arc<StreamManager>, server_capabilities: ServerCapabilities, middleware_stack: Arc<MiddlewareStack>, tool_fingerprint: Option<String>, ) -> StreamableHttpHandler
Creates a handler from the server configuration, JSON-RPC dispatcher, session storage, stream manager, advertised server capabilities, middleware stack and optional tool fingerprint.
Sourcepub fn without_subscriptions_listen(self) -> StreamableHttpHandler
pub fn without_subscriptions_listen(self) -> StreamableHttpHandler
Refuse subscriptions/listen at once (HTTP 404 + -32601) instead of
holding an SSE stream open. For transports that buffer the response.
Sourcepub fn with_server_info(self, info: Implementation) -> StreamableHttpHandler
pub fn with_server_info(self, info: Implementation) -> StreamableHttpHandler
Set the identity reported in each result’s _meta.serverInfo.
Sourcepub fn with_tool_notifier(
self,
notifier: Arc<dyn ToolChangeNotifier>,
) -> StreamableHttpHandler
pub fn with_tool_notifier( self, notifier: Arc<dyn ToolChangeNotifier>, ) -> StreamableHttpHandler
Sets the notifier called when a session’s stored tool fingerprint differs from the server’s, so the session receives notifications/tools/list_changed.
Trait Implementations§
Source§impl Clone for StreamableHttpHandler
impl Clone for StreamableHttpHandler
Source§fn clone(&self) -> StreamableHttpHandler
fn clone(&self) -> StreamableHttpHandler
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 !RefUnwindSafe for StreamableHttpHandler
impl !UnwindSafe for StreamableHttpHandler
impl Forget for StreamableHttpHandler
impl Freeze for StreamableHttpHandler
impl Move for StreamableHttpHandler
impl Send for StreamableHttpHandler
impl Sync for StreamableHttpHandler
impl Unpin for StreamableHttpHandler
impl UnsafeUnpin for StreamableHttpHandler
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: 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.