Skip to main content

ReturnOption

Enum ReturnOption 

Source
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>

Source

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§

Source§

impl<T: Debug, E: Debug> Debug for ReturnOption<T, E>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<SQLRETURN> for ReturnOption<()>

Source§

fn from(source: SQLRETURN) -> ReturnOption<()>

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<T, E> Freeze for ReturnOption<T, E>
where T: Freeze, E: Freeze,

§

impl<T, E> RefUnwindSafe for ReturnOption<T, E>

§

impl<T, E> Send for ReturnOption<T, E>
where T: Send, E: Send,

§

impl<T, E> Sync for ReturnOption<T, E>
where T: Sync, E: Sync,

§

impl<T, E> Unpin for ReturnOption<T, E>
where T: Unpin, E: Unpin,

§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.