pub struct StreamableHttpContext {
pub protocol_version: McpProtocolVersion,
pub session_id: Option<String>,
pub wants_streaming: bool,
pub accepts_json: bool,
pub headers: HashMap<String, String>,
}
Expand description
Streamable HTTP request context
Fields§
§protocol_version: McpProtocolVersion
Protocol version negotiated
session_id: Option<String>
Session ID if provided
wants_streaming: bool
Whether client wants streaming responses
accepts_json: bool
Whether client accepts JSON responses
headers: HashMap<String, String>
Additional request headers
Implementations§
Source§impl StreamableHttpContext
impl StreamableHttpContext
Sourcepub fn from_request<T>(req: &Request<T>) -> Self
pub fn from_request<T>(req: &Request<T>) -> Self
Parse context from HTTP request headers
Sourcepub fn is_streamable_compatible(&self) -> bool
pub fn is_streamable_compatible(&self) -> bool
Check if request is compatible with streamable HTTP
Sourcepub fn response_headers(&self) -> HeaderMap
pub fn response_headers(&self) -> HeaderMap
Create response headers for this context
Trait Implementations§
Source§impl Clone for StreamableHttpContext
impl Clone for StreamableHttpContext
Source§fn clone(&self) -> StreamableHttpContext
fn clone(&self) -> StreamableHttpContext
Returns a duplicate of the value. Read more
1.0.0 · 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 Freeze for StreamableHttpContext
impl RefUnwindSafe for StreamableHttpContext
impl Send for StreamableHttpContext
impl Sync for StreamableHttpContext
impl Unpin for StreamableHttpContext
impl UnwindSafe for StreamableHttpContext
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