pub trait PersistentDetector: Detector {
// Required methods
fn load<R: Read>(&mut self, reader: R) -> Result<(), Box<dyn Error>>;
fn save<W: Write>(&self, writer: W) -> Result<(), Box<dyn Error>>;
}
Expand description
Trait for objects that can be persisted to and loaded from storage
Loads the detector from the provided reader.
reader - The reader to load the detector from.
A Result containing an error string if loading fails, or Ok if loading succeeds.
Saves the detector to the provided writer.
writer - The writer to save the detector to.
A Result containing an error string if saving fails, or Ok if saving succeeds.