pub struct IntoAlgorithm<T, E, A, C> { /* private fields */ }
Expand description
An algorithm that wraps an algorithm of another type.
This struct
is returned by the Algorithm::into_algorithm
method.
Trait Implementations§
Source§impl<T, E, A, C> Algorithm for IntoAlgorithm<T, E, A, C>where
T: Algorithm,
<T as Algorithm>::Event: TryFrom<E, Error = InternalError>,
A: TryFrom<<T as Algorithm>::Action, Error = InternalError>,
<T as Algorithm>::Context: TryFrom<C, Error = InternalError>,
impl<T, E, A, C> Algorithm for IntoAlgorithm<T, E, A, C>where
T: Algorithm,
<T as Algorithm>::Event: TryFrom<E, Error = InternalError>,
A: TryFrom<<T as Algorithm>::Action, Error = InternalError>,
<T as Algorithm>::Context: TryFrom<C, Error = InternalError>,
Source§type Context = C
type Context = C
The context type representing all algorithm-specific state which must be stored.
Source§fn event(
&self,
event: Self::Event,
context: Self::Context,
) -> Result<Vec<Self::Action>, AlgorithmError>
fn event( &self, event: Self::Event, context: Self::Context, ) -> Result<Vec<Self::Action>, AlgorithmError>
Process an event with a given context, producing a list of actions.
Source§fn into_algorithm<E, A, C>(self) -> IntoAlgorithm<Self, E, A, C>where
Self: Sized,
Self::Event: TryFrom<E, Error = InternalError>,
A: TryFrom<Self::Action, Error = InternalError>,
Self::Context: TryFrom<C, Error = InternalError>,
fn into_algorithm<E, A, C>(self) -> IntoAlgorithm<Self, E, A, C>where
Self: Sized,
Self::Event: TryFrom<E, Error = InternalError>,
A: TryFrom<Self::Action, Error = InternalError>,
Self::Context: TryFrom<C, Error = InternalError>,
Maps the inputs and output of algorithm into alternate types. Read more
Auto Trait Implementations§
impl<T, E, A, C> Freeze for IntoAlgorithm<T, E, A, C>where
T: Freeze,
impl<T, E, A, C> RefUnwindSafe for IntoAlgorithm<T, E, A, C>
impl<T, E, A, C> Send for IntoAlgorithm<T, E, A, C>
impl<T, E, A, C> Sync for IntoAlgorithm<T, E, A, C>
impl<T, E, A, C> Unpin for IntoAlgorithm<T, E, A, C>
impl<T, E, A, C> UnwindSafe for IntoAlgorithm<T, E, A, C>
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