Struct augrim::IntoAlgorithm

source ·
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>,

§

type Event = E

The event type representing all valid events for the algorithm.
§

type Action = A

The action type representing all valid actions returned by the algorithm.
§

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>

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

Maps the inputs and output of algorithm into alternate types. Read more

Auto Trait Implementations§

§

impl<T, E, A, C> RefUnwindSafe for IntoAlgorithm<T, E, A, C>

§

impl<T, E, A, C> Send for IntoAlgorithm<T, E, A, C>
where A: Send, C: Send, E: Send, T: Send,

§

impl<T, E, A, C> Sync for IntoAlgorithm<T, E, A, C>
where A: Sync, C: Sync, E: Sync, T: Sync,

§

impl<T, E, A, C> Unpin for IntoAlgorithm<T, E, A, C>
where A: Unpin, C: Unpin, E: Unpin, T: Unpin,

§

impl<T, E, A, C> UnwindSafe for IntoAlgorithm<T, E, A, C>

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

§

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

§

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.