MultiTierBuilder

Struct MultiTierBuilder 

Source
pub struct MultiTierBuilder<L1, L2> { /* private fields */ }
Expand description

Builder for configuring a multi-tier backend.

Implementations§

Source§

impl<L1, L2> MultiTierBuilder<L1, L2>

Source

pub fn new() -> Self

Creates a new builder.

Source

pub fn l1(self, backend: L1) -> Self

Sets the L1 (fast) cache backend.

Source

pub fn l2(self, backend: L2) -> Self

Sets the L2 (persistent) cache backend.

Source

pub fn promotion_strategy(self, strategy: PromotionStrategy) -> Self

Sets the promotion strategy.

Source

pub fn promotion_threshold(self, threshold: u64) -> Self

Sets the promotion threshold for hit-count based promotion.

Source

pub fn write_through(self, enabled: bool) -> Self

Enables or disables write-through to L1.

Source

pub fn max_l1_entry_size(self, size: Option<usize>) -> Self

Sets the maximum entry size for L1 cache. Entries larger than this will only be stored in L2.

Source

pub fn build(self) -> MultiTierBackend<L1, L2>

Builds the multi-tier backend.

Trait Implementations§

Source§

impl<L1, L2> Default for MultiTierBuilder<L1, L2>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<L1, L2> Freeze for MultiTierBuilder<L1, L2>
where L1: Freeze, L2: Freeze,

§

impl<L1, L2> RefUnwindSafe for MultiTierBuilder<L1, L2>

§

impl<L1, L2> Send for MultiTierBuilder<L1, L2>
where L1: Send, L2: Send,

§

impl<L1, L2> Sync for MultiTierBuilder<L1, L2>
where L1: Sync, L2: Sync,

§

impl<L1, L2> Unpin for MultiTierBuilder<L1, L2>
where L1: Unpin, L2: Unpin,

§

impl<L1, L2> UnwindSafe for MultiTierBuilder<L1, L2>
where L1: UnwindSafe, L2: UnwindSafe,

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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.