Struct TreeBuilder

Source
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>
where E: Encoding<HashSet<IVec>> + Encoding<DateTime<Utc>> + 'static, F: Encoding<V> + 'static,

Source

pub fn extend_on_update(&mut self) -> &mut Self

Create a tree that extends the duration of a record when that record is updated

Source

pub fn extend_on_fetch(&mut self) -> &mut Self

Create a tree that extends the duration of a record when that record is fetched

Source

pub fn expiration_length(&mut self, expiration_length: Duration) -> &mut Self

Create a tree with a custom record duration

Source

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>
where V: Send, E: Send, F: Send,

§

impl<V, E, F> Sync for ExpiringTreeBuilder<V, E, F>
where V: Sync, E: Sync, F: Sync,

§

impl<V, E, F> Unpin for ExpiringTreeBuilder<V, E, F>
where V: Unpin, E: Unpin, F: Unpin,

§

impl<V, E, F> !UnwindSafe for ExpiringTreeBuilder<V, E, F>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.