pub struct FileStopper {
pub path: PathBuf,
}Expand description
Stop the optimisation loop when a sentinel file appears on disk.
This is useful for graceful shutdown via an external process or script: touching the sentinel file causes the engine to stop at the next iteration boundary, after which the current state is serialised normally.
§Example
use gepa::utils::stop_condition::FileStopper;
let stopper = FileStopper::new("/tmp/stop_gepa");Fields§
§path: PathBufPath of the sentinel file to watch.
Implementations§
Trait Implementations§
Source§impl<Id: DataId> StopCondition<Id> for FileStopper
impl<Id: DataId> StopCondition<Id> for FileStopper
Source§fn should_stop(&self, _state: &GEPAState<Id>) -> bool
fn should_stop(&self, _state: &GEPAState<Id>) -> bool
Evaluate the stop condition against the current state. Read more
Source§fn description(&self) -> String
fn description(&self) -> String
Human-readable description of this condition (used in log messages).
Auto Trait Implementations§
impl Freeze for FileStopper
impl RefUnwindSafe for FileStopper
impl Send for FileStopper
impl Sync for FileStopper
impl Unpin for FileStopper
impl UnsafeUnpin for FileStopper
impl UnwindSafe for FileStopper
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