pub struct ToolSource {
pub namespace: ToolNamespace,
pub raw_name: String,
pub display_name: String,
pub trust: ToolTrustLevel,
pub metadata: BTreeMap<String, Value>,
}Expand description
Host-facing metadata describing where a provider-visible tool came from.
Fields§
§namespace: ToolNamespaceSource namespace.
raw_name: StringRaw source name before provider-facing disambiguation.
display_name: StringProvider-facing display name registered in ToolRegistry.
trust: ToolTrustLevelSource trust level.
metadata: BTreeMap<String, Value>Host/application metadata.
Implementations§
Source§impl ToolSource
impl ToolSource
Sourcepub fn new(
namespace: ToolNamespace,
raw_name: impl Into<String>,
display_name: impl Into<String>,
) -> ToolSource
pub fn new( namespace: ToolNamespace, raw_name: impl Into<String>, display_name: impl Into<String>, ) -> ToolSource
Constructs source metadata with external trust by default.
Sourcepub fn local(name: impl Into<String>) -> ToolSource
pub fn local(name: impl Into<String>) -> ToolSource
Constructs source metadata for a local application tool.
Sourcepub fn with_trust(self, trust: ToolTrustLevel) -> ToolSource
pub fn with_trust(self, trust: ToolTrustLevel) -> ToolSource
Sets the trust level.
Sourcepub fn with_metadata(self, metadata: BTreeMap<String, Value>) -> ToolSource
pub fn with_metadata(self, metadata: BTreeMap<String, Value>) -> ToolSource
Sets source metadata.
Trait Implementations§
Source§impl Clone for ToolSource
impl Clone for ToolSource
Source§fn clone(&self) -> ToolSource
fn clone(&self) -> ToolSource
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ToolSource
impl Debug for ToolSource
Source§impl<'de> Deserialize<'de> for ToolSource
impl<'de> Deserialize<'de> for ToolSource
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ToolSource, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ToolSource, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ToolSource
Source§impl PartialEq for ToolSource
impl PartialEq for ToolSource
Source§impl Serialize for ToolSource
impl Serialize for ToolSource
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
impl StructuralPartialEq for ToolSource
Auto Trait Implementations§
impl Freeze for ToolSource
impl RefUnwindSafe for ToolSource
impl Send for ToolSource
impl Sync for ToolSource
impl Unpin for ToolSource
impl UnsafeUnpin for ToolSource
impl UnwindSafe for ToolSource
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.