pub enum Effect {
Read,
Idempotent,
Write,
}Expand description
The side-effect classification a tool declares, re-exported from
salvor_core so a tool author needs only this crate. Both the hand-written
ToolMeta::EFFECT and the Tool derive name it through here.
How a tool call may be retried and how it behaves on replay.
Effect classification does not change one thing: on replay, any completed recorded call is read from the log and never re-executed, regardless of its effect class. A completion is immutable history.
Effect classification governs calls that were not completed, the gap between an intent recorded in the log and a completion that never arrived:
Effect::Readcalls re-execute freely.Effect::Idempotentcalls retry with the same idempotency key.Effect::Writecalls are never automatically retried and surface for human reconciliation.
Serializes lowercase ("read", "idempotent", "write"), because the
wire form is part of the durable event contract.
This type lives in salvor-core because events reference it;
salvor-tools consumes it when it defines tool contracts.
Variants§
Read
A call with no side effects. If it was not completed, it re-executes freely, because running it again observes state without changing it.
Idempotent
A call safe to repeat under the same idempotency key. If it was not completed, it retries with that same key, so the provider collapses duplicate attempts into one effect.
Write
A call that changes external state and is not safe to repeat blindly. If it was not completed, it is never automatically retried: a crash between the recorded intent and a completion surfaces for human reconciliation rather than a guess about whether the write landed.
Trait Implementations§
impl Copy for Effect
Source§impl<'de> Deserialize<'de> for Effect
impl<'de> Deserialize<'de> for Effect
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Effect, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Effect, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for Effect
Source§impl Serialize for Effect
impl Serialize for Effect
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,
impl StructuralPartialEq for Effect
Auto Trait Implementations§
impl Freeze for Effect
impl RefUnwindSafe for Effect
impl Send for Effect
impl Sync for Effect
impl Unpin for Effect
impl UnsafeUnpin for Effect
impl UnwindSafe for Effect
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
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§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
key and return true if they are equal.