pub struct StreamableHttpTransport { /* private fields */ }Available on crate feature
mcp only.Expand description
Streamable-HTTP MCP transport.
Construct with StreamableHttpTransport::new for a live connection, or
StreamableHttpTransport::with_poster to inject a custom HttpPoster
(used by tests).
Implementations§
Source§impl StreamableHttpTransport
impl StreamableHttpTransport
Sourcepub fn new(endpoint: impl Into<String>, auth: McpAuth) -> Result<Arc<Self>>
pub fn new(endpoint: impl Into<String>, auth: McpAuth) -> Result<Arc<Self>>
Create a transport that talks to endpoint over real HTTP.
§Errors
Returns an error if the underlying HTTP client cannot be built.
Sourcepub fn with_poster(poster: Arc<dyn HttpPoster>, auth: McpAuth) -> Arc<Self>
pub fn with_poster(poster: Arc<dyn HttpPoster>, auth: McpAuth) -> Arc<Self>
Create a transport backed by a custom HttpPoster.
This is the seam tests use to script JSON / SSE responses without a network.
Trait Implementations§
Source§impl McpTransport for StreamableHttpTransport
impl McpTransport for StreamableHttpTransport
Source§fn send<'life0, 'async_trait>(
&'life0 self,
request: JsonRpcRequest,
) -> Pin<Box<dyn Future<Output = Result<JsonRpcResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send<'life0, 'async_trait>(
&'life0 self,
request: JsonRpcRequest,
) -> Pin<Box<dyn Future<Output = Result<JsonRpcResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Send a request and wait for a response. Read more
Source§fn send_notification<'life0, 'async_trait>(
&'life0 self,
request: JsonRpcRequest,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send_notification<'life0, 'async_trait>(
&'life0 self,
request: JsonRpcRequest,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Send a notification (fire-and-forget, no response expected). Read more
Auto Trait Implementations§
impl !Freeze for StreamableHttpTransport
impl !RefUnwindSafe for StreamableHttpTransport
impl !UnwindSafe for StreamableHttpTransport
impl Send for StreamableHttpTransport
impl Sync for StreamableHttpTransport
impl Unpin for StreamableHttpTransport
impl UnsafeUnpin for StreamableHttpTransport
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