Skip to content

Instantly share code, notes, and snippets.

@chrivers
Created September 28, 2016 21:07
Show Gist options
  • Save chrivers/e2fbd2c2140254f4c2ae350fa40c8d51 to your computer and use it in GitHub Desktop.
Save chrivers/e2fbd2c2140254f4c2ae350fa40c8d51 to your computer and use it in GitHub Desktop.
enum_from_primitive! {
#[derive(Debug,Clone,Copy)]
pub enum AlertStatus
{
Normal = 0x00,
RedAlert = 0x01,
}
}
enum_to_primitive!(AlertStatus);
enum_from_primitive! {
#[derive(Debug,Clone,Copy)]
pub enum AudioCommand
{
Play = 0x00,
Dismiss = 0x01,
}
}
enum_to_primitive!(AudioCommand);
enum_from_primitive! {
#[derive(Debug,Clone,Copy,PartialEq)]
pub enum AudioMode
{
Playing = 0x01,
Incoming = 0x02,
}
}
enum_to_primitive!(AudioMode);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment