Skip to content

Commit

Permalink
Derive common traits for scalar enums and newtypes
Browse files Browse the repository at this point in the history
  • Loading branch information
aldanor authored Mar 17, 2017
1 parent 92b6b81 commit 2378d81
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ impl<'a> Into<Device> for &'a str {
///
/// As an example, `Linktype(1)` is ethernet. A full list of linktypes is available
/// [here](http://www.tcpdump.org/linktypes.html).
#[derive(Debug, PartialEq, Eq)]
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub struct Linktype(pub i32);

impl Linktype {
Expand Down Expand Up @@ -287,6 +287,7 @@ pub struct Stat {
pub if_dropped: u32
}

#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub enum Precision {
Micro,
Nano,
Expand Down Expand Up @@ -453,6 +454,7 @@ impl Capture<Offline> {
}
}

#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub enum TstampType {
Host,
HostLowPrec,
Expand All @@ -461,6 +463,7 @@ pub enum TstampType {
AdapterUnsynced,
}

#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub enum Direction {
InOut,
In,
Expand Down

0 comments on commit 2378d81

Please sign in to comment.