pub struct ParkWriter { /* private fields */ }Expand description
Writes emitted parks to disk. A replace park (a stronger close pair — same layer)
reuses the previous index and overwrites, so the timelapse keeps exactly one frame
per park; latest_park.jpg is updated atomically (temp + rename) so a polling
dashboard never reads a half-written file.
Implementations§
Source§impl ParkWriter
impl ParkWriter
pub fn new(out_dir: PathBuf) -> Self
Sourcepub fn emitted(&self) -> u64
pub fn emitted(&self) -> u64
Number of distinct park frames written so far (a replace doesn’t increment it).
Sourcepub fn write(&mut self, park: &Park, ring_jpeg: &Path) -> Result<ParkWritten>
pub fn write(&mut self, park: &Park, ring_jpeg: &Path) -> Result<ParkWritten>
Copy ring_jpeg to latest_park.jpg (atomic) and park_NNNNNN.jpg, and append a
line to parks.jsonl. Returns the index written and whether it REPLACED the
previous park (a stronger close pair, same layer — overwritten, not a new frame).
Auto Trait Implementations§
impl Freeze for ParkWriter
impl RefUnwindSafe for ParkWriter
impl Send for ParkWriter
impl Sync for ParkWriter
impl Unpin for ParkWriter
impl UnsafeUnpin for ParkWriter
impl UnwindSafe for ParkWriter
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