pub enum Preview<V> {
Discard,
Keep,
New(V),
}
Expand description
The preview of an interactive insertion. It is used by the
insert_with
method and it is the return value
of the closure passed to the method.
Variants
Discard
Tells the Map
to discard the currently generated value.
After this return value, the insertion is probably canceled and it
fails. However, concurrent accesses to the Map
may
cause the conditions to be tested again.
Keep
Tells the Map
to keep the currently generated value. If
there was no generated value, this has the same effect as
Preview::Discard
.
New(V)
Tells the `Map to use this value instead of the previously generated (if any).
Trait Implementations
sourceimpl<V: PartialEq> PartialEq<Preview<V>> for Preview<V>
impl<V: PartialEq> PartialEq<Preview<V>> for Preview<V>
impl<V: Copy> Copy for Preview<V>
impl<V: Eq> Eq for Preview<V>
impl<V> StructuralEq for Preview<V>
impl<V> StructuralPartialEq for Preview<V>
Auto Trait Implementations
impl<V> RefUnwindSafe for Preview<V>where
V: RefUnwindSafe,
impl<V> Send for Preview<V>where
V: Send,
impl<V> Sync for Preview<V>where
V: Sync,
impl<V> Unpin for Preview<V>where
V: Unpin,
impl<V> UnwindSafe for Preview<V>where
V: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more