pub struct PruneQuery {
pub status: EffectStatus,
pub older_than: Duration,
pub now: SystemTime,
pub limit: usize,
}Expand description
Which records EffectStore::prune deletes: those in a settled
status that last changed at least older_than before now and hold no
live lease at now.
The age is a duration, not a cutoff time, so a store that reads its own clock (like PostgreSQL’s) can apply it to that clock.
Fields§
§status: EffectStatusThe status to prune. Must be settled.
older_than: DurationThe minimum time since the record’s last transition (updated_at).
now: SystemTimeThe current time.
limit: usizeAt most this many records.
Implementations§
Source§impl PruneQuery
impl PruneQuery
Sourcepub const DEFAULT_LIMIT: usize = 500
pub const DEFAULT_LIMIT: usize = 500
The default batch size.
Sourcepub fn new(status: EffectStatus, older_than: Duration, now: SystemTime) -> Self
pub fn new(status: EffectStatus, older_than: Duration, now: SystemTime) -> Self
Records in status settled at least older_than before now.
Sourcepub fn cutoff(&self) -> Option<SystemTime>
pub fn cutoff(&self) -> Option<SystemTime>
The latest updated_at a record may have to be pruned, or None if
that time cannot be represented (nothing is that old).
Sourcepub fn matches(&self, record: &EffectRecord) -> bool
pub fn matches(&self, record: &EffectRecord) -> bool
Whether record should be pruned (ignoring limit).
Trait Implementations§
Source§impl Clone for PruneQuery
impl Clone for PruneQuery
Source§impl Debug for PruneQuery
impl Debug for PruneQuery
impl Eq for PruneQuery
Source§impl PartialEq for PruneQuery
impl PartialEq for PruneQuery
impl StructuralPartialEq for PruneQuery
Auto Trait Implementations§
impl Freeze for PruneQuery
impl RefUnwindSafe for PruneQuery
impl Send for PruneQuery
impl Sync for PruneQuery
impl Unpin for PruneQuery
impl UnsafeUnpin for PruneQuery
impl UnwindSafe for PruneQuery
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