[−][src]Enum doublysure::AreYouSure
A type that asks the user the all important question: Are you sure you want to do this?
The functions on this type are intentionally verbose so that users understand that they are confirming a potentially destructive action.
Variants
A value that will be returned when yes_i_am_sure()
is called.
A function that was deferred and will be run later when
yes_i_am_sure()
is called.
Implementations
impl<T> AreYouSure<T>
[src]
pub fn new(val: T) -> Self
[src]
Creates a new AreYouSure
wrapping around a value.
This is the same as AreYouSure::Value()
.
The make_sure
macro is the preferred way of creating an AreYouSure
.
pub fn yes_i_am_sure(self) -> T
[src]
You are, in fact, sure that you want to do this.
Returns the inner value, or runs the deferred function and returns whatever it does.
pub fn no_i_am_not_sure(self)
[src]
You're not actually sure you want to do this.
This will discard the AreYouSure
dropping it's value and will not run
deferred functions.
Auto Trait Implementations
impl<T> !RefUnwindSafe for AreYouSure<T>
impl<T> !Send for AreYouSure<T>
impl<T> !Sync for AreYouSure<T>
impl<T> Unpin for AreYouSure<T> where
T: Unpin,
T: Unpin,
impl<T> !UnwindSafe for AreYouSure<T>
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>,