pub enum Touches {
Reads(Scope),
Writes(Scope),
Independent,
}Expand description
What a tool call may read and change, so calls that touch different things run side by side.
Variants§
Reads(Scope)
Reads what the scope names and changes nothing: run again after a restart.
Writes(Scope)
Reads and may change what the scope names.
Independent
Changes nothing the other calls of its reply see, such as handing work to another agent. It may read anything, so it waits behind an earlier writer; it is never run again after a restart.
Implementations§
Source§impl Touches
impl Touches
Sourcepub fn conflicts_with(&self, other: &Touches) -> bool
pub fn conflicts_with(&self, other: &Touches) -> bool
Whether a call touching self must not run beside one touching
other: one of them writes what the other reads or writes.
Independent counts as Reads(Anything) here.
Sourcepub fn reads_only(&self) -> bool
pub fn reads_only(&self) -> bool
Whether it only reads: Reads, and nothing else.
Sourcepub fn normalized(self) -> Touches
pub fn normalized(self) -> Touches
The footprint with its scope normalized.
Sourcepub fn from_annotations(annotations: &ToolAnnotations) -> Self
pub fn from_annotations(annotations: &ToolAnnotations) -> Self
From the annotations a tool’s own code declares, such as a
Tool’s: Reads(Anything) when it says it only
reads, else Writes(Anything). For annotations from elsewhere, such
as an MCP server’s, from_hints.
Sourcepub fn from_hints(annotations: &ToolAnnotations) -> Self
pub fn from_hints(annotations: &ToolAnnotations) -> Self
From annotations rig cannot check, such as those an MCP server
sends: a tool that says it only reads is
Independent, so its calls still run beside
readers but are never run again after a restart; any other is
Writes(Anything). Only a local declaration makes a call
Reads.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Touches
impl<'de> Deserialize<'de> for Touches
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Touches
impl StructuralPartialEq for Touches
Auto Trait Implementations§
impl Freeze for Touches
impl RefUnwindSafe for Touches
impl Send for Touches
impl Sync for Touches
impl Unpin for Touches
impl UnsafeUnpin for Touches
impl UnwindSafe for Touches
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
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§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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more