#[non_exhaustive]pub enum ToolKind {
Function,
Dynamic,
ProviderDefined {
id: String,
args: JsonObject,
},
ProviderExecuted {
id: String,
args: JsonObject,
supports_deferred_results: bool,
},
}Expand description
Who defines and who executes a tool.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Function
Application-defined schema, executed by the application (with an execute function) or by the caller (without one).
Dynamic
Defined at runtime (MCP and similar); input and output are untyped.
ProviderDefined
Schema defined by the provider, executed by the application.
Fields
§
args: JsonObjectProvider-specific configuration.
ProviderExecuted
Defined and executed by the provider.
Implementations§
Source§impl ToolKind
impl ToolKind
Sourcepub fn is_provider(&self) -> bool
pub fn is_provider(&self) -> bool
Returns true for provider-defined and provider-executed tools.
Sourcepub fn is_provider_executed(&self) -> bool
pub fn is_provider_executed(&self) -> bool
Returns true when the provider executes the tool.
Sourcepub fn is_dynamic(&self) -> bool
pub fn is_dynamic(&self) -> bool
Returns true for dynamic tools.
Sourcepub fn provider_id(&self) -> Option<&str>
pub fn provider_id(&self) -> Option<&str>
The provider tool id, for provider tools.
Trait Implementations§
impl Eq for ToolKind
impl StructuralPartialEq for ToolKind
Auto Trait Implementations§
impl Freeze for ToolKind
impl RefUnwindSafe for ToolKind
impl Send for ToolKind
impl Sync for ToolKind
impl Unpin for ToolKind
impl UnsafeUnpin for ToolKind
impl UnwindSafe for ToolKind
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.