pub struct Options {Show 13 fields
pub name: String,
pub version: String,
pub versions: Vec<String>,
pub instructions: String,
pub addr: String,
pub json_response: bool,
pub stateless: bool,
pub bearer_tokens: Vec<String>,
pub session_timeout: Duration,
pub cors_origins: Vec<String>,
pub defaults: HashMap<String, String>,
pub response_headers: Vec<(String, String)>,
pub no_server_meta: bool,
/* private fields */
}Expand description
Options 配置 MCP 前端。零值服务 SDK 已知的全部协议版本。
Fields§
§name: String服务器实现名与版本。默认:二进制名与 “0.0.0”。
version: String§versions: Vec<String>钉定协议版本子集(DEFAULT_VERSIONS 的子集);顺序即协商偏好序。 空 = 全集。
instructions: String初始化后展示给客户端的说明。
addr: Stringsse/http 传输的监听地址。默认 “:8080”。
json_response: boolstreamable HTTP 以 application/json 而非 text/event-stream 应答 (调试友好)。
stateless: bool开启 streamable HTTP 无状态模式(SEP-2567)。
bearer_tokens: Vec<String>http 传输的 Bearer 校验(stdio 是本地进程,不受影响)。空 = 不校验。
session_timeout: Durationstreamable HTTP 空闲会话过期。
cors_origins: Vec<String>http 传输的 CORS 白名单。
defaults: HashMap<String, String>通道级默认参数(–default k=v):调用未显式提供时补上。
response_headers: Vec<(String, String)>附加到结果 _meta.xyz.headers 的自定义静态头(spec §12.8,对齐 HTTP 的 Config.ResponseHeaders / –xyz.header)。
no_server_meta: bool关闭结果 _meta.xyz 的服务器上下文(spec §12.8 的单一开关, 对齐 –xyz.no-server-headers)。
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Options
impl RefUnwindSafe for Options
impl Send for Options
impl Sync for Options
impl Unpin for Options
impl UnsafeUnpin for Options
impl UnwindSafe for Options
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more