pub struct InputContext {
pub server_name: Option<String>,
pub tool_name: Option<String>,
pub metadata: HashMap<String, String>,
}Expand description
输入上下文 / Input context
Fields§
§server_name: Option<String>服务器名称 / Server name
tool_name: Option<String>工具名称 / Tool name
metadata: HashMap<String, String>额外元数据 / Additional metadata
Implementations§
Source§impl InputContext
impl InputContext
Sourcepub fn with_server_name(self, name: String) -> Self
pub fn with_server_name(self, name: String) -> Self
设置服务器名称 / Set server name
Sourcepub fn with_tool_name(self, name: String) -> Self
pub fn with_tool_name(self, name: String) -> Self
设置工具名称 / Set tool name
Sourcepub fn with_metadata(self, key: String, value: String) -> Self
pub fn with_metadata(self, key: String, value: String) -> Self
添加元数据 / Add metadata
Trait Implementations§
Source§impl Clone for InputContext
impl Clone for InputContext
Source§fn clone(&self) -> InputContext
fn clone(&self) -> InputContext
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 moreSource§impl Debug for InputContext
impl Debug for InputContext
Auto Trait Implementations§
impl Freeze for InputContext
impl RefUnwindSafe for InputContext
impl Send for InputContext
impl Sync for InputContext
impl Unpin for InputContext
impl UnsafeUnpin for InputContext
impl UnwindSafe for InputContext
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 moreSource§impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
type Error = <Target as OctetsFrom<Source>>::Error
Source§fn try_octets_into(
self,
) -> Result<Target, <Source as OctetsInto<Target>>::Error>
fn try_octets_into( self, ) -> Result<Target, <Source as OctetsInto<Target>>::Error>
Performs the conversion.
Source§fn octets_into(self) -> Target
fn octets_into(self) -> Target
Performs an infallible conversion.