pub struct StreamableHttpTransport { /* private fields */ }Expand description
JSON-RPC 2.0 transport speaking MCP Streamable HTTP (application/json and text/event-stream).
Implementations§
Source§impl StreamableHttpTransport
impl StreamableHttpTransport
Sourcepub fn new(
url: impl Into<String>,
headers: BTreeMap<String, String>,
bearer_token: Option<String>,
) -> Self
pub fn new( url: impl Into<String>, headers: BTreeMap<String, String>, bearer_token: Option<String>, ) -> Self
Creates a new Streamable HTTP transport targeting url.
Sourcepub fn session_id(&self) -> Option<&str>
pub fn session_id(&self) -> Option<&str>
Returns the current Mcp-Session-Id returned by the server, if any.
Sourcepub fn set_bearer_token(&mut self, token: Option<String>)
pub fn set_bearer_token(&mut self, token: Option<String>)
Replaces the bearer access token used on subsequent HTTP requests.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for StreamableHttpTransport
impl !UnwindSafe for StreamableHttpTransport
impl Forget for StreamableHttpTransport
impl Freeze for StreamableHttpTransportwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const LeafNode<String, String> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, String)>>: Freeze,
*const ArcInner<AgentConfig> is !null: Freeze,
PhantomData<ArcInner<AgentConfig>>: Freeze,
*const ArcInner<AgentState> is !null: Freeze,
PhantomData<ArcInner<AgentState>>: Freeze,
impl Move for StreamableHttpTransport
impl Send for StreamableHttpTransport
impl Sync for StreamableHttpTransport
impl Unpin for StreamableHttpTransport
impl UnsafeUnpin for StreamableHttpTransportwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const LeafNode<String, String> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, String)>>: UnsafeUnpin,
*const ArcInner<AgentConfig> is !null: UnsafeUnpin,
PhantomData<ArcInner<AgentConfig>>: UnsafeUnpin,
*const ArcInner<AgentState> is !null: UnsafeUnpin,
PhantomData<ArcInner<AgentState>>: UnsafeUnpin,
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