pub enum ReturnOption<T, E = ()> {
Success(T),
Info(T),
NoData(E),
Error(E),
}Expand description
Holds result and indicates the overall success or failure of a function.
Variants§
Success(T)
The function has been executed successfully. Holds result.
Info(T)
The function has been executed successfully. There have been warnings. Holds result.
NoData(E)
No more data was available
Error(E)
An error occured.
Implementations§
Source§impl<T, E> ReturnOption<T, E>
impl<T, E> ReturnOption<T, E>
Sourcepub fn map<F, U>(self, f: F) -> ReturnOption<U, E>where
F: FnOnce(T) -> U,
pub fn map<F, U>(self, f: F) -> ReturnOption<U, E>where
F: FnOnce(T) -> U,
Maps a ReturnOption<T,E> to ReturnOption<U,E> by applying a function to a contained
Success or Info value, leaving an Error or NoData value untouched.
Trait Implementations§
Auto Trait Implementations§
impl<T, E> Freeze for ReturnOption<T, E>
impl<T, E> RefUnwindSafe for ReturnOption<T, E>where
T: RefUnwindSafe,
E: RefUnwindSafe,
impl<T, E> Send for ReturnOption<T, E>
impl<T, E> Sync for ReturnOption<T, E>
impl<T, E> Unpin for ReturnOption<T, E>
impl<T, E> UnsafeUnpin for ReturnOption<T, E>where
T: UnsafeUnpin,
E: UnsafeUnpin,
impl<T, E> UnwindSafe for ReturnOption<T, E>where
T: UnwindSafe,
E: 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