[−][src]Struct with_drop::WithDrop
Container that holds a value and a customestructor
Implementations
impl<T, F: FnOnce(T)> WithDrop<T, F>
[src]
pub fn new(inner: T, drop_fn: F) -> Self
[src]
pub fn into_inner(self) -> T
[src]
This extracts the contained value while dropping the closure and the container.
The custom closure will not be executed.
Trait Implementations
impl<T: Clone, F: Clone + FnOnce(T)> Clone for WithDrop<T, F>
[src]
fn clone(&self) -> WithDrop<T, F>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Debug, F: Debug + FnOnce(T)> Debug for WithDrop<T, F>
[src]
impl<T, F: FnOnce(T)> Deref for WithDrop<T, F>
[src]
impl<T, F: FnOnce(T)> DerefMut for WithDrop<T, F>
[src]
impl<T, F: FnOnce(T)> Drop for WithDrop<T, F>
[src]
impl<T: Eq, F: Eq + FnOnce(T)> Eq for WithDrop<T, F>
[src]
impl<T: Ord, F: Ord + FnOnce(T)> Ord for WithDrop<T, F>
[src]
fn cmp(&self, other: &WithDrop<T, F>) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<T: PartialEq<T>, F1: FnOnce(T), F2: FnOnce(T)> PartialEq<WithDrop<T, F2>> for WithDrop<T, F1>
[src]
fn eq(&self, other: &WithDrop<T, F2>) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<T: PartialOrd<T>, F1: FnOnce(T), F2: FnOnce(T)> PartialOrd<WithDrop<T, F2>> for WithDrop<T, F1>
[src]
fn partial_cmp(&self, other: &WithDrop<T, F2>) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<T, F: FnOnce(T)> StructuralEq for WithDrop<T, F>
[src]
Auto Trait Implementations
impl<T, F> Send for WithDrop<T, F> where
F: Send,
T: Send,
F: Send,
T: Send,
impl<T, F> Sync for WithDrop<T, F> where
F: Sync,
T: Sync,
F: Sync,
T: Sync,
impl<T, F> Unpin for WithDrop<T, F> where
F: Unpin,
T: Unpin,
F: Unpin,
T: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,