Trait breadthread::Controller[][src]

pub trait Controller {
    type Directive: Directive;
    type DirectiveAdaptor: DirectiveAdaptor<Self::Directive> + Send + 'static;
    type Error: Debug;
    type Event;
    type Pointers: IntoIterator<Item = AddOrRemovePtr>;
    fn directive_adaptor(&self) -> Self::DirectiveAdaptor;
fn loop_cycle(
        &self
    ) -> Result<LoopCycle<Self::Event, Self::Directive>, Self::Error>;
fn process_directive<C: Completer>(
        &self,
        directive: Self::Directive,
        completer: &mut C
    ) -> Self::Pointers; }
Expand description

This object dictates what the BreadThread will do, exactly.

Associated Types

The type representing a directive for this controller. Essentially, this represents something that tells the controller what to do.

The type representing a thread-safe handle to this controller’s event mechanism.

The error type of the loop cycle.

The type representing an event that may be produced by the loop cycle.

The collection type used to tell how we should add or remove pointers.

If the iterator’s size is not exact, it may cause panics down the line.

Required methods

Get a directive adaptor.

Run an event loop cycle. Do not process any directives during this time.

Process a directive and send the result down a Sender. Returns the list of pointers to add or remove from the verified pointers list.

Since this may be used re-entrantly, it has to be immutable.

Implementors