pub struct ToolProfile(/* private fields */);Expand description
The name of a tool profile, shared by the provider that registers it and the steps that select it.
Declare each profile once as a constant and use that constant on both
sides: HttpAgentProvider::with_tool_profile
and AgentConfig::tool_profile. A
misspelled constant does not compile, where a misspelled string would only
fail the step at run time.
It serializes as its plain name.
§Examples
use ironflow_core::provider::{AgentConfig, ToolProfile};
const BUG: ToolProfile = ToolProfile::new("bug");
let config = AgentConfig::new("Find the root cause").tool_profile(BUG);
assert_eq!(config.tool_profile, Some(BUG));
assert_eq!(BUG.to_string(), "bug");Implementations§
Source§impl ToolProfile
impl ToolProfile
Sourcepub const fn new(name: &'static str) -> ToolProfile
pub const fn new(name: &'static str) -> ToolProfile
Name a tool profile.
§Panics
Panics if name is empty. In a const, that is a compile error.
§Examples
use ironflow_core::provider::ToolProfile;
const SUGGESTION: ToolProfile = ToolProfile::new("suggestion");
assert_eq!(SUGGESTION.as_str(), "suggestion");ⓘ
use ironflow_core::provider::ToolProfile;
let _ = ToolProfile::new("");Trait Implementations§
Source§impl Clone for ToolProfile
impl Clone for ToolProfile
Source§fn clone(&self) -> ToolProfile
fn clone(&self) -> ToolProfile
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 ToolProfile
impl Debug for ToolProfile
Source§impl<'de> Deserialize<'de> for ToolProfile
impl<'de> Deserialize<'de> for ToolProfile
Source§fn deserialize<D>(
deserializer: D,
) -> Result<ToolProfile, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<ToolProfile, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ToolProfile
impl Display for ToolProfile
impl Eq for ToolProfile
Source§impl Hash for ToolProfile
impl Hash for ToolProfile
Source§impl Ord for ToolProfile
impl Ord for ToolProfile
Source§fn cmp(&self, other: &ToolProfile) -> Ordering
fn cmp(&self, other: &ToolProfile) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for ToolProfile
impl PartialEq for ToolProfile
Source§impl PartialOrd for ToolProfile
impl PartialOrd for ToolProfile
Source§impl Serialize for ToolProfile
impl Serialize for ToolProfile
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 ToolProfile
Auto Trait Implementations§
impl Freeze for ToolProfile
impl RefUnwindSafe for ToolProfile
impl Send for ToolProfile
impl Sync for ToolProfile
impl Unpin for ToolProfile
impl UnsafeUnpin for ToolProfile
impl UnwindSafe for ToolProfile
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> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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§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.