pub struct Upstream { /* private fields */ }Expand description
An upstream MCP server (Streamable HTTP).
Implementations§
Source§impl Upstream
impl Upstream
Sourcepub fn new(prefix: impl Into<String>, url: impl Into<String>) -> Self
pub fn new(prefix: impl Into<String>, url: impl Into<String>) -> Self
The server at url (its MCP endpoint, e.g. https://mcp.example.com/mcp),
whose tools appear as <prefix>__<tool>. prefix is letters, digits,
- and single _s.
Sourcepub fn header(self, name: impl Into<String>, value: impl Into<String>) -> Self
pub fn header(self, name: impl Into<String>, value: impl Into<String>) -> Self
Send this header to the upstream on every request — its credentials,
e.g. .header("Authorization", "Bearer <upstream token>").
Sourcepub fn timeout_ms(self, timeout_ms: u64) -> Self
pub fn timeout_ms(self, timeout_ms: u64) -> Self
Give up on an upstream request after this long (default 30 s).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Upstream
impl RefUnwindSafe for Upstream
impl Send for Upstream
impl Sync for Upstream
impl Unpin for Upstream
impl UnsafeUnpin for Upstream
impl UnwindSafe for Upstream
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