pub struct CallbackDisposition<'a, T> {
pub handler_was_defined: bool,
pub result: Option<T>,
pub event_name: &'a str,
}Expand description
Allows reasoning about the result of a callback to decide how to interpret the result
Fields§
§handler_was_defined: boolIndicates whether the handler was found. If false, then result will also be None. If true and result.is_none(), it indicates that none of the handlers returned a value.
result: Option<T>The result!
event_name: &'a strWhich event was called (or to be called)
Implementations§
Source§impl<'a, T> CallbackDisposition<'a, T>
impl<'a, T> CallbackDisposition<'a, T>
Sourcepub fn require_value(self) -> Result<T>
pub fn require_value(self) -> Result<T>
Requires that a value be returned. Translates the disposition into appropriate error messaging if no value was returned.
Source§impl<'a, T: Default> CallbackDisposition<'a, T>
impl<'a, T: Default> CallbackDisposition<'a, T>
Sourcepub fn or_default(self) -> T
pub fn or_default(self) -> T
Unwraps the value type, or the Default impl if no value was returned
Auto Trait Implementations§
impl<'a, T> Freeze for CallbackDisposition<'a, T>where
T: Freeze,
impl<'a, T> RefUnwindSafe for CallbackDisposition<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for CallbackDisposition<'a, T>where
T: Send,
impl<'a, T> Sync for CallbackDisposition<'a, T>where
T: Sync,
impl<'a, T> Unpin for CallbackDisposition<'a, T>where
T: Unpin,
impl<'a, T> UnwindSafe for CallbackDisposition<'a, 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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more