Skip to main content

StreamableHttpTransport

Struct StreamableHttpTransport 

Source
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

Source

pub fn new( url: impl Into<String>, headers: BTreeMap<String, String>, bearer_token: Option<String>, ) -> Self

Creates a new Streamable HTTP transport targeting url.

Source

pub fn session_id(&self) -> Option<&str>

Returns the current Mcp-Session-Id returned by the server, if any.

Source

pub fn set_bearer_token(&mut self, token: Option<String>)

Replaces the bearer access token used on subsequent HTTP requests.

Trait Implementations§

Source§

impl McpTransport for StreamableHttpTransport

Source§

fn send_request( &mut self, request_id: u64, method: &str, params: Option<Value>, timeout: Duration, ) -> Result<Value, McpError>

Source§

fn send_notification( &mut self, method: &str, params: Option<Value>, timeout: Duration, ) -> Result<(), McpError>

Auto Trait Implementations§

§

impl !RefUnwindSafe for StreamableHttpTransport

§

impl !UnwindSafe for StreamableHttpTransport

§

impl Forget for StreamableHttpTransport

§

impl Freeze for StreamableHttpTransport
where *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
where RawVecInner: Send, NodeRef<Owned, String, String, LeafOrInternal>: Send, BoxRaw<(String, String)>: Send, Arc<AgentConfig>: Send, Arc<AgentState>: Send,

§

impl Sync for StreamableHttpTransport
where RawVecInner: Sync, NodeRef<Owned, String, String, LeafOrInternal>: Sync, BoxRaw<(String, String)>: Sync, Arc<AgentConfig>: Sync, Arc<AgentState>: Sync,

§

impl Unpin for StreamableHttpTransport
where *const u8 is !null: Unpin, *const LeafNode<String, String> is !null: Unpin, Box<(String, String)>: Unpin, Arc<AgentConfig>: Unpin, Arc<AgentState>: Unpin,

§

impl UnsafeUnpin for StreamableHttpTransport
where *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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.