pub struct CacheBuilder { /* private fields */ }Expand description
Represents the base builder for a Cache instance.
It can injected by the framework during the configuration phase of the policy lifecycle:
launcher: Launcher,
Configuration(configuration): Configuration,
cache_builder: CacheBuilder,
) -> Result<()> { ... }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
impl FromContext<ConfigureContext> for CacheBuilder
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