pub struct RequestOptions {
pub request_timeout: Duration,
pub max_line_length: usize,
pub channel_capacity: usize,
pub retry_delay: Option<Duration>,
pub max_retries: Option<usize>,
pub custom_headers: Option<HashMap<String, String>>,
pub request_header_provider: Option<Arc<dyn Fn(&str) -> Option<HeaderMap> + Send + Sync>>,
}Fields§
§request_timeout: Duration§max_line_length: usize§channel_capacity: usize§retry_delay: Option<Duration>§max_retries: Option<usize>§custom_headers: Option<HashMap<String, String>>§request_header_provider: Option<Arc<dyn Fn(&str) -> Option<HeaderMap> + Send + Sync>>Optional hook invoked with the raw JSON-RPC payload of each outgoing POST, returning extra HTTP headers to attach to that single request.
Unlike custom_headers (static, applied to
every request), this enables per-request headers computed from the
message being sent — e.g. SEP-2243 Mcp-Param-* tool-parameter
mirroring, rotating bearer tokens, or distributed-tracing headers.
Trait Implementations§
Source§impl Default for RequestOptions
impl Default for RequestOptions
Source§fn default() -> RequestOptions
fn default() -> RequestOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for RequestOptions
impl !UnwindSafe for RequestOptions
impl Freeze for RequestOptions
impl Send for RequestOptions
impl Sync for RequestOptions
impl Unpin for RequestOptions
impl UnsafeUnpin for RequestOptions
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