pub trait AltDispatch<'a, Brand: Kind_cdc7cd43dac7585f, A: 'a + Clone, Marker> {
// Required method
fn dispatch(
self,
other: Self,
) -> <Brand as Kind_cdc7cd43dac7585f>::Of<'a, A>;
}Expand description
Required Methods§
Sourcefn dispatch(self, other: Self) -> <Brand as Kind_cdc7cd43dac7585f>::Of<'a, A>
fn dispatch(self, other: Self) -> <Brand as Kind_cdc7cd43dac7585f>::Of<'a, A>
Perform the dispatched alt operation.
§Type Signature
(self, Self) -> Brand A
§Parameters
self: The container implementing this dispatch.other: The other container to combine with.
§Returns
A new container from the combination of both inputs.
§Examples
use fp_library::{
brands::*,
functions::explicit::*,
};
let result = alt::<OptionBrand, _, _, _>(None, Some(5));
assert_eq!(result, Some(5));Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
impl<'a, Brand, A> AltDispatch<'a, Brand, A, Ref> for &<Brand as Kind_cdc7cd43dac7585f>::Of<'a, A>
Routes borrowed containers to RefAlt::ref_alt.
§Type Parameters
'a: The lifetime of the values.Brand: The brand of the functor.A: The type of the value(s) inside the functor.
impl<'a, Brand, A> AltDispatch<'a, Brand, A, Val> for <Brand as Kind_cdc7cd43dac7585f>::Of<'a, A>
Routes owned containers to Alt::alt.
§Type Parameters
'a: The lifetime of the values.Brand: The brand of the functor.A: The type of the value(s) inside the functor.