Skip to content

Instantly share code, notes, and snippets.

@waterlink
Created November 4, 2014 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save waterlink/6178e31276676b6e3412 to your computer and use it in GitHub Desktop.
Save waterlink/6178e31276676b6e3412 to your computer and use it in GitHub Desktop.
Rust: Clone, Show, Send & friends
// Clone - for cloning non-owned resources to
// make actions that require ownership
// over them
// Show - if you ever want to log the value of
// this enum
// Send - if you ever want to send it over
// channel to a different task
// PartialEq - if you want to check if two instances
// of this enum are the same
#[deriving(Clone, Show, Send, PartialEq)]
enum Command < T: Clone + Show + Send + Message > {
Peek(Option < uint >),
PeekResult(Option < T >),
Push(T),
Clear,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment