pub struct AgingManager { /* private fields */ }Expand description
Manager for proxy aging lifecycle.
Implementations§
Source§impl AgingManager
impl AgingManager
Sourcepub fn new(policy: AgingPolicy) -> Self
pub fn new(policy: AgingPolicy) -> Self
Create a new aging manager with the given policy.
Sourcepub fn add_record(&mut self, record: ProxyRecord)
pub fn add_record(&mut self, record: ProxyRecord)
Add a proxy record.
Sourcepub fn get_record(&self, id: &str) -> Option<&ProxyRecord>
pub fn get_record(&self, id: &str) -> Option<&ProxyRecord>
Get a record by ID.
Sourcepub fn record_access(&mut self, id: &str, day: u64) -> bool
pub fn record_access(&mut self, id: &str, day: u64) -> bool
Record an access event for a proxy.
Sourcepub fn record_count(&self) -> usize
pub fn record_count(&self) -> usize
Total number of managed records.
Sourcepub fn total_size_bytes(&self) -> u64
pub fn total_size_bytes(&self) -> u64
Total size of all managed proxies in bytes.
Sourcepub fn sweep(&mut self, current_day: u64) -> AgingSweepResult
pub fn sweep(&mut self, current_day: u64) -> AgingSweepResult
Run an aging sweep for the given current day.
Sourcepub fn records_in_stage(&self, stage: ProxyStage) -> Vec<&ProxyRecord>
pub fn records_in_stage(&self, stage: ProxyStage) -> Vec<&ProxyRecord>
Get all records in a specific stage.
Auto Trait Implementations§
impl Freeze for AgingManager
impl RefUnwindSafe for AgingManager
impl Send for AgingManager
impl Sync for AgingManager
impl Unpin for AgingManager
impl UnsafeUnpin for AgingManager
impl UnwindSafe for AgingManager
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
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 more