pub struct TreeBuilder<V, E, F> { /* private fields */ }Expand description
A builder for creating expiring trees.
This allows setting expiration duration and whether to extend the duration of a value on fetch or update.
Implementations§
Source§impl<V, E, F> ExpiringTreeBuilder<V, E, F>
impl<V, E, F> ExpiringTreeBuilder<V, E, F>
Sourcepub fn extend_on_update(&mut self) -> &mut Self
pub fn extend_on_update(&mut self) -> &mut Self
Create a tree that extends the duration of a record when that record is updated
Sourcepub fn extend_on_fetch(&mut self) -> &mut Self
pub fn extend_on_fetch(&mut self) -> &mut Self
Create a tree that extends the duration of a record when that record is fetched
Sourcepub fn expiration_length(&mut self, expiration_length: Duration) -> &mut Self
pub fn expiration_length(&mut self, expiration_length: Duration) -> &mut Self
Create a tree with a custom record duration
Sourcepub fn build(&self) -> Result<ExpiringTree<V, E, F>>
pub fn build(&self) -> Result<ExpiringTree<V, E, F>>
Create the tree
Auto Trait Implementations§
impl<V, E, F> Freeze for ExpiringTreeBuilder<V, E, F>
impl<V, E, F> !RefUnwindSafe for ExpiringTreeBuilder<V, E, F>
impl<V, E, F> Send for ExpiringTreeBuilder<V, E, F>
impl<V, E, F> Sync for ExpiringTreeBuilder<V, E, F>
impl<V, E, F> Unpin for ExpiringTreeBuilder<V, E, F>
impl<V, E, F> !UnwindSafe for ExpiringTreeBuilder<V, E, F>
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