pub struct SpawnRow {
pub child_run_id: i64,
pub goal: String,
pub verify_file: String,
pub needle: String,
pub max_steps: Option<u32>,
pub deny_write: String,
}Expand description
A persisted spawned-child contract, enough to rebuild and resume that exact child on a tree resume rather than spawning a duplicate.
use io_harness::Store;
let store = Store::memory()?;
let parent = store.start_run("summarise the repo", "NOTES.md")?;
let child = store.start_child_run("summarise src/", "NOTES.md", parent, 1)?;
store.record_spawn(parent, 4, child, "summarise src/", "NOTES.md", "#", Some(8), "[]")?;
// What a tree resume does with it: the parent replays step 4, looks the spawn
// up by (parent, step, goal), and adopts the child it already made. Without
// this row the replay would spawn a second child and spend the tree's ledger
// twice for one piece of work.
let row = store.find_spawn(parent, 4, "summarise src/")?.expect("recorded above");
assert_eq!(row.child_run_id, child);
assert_eq!(row.max_steps, Some(8));
// The narrowing the parent applied is stored too, so the adopted child resumes
// under the policy it was contained by rather than the parent's wider one.
assert_eq!(row.deny_write, "[]");
// A step that never spawned has no row, which is how a replay tells "already
// done" from "not done yet".
assert!(store.find_spawn(parent, 5, "summarise src/")?.is_none());Fields§
§child_run_id: i64The child run id already allocated for this spawn.
goal: StringThe child’s goal.
verify_file: StringThe workspace-relative file the child’s verification reads.
needle: StringThe substring the child’s verification requires.
max_steps: Option<u32>The child’s step cap, if the parent set one.
deny_write: StringJSON array of deny_write globs the parent narrowed the child with.
Trait Implementations§
impl StructuralPartialEq for SpawnRow
Auto Trait Implementations§
impl Freeze for SpawnRow
impl RefUnwindSafe for SpawnRow
impl Send for SpawnRow
impl Sync for SpawnRow
impl Unpin for SpawnRow
impl UnsafeUnpin for SpawnRow
impl UnwindSafe for SpawnRow
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<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>
Converts
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>
Converts
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.