pub enum SideEffect {
Read,
Write,
Idempotent,
Destructive,
External,
Expensive,
Network,
}Expand description
Standard side-effect categories for an agent tool.
String form matches the Python sibling library:
"read", "write", "idempotent", "destructive", "external",
"expensive", "network".
Variants§
Read
Reads data. No state mutation. Safe to parallelize and retry.
Write
Mutates internal state. Not parallel-safe by default.
Idempotent
Repeated calls with the same args produce the same effect. Retry-safe.
Destructive
Removes or invalidates state (delete, drop, purge). Never auto-retry.
External
Touches a third-party system (email, payments, webhooks). Not
retry-safe without SideEffect::Idempotent.
Expensive
High cost (tokens, money, time). Caller may want extra confirmation.
Network
Makes a network call. Subject to retryable transient errors.
Implementations§
Trait Implementations§
Source§impl Clone for SideEffect
impl Clone for SideEffect
Source§fn clone(&self) -> SideEffect
fn clone(&self) -> SideEffect
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 SideEffect
impl Debug for SideEffect
Source§impl Display for SideEffect
impl Display for SideEffect
Source§impl FromIterator<SideEffect> for SideEffects
impl FromIterator<SideEffect> for SideEffects
Source§fn from_iter<I: IntoIterator<Item = SideEffect>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = SideEffect>>(iter: I) -> Self
Creates a value from an iterator. Read more
Source§impl FromStr for SideEffect
impl FromStr for SideEffect
Source§impl Hash for SideEffect
impl Hash for SideEffect
Source§impl PartialEq for SideEffect
impl PartialEq for SideEffect
Source§fn eq(&self, other: &SideEffect) -> bool
fn eq(&self, other: &SideEffect) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for SideEffect
impl Eq for SideEffect
impl StructuralPartialEq for SideEffect
Auto Trait Implementations§
impl Freeze for SideEffect
impl RefUnwindSafe for SideEffect
impl Send for SideEffect
impl Sync for SideEffect
impl Unpin for SideEffect
impl UnsafeUnpin for SideEffect
impl UnwindSafe for SideEffect
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