pub struct StorageBuilder { /* private fields */ }Expand description
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§
Source§impl StorageBuilder
impl StorageBuilder
Sourcepub fn store(self, store: impl Store + 'static) -> Self
pub fn store(self, store: impl Store + 'static) -> Self
This method can be used to set a Store, the second call to this
method will overwrite the store.
Sourcepub fn expiry(self, expiry: impl Expiry + 'static) -> Self
pub fn expiry(self, expiry: impl Expiry + 'static) -> Self
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.
Sourcepub fn expiry_store<T>(self, expiry_store: T) -> Self
pub fn expiry_store<T>(self, expiry_store: T) -> Self
This method can be used to set an ExpiryStore directly,
Its error to call expiry or store after calling this method.