#[non_exhaustive]pub enum DropPolicy {
MayDropContents,
MustNotDropContents,
}Expand description
Determines what happens when a pool is dropped when there are still objects in that pool.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
MayDropContents
The pool will drop any objects within when the pool is dropped. This is the default.
MustNotDropContents
The pool will panic if it still contains objects when it is dropped.
This may be valuable if there are external requirements before the objects can be dropped. For example, it may be known that unsafe code is used to create out of band references to the objects, with objects only removed after such references have been dropped.
Trait Implementations§
Source§impl Clone for DropPolicy
impl Clone for DropPolicy
Source§fn clone(&self) -> DropPolicy
fn clone(&self) -> DropPolicy
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DropPolicy
impl Debug for DropPolicy
Source§impl Default for DropPolicy
impl Default for DropPolicy
Source§fn default() -> DropPolicy
fn default() -> DropPolicy
Returns the “default value” for a type. Read more
Source§impl PartialEq for DropPolicy
impl PartialEq for DropPolicy
impl Copy for DropPolicy
impl Eq for DropPolicy
impl StructuralPartialEq for DropPolicy
Auto Trait Implementations§
impl Freeze for DropPolicy
impl RefUnwindSafe for DropPolicy
impl Send for DropPolicy
impl Sync for DropPolicy
impl Unpin for DropPolicy
impl UnwindSafe for DropPolicy
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