pub struct CacheBuilder { /* private fields */ }Expand description
Represents the base builder for a Cache instance.
Implementations§
Source§impl CacheBuilder
impl CacheBuilder
Sourcepub fn new(&self, cache_id: String) -> CacheBuilderInstance
pub fn new(&self, cache_id: String) -> CacheBuilderInstance
Returns a CacheBuilderInstance with an ID to uniquely identify the cache.
Note: if 2 caches are assigned the same ID in a same policy, they will share the state. This behavior is extended to other policies when using the shared cache option.
Trait Implementations§
Source§impl FromContext<ConfigureContext> for CacheBuilder
CacheBuilder can be injected in your configuration function.
impl FromContext<ConfigureContext> for CacheBuilder
CacheBuilder can be injected in your configuration function.
#[entrypoint]
async fn configure(
launcher: Launcher,
cache_builder: CacheBuilder,
Configuration(configuration): Configuration,
) -> anyhow::Result<()> {
// configure the cache here.
}type Error = Infallible
fn from_context(context: &ConfigureContext) -> Result<Self, Self::Error>
fn from_context_always(context: &C) -> Selfwhere
Self: FromContext<C, E, Error = Infallible>,
Auto Trait Implementations§
impl !RefUnwindSafe for CacheBuilder
impl !Send for CacheBuilder
impl !Sync for CacheBuilder
impl !UnwindSafe for CacheBuilder
impl Freeze for CacheBuilder
impl Unpin for CacheBuilder
impl UnsafeUnpin for CacheBuilder
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