Skip to content

Instantly share code, notes, and snippets.

@tailhook
Created January 2, 2016 22:55
Show Gist options
  • Select an option

  • Save tailhook/0abbd4fe1826e715316c to your computer and use it in GitHub Desktop.

Select an option

Save tailhook/0abbd4fe1826e715316c to your computer and use it in GitHub Desktop.
pub trait Machine<C>: Sized {
type Seed: Any+Sized;
fn create(seed: Self::Seed, scope: &mut Scope<C>)
-> Result<Self, Box<Error>>;
fn ready(self, events: EventSet, scope: &mut Scope<C>)
-> Response<Self, Self::Seed>;
fn spawned(self, scope: &mut Scope<C>)
-> Response<Self, Self::Seed>;
fn spawn_error(self, _scope: &mut Scope<C>, error: Box<Error>)
-> Option<Self>;
fn timeout(self, scope: &mut Scope<C>) -> Response<Self, Self::Seed>;
fn wakeup(self, scope: &mut Scope<C>) -> Response<Self, Self::Seed>;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment