Struct actix_storage::dev::StorageBuilder[][src]

pub struct StorageBuilder { /* fields omitted */ }

Builder struct for Storage

A provider can either implement ExpiryStore directly, or implement Store and rely on another provider to provide expiration capablities. The builder will polyfill a ExpiryStore by combining an Expiry and a Store itself.

If there is no Expiry set in either of the ways, it will result in runtime errors when calling methods which require that functionality.

Implementations

impl StorageBuilder[src]

#[must_use = "Builder must be used by calling finish"]pub fn store(self, store: impl Store + 'static) -> Self[src]

This method can be used to set a Store, the second call to this method will overwrite the store.

#[must_use = "Builder must be used by calling finish"]pub fn expiry(self, expiry: impl Expiry + 'static) -> Self[src]

This method can be used to set a Expiry, the second call to this method will overwrite the expiry.

The expiry should work on the same storage as the provided store.

#[must_use = "Builder must be used by calling finish"]pub fn expiry_store<T>(self, expiry_store: T) -> Self where
    T: 'static + Store + Expiry + ExpiryStore
[src]

This method can be used to set an ExpiryStore directly, Its error to call expiry or store after calling this method.

#[must_use = "Builder must be used by calling finish"]pub fn format(self, format: Format) -> Self[src]

This method can be used to set the format storage will use for serialization/deserialization, we will use default format if it is not called which can be None if there is no serde feature enabled.

pub fn finish(self) -> Storage[src]

This method should be used after configuring the storage.

Panics

If there is no store provided either by calling expiry_store or store it will panic.

Trait Implementations

impl Default for StorageBuilder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,