pub struct ToolMetadata {
pub category: Option<String>,
pub tags: Vec<String>,
pub is_dangerous: bool,
pub requires_network: bool,
pub requires_filesystem: bool,
pub custom: HashMap<String, Value>,
}Expand description
工具元数据
Fields§
§category: Option<String>工具分类
工具标签
is_dangerous: bool是否为危险操作
requires_network: bool是否需要网络
requires_filesystem: bool是否需要文件系统访问
custom: HashMap<String, Value>自定义属性
Implementations§
Source§impl ToolMetadata
impl ToolMetadata
Sourcepub fn new() -> ToolMetadata
pub fn new() -> ToolMetadata
创建新的元数据
Sourcepub fn with_category(self, category: impl Into<String>) -> ToolMetadata
pub fn with_category(self, category: impl Into<String>) -> ToolMetadata
设置分类
Sourcepub fn with_tag(self, tag: impl Into<String>) -> ToolMetadata
pub fn with_tag(self, tag: impl Into<String>) -> ToolMetadata
添加标签
Sourcepub fn dangerous(self) -> ToolMetadata
pub fn dangerous(self) -> ToolMetadata
标记为危险操作
Sourcepub fn needs_network(self) -> ToolMetadata
pub fn needs_network(self) -> ToolMetadata
标记需要网络
Sourcepub fn needs_filesystem(self) -> ToolMetadata
pub fn needs_filesystem(self) -> ToolMetadata
标记需要文件系统
Trait Implementations§
Source§impl Clone for ToolMetadata
impl Clone for ToolMetadata
Source§fn clone(&self) -> ToolMetadata
fn clone(&self) -> ToolMetadata
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 ToolMetadata
impl Debug for ToolMetadata
Source§impl Default for ToolMetadata
impl Default for ToolMetadata
Source§fn default() -> ToolMetadata
fn default() -> ToolMetadata
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ToolMetadata
impl<'de> Deserialize<'de> for ToolMetadata
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ToolMetadata, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ToolMetadata, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for ToolMetadata
impl Serialize for ToolMetadata
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for ToolMetadata
impl RefUnwindSafe for ToolMetadata
impl Send for ToolMetadata
impl Sync for ToolMetadata
impl Unpin for ToolMetadata
impl UnsafeUnpin for ToolMetadata
impl UnwindSafe for ToolMetadata
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<T> Message for T
impl<T> Message for T
Source§fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
Convert a BoxedMessage to this concrete type
Source§fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
Convert this message to a BoxedMessage