pub trait FileFence: Send + Sync {
// Required methods
fn observed<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
path: &'life1 str,
bytes: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait;
fn begin_write<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn FileWriteGuard>, String>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
// Provided methods
fn claim_delivery<'life0, 'life1, 'async_trait>(
&'life0 self,
_subject: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), DeliveredArtifact>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait { ... }
fn release_delivery<'life0, 'life1, 'async_trait>(
&'life0 self,
_subject: &'life1 str,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait { ... }
fn declare_deliverable<'life0, 'async_trait>(
&'life0 self,
deliverable: Deliverable,
) -> Pin<Box<dyn Future<Output = DeliveryPlan> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait { ... }
}Expand description
Handed to a file tool by a host whose agents share a workspace. Without one the tool behaves as it would alone.
Required Methods§
Sourcefn observed<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
path: &'life1 str,
bytes: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn observed<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
path: &'life1 str,
bytes: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
The call read these exact bytes of path.
Sourcefn begin_write<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn FileWriteGuard>, String>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn begin_write<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn FileWriteGuard>, String>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Hold path for this write, or say why the write must not happen.
Taken before the tool reads the file it is about to change, and held
until the write has landed.
Provided Methods§
Sourcefn claim_delivery<'life0, 'life1, 'async_trait>(
&'life0 self,
_subject: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), DeliveredArtifact>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn claim_delivery<'life0, 'life1, 'async_trait>(
&'life0 self,
_subject: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), DeliveredArtifact>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Claim the delivery to the owner of the artifact subject names (a
page’s screenshot names the page) for this call. One request’s agents
deliver each artifact once: whoever delivers it first owns it, and a
later claim gets who did and when. Release a claim whose delivery
then failed (Self::release_delivery).
Sourcefn release_delivery<'life0, 'life1, 'async_trait>(
&'life0 self,
_subject: &'life1 str,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn release_delivery<'life0, 'life1, 'async_trait>(
&'life0 self,
_subject: &'life1 str,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Give back a claim whose delivery did not happen.
Sourcefn declare_deliverable<'life0, 'async_trait>(
&'life0 self,
deliverable: Deliverable,
) -> Pin<Box<dyn Future<Output = DeliveryPlan> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn declare_deliverable<'life0, 'async_trait>(
&'life0 self,
deliverable: Deliverable,
) -> Pin<Box<dyn Future<Output = DeliveryPlan> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
The call declares deliverable for the owner. A helper’s run keeps
it on its record and sends it once, when the run ends: the last one
of each kind it declared, so a capture taken before the work was
done is replaced by the final one, never sent beside it. Anyone
else’s (the turn’s own agent, a host with no run record) is sent now
by the caller, under Self::claim_delivery.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".