pub enum ReplaceStrategy {
Immediate,
ImmediateForceMiss,
Wait,
}Expand description
Strategy to use to replace the existing object
Variants§
Immediate
Immediately start the replace and do not wait for any other pending requests for the same object, including insert requests.
With this strategy a replace will race all other pending requests to update the object.
The existing object will be accessible until this replace finishes providing the replacement object.
This is the default replace strategy.
ImmediateForceMiss
Immediate, but remove the existing object immediately
Requests for the same object that arrive after this replace starts will wait until this replace starts providing the replacement object.
Wait
Join the wait list behind other pending requests before starting this request.
With this strategy this replace request will wait for an in-progress replace or insert request before starting.
This strategy allows implementing a counter, but may cause timeouts if too many requests are waiting for in-progress and waiting updates to complete.
Trait Implementations§
Source§impl Clone for ReplaceStrategy
impl Clone for ReplaceStrategy
Source§fn clone(&self) -> ReplaceStrategy
fn clone(&self) -> ReplaceStrategy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ReplaceStrategy
impl Debug for ReplaceStrategy
Source§impl Default for ReplaceStrategy
impl Default for ReplaceStrategy
Source§fn default() -> ReplaceStrategy
fn default() -> ReplaceStrategy
Auto Trait Implementations§
impl Freeze for ReplaceStrategy
impl RefUnwindSafe for ReplaceStrategy
impl Send for ReplaceStrategy
impl Sync for ReplaceStrategy
impl Unpin for ReplaceStrategy
impl UnsafeUnpin for ReplaceStrategy
impl UnwindSafe for ReplaceStrategy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more