pub struct RepeatableTryDropAdapter<T: PureTryDrop> {
pub inner: T,
/* private fields */
}Expand description
This type is an adapter for types which implement TryDrop which allow their
TryDrop::try_drop functions to be repeated multiple times.
Fields§
§inner: TThe inner value.
Implementations§
Source§impl<T: PureTryDrop> RepeatableTryDropAdapter<T>
impl<T: PureTryDrop> RepeatableTryDropAdapter<T>
Source§impl<T: PureTryDrop> RepeatableTryDropAdapter<T>
impl<T: PureTryDrop> RepeatableTryDropAdapter<T>
Sourcepub fn with_panic_on_double_drop(this: Self, panic_on_double_drop: bool) -> Self
pub fn with_panic_on_double_drop(this: Self, panic_on_double_drop: bool) -> Self
Choose whether or not to panic when the RepeatableTryDropAdapter is dropped twice or
multiple times.
Sourcepub fn dropped(this: &Self) -> bool
pub fn dropped(this: &Self) -> bool
Check whether or not this object has it’s destructor called.
Sourcepub fn panic_on_double_drop(this: &Self) -> bool
pub fn panic_on_double_drop(this: &Self) -> bool
Check whether or not this object will panic when dropped twice or multiple times.
Trait Implementations§
Source§impl<T: PureTryDrop> AsMut<T> for RepeatableTryDropAdapter<T>
impl<T: PureTryDrop> AsMut<T> for RepeatableTryDropAdapter<T>
Source§impl<T: PureTryDrop> AsRef<T> for RepeatableTryDropAdapter<T>
impl<T: PureTryDrop> AsRef<T> for RepeatableTryDropAdapter<T>
Source§impl<T: PureTryDrop> Borrow<T> for RepeatableTryDropAdapter<T>
impl<T: PureTryDrop> Borrow<T> for RepeatableTryDropAdapter<T>
Source§impl<T: PureTryDrop> BorrowMut<T> for RepeatableTryDropAdapter<T>
impl<T: PureTryDrop> BorrowMut<T> for RepeatableTryDropAdapter<T>
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T: Clone + PureTryDrop> Clone for RepeatableTryDropAdapter<T>
impl<T: Clone + PureTryDrop> Clone for RepeatableTryDropAdapter<T>
Source§fn clone(&self) -> RepeatableTryDropAdapter<T>
fn clone(&self) -> RepeatableTryDropAdapter<T>
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<T: Debug + PureTryDrop> Debug for RepeatableTryDropAdapter<T>
impl<T: Debug + PureTryDrop> Debug for RepeatableTryDropAdapter<T>
Source§impl<T: PureTryDrop + Default> Default for RepeatableTryDropAdapter<T>
impl<T: PureTryDrop + Default> Default for RepeatableTryDropAdapter<T>
Source§impl<T: PureTryDrop> Deref for RepeatableTryDropAdapter<T>
impl<T: PureTryDrop> Deref for RepeatableTryDropAdapter<T>
Source§impl<T: PureTryDrop> DerefMut for RepeatableTryDropAdapter<T>
impl<T: PureTryDrop> DerefMut for RepeatableTryDropAdapter<T>
Source§impl<T: Hash + PureTryDrop> Hash for RepeatableTryDropAdapter<T>
impl<T: Hash + PureTryDrop> Hash for RepeatableTryDropAdapter<T>
Source§impl<T: Ord + PureTryDrop> Ord for RepeatableTryDropAdapter<T>
impl<T: Ord + PureTryDrop> Ord for RepeatableTryDropAdapter<T>
Source§fn cmp(&self, other: &RepeatableTryDropAdapter<T>) -> Ordering
fn cmp(&self, other: &RepeatableTryDropAdapter<T>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T: PartialEq + PureTryDrop> PartialEq for RepeatableTryDropAdapter<T>
impl<T: PartialEq + PureTryDrop> PartialEq for RepeatableTryDropAdapter<T>
Source§impl<T: PartialOrd + PureTryDrop> PartialOrd for RepeatableTryDropAdapter<T>
impl<T: PartialOrd + PureTryDrop> PartialOrd for RepeatableTryDropAdapter<T>
Source§impl<T: PureTryDrop> PureTryDrop for RepeatableTryDropAdapter<T>
impl<T: PureTryDrop> PureTryDrop for RepeatableTryDropAdapter<T>
Source§type Error = <T as PureTryDrop>::Error
type Error = <T as PureTryDrop>::Error
The type of the error that may occur during drop.
Source§type FallbackTryDropStrategy = <T as PureTryDrop>::FallbackTryDropStrategy
type FallbackTryDropStrategy = <T as PureTryDrop>::FallbackTryDropStrategy
The type which will be used if the drop strategy fails.
Source§type TryDropStrategy = <T as PureTryDrop>::TryDropStrategy
type TryDropStrategy = <T as PureTryDrop>::TryDropStrategy
The type which will be used if dropping fails.
Source§fn fallback_try_drop_strategy(&self) -> &Self::FallbackTryDropStrategy
fn fallback_try_drop_strategy(&self) -> &Self::FallbackTryDropStrategy
Get a reference to the fallback try drop strategy.
Source§fn try_drop_strategy(&self) -> &Self::TryDropStrategy
fn try_drop_strategy(&self) -> &Self::TryDropStrategy
Get a reference to the try drop strategy.
Source§unsafe fn try_drop(&mut self) -> Result<(), Self::Error>
unsafe fn try_drop(&mut self) -> Result<(), Self::Error>
Execute the fallible destructor for this type. This function is unsafe because if this is
called outside of a
Drop::drop context, once the scope of the object implementing trait
ends, this function will be called twice, potentially resulting in a double-free. Read moreSource§impl<T: PureTryDrop> RepeatableTryDrop for RepeatableTryDropAdapter<T>
impl<T: PureTryDrop> RepeatableTryDrop for RepeatableTryDropAdapter<T>
impl<T: Copy + PureTryDrop> Copy for RepeatableTryDropAdapter<T>
impl<T: Eq + PureTryDrop> Eq for RepeatableTryDropAdapter<T>
impl<T: PureTryDrop> StructuralPartialEq for RepeatableTryDropAdapter<T>
Auto Trait Implementations§
impl<T> Freeze for RepeatableTryDropAdapter<T>where
T: Freeze,
impl<T> RefUnwindSafe for RepeatableTryDropAdapter<T>where
T: RefUnwindSafe,
impl<T> Send for RepeatableTryDropAdapter<T>where
T: Send,
impl<T> Sync for RepeatableTryDropAdapter<T>where
T: Sync,
impl<T> Unpin for RepeatableTryDropAdapter<T>where
T: Unpin,
impl<T> UnwindSafe for RepeatableTryDropAdapter<T>where
T: UnwindSafe,
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
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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.