diff options
author | Jesse Luehrs <doy@tozt.net> | 2019-10-25 07:56:20 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2019-10-25 08:45:29 -0400 |
commit | 37e6d9c37b2d8e49103ef61f0127bc8b15a51530 (patch) | |
tree | cc657348d837a553cb302ee7aac2ac3f4ee24b23 | |
parent | 00135aa2171f0ba2b46023239fea7f7eb83057ba (diff) | |
download | ttyrec-37e6d9c37b2d8e49103ef61f0127bc8b15a51530.tar.gz ttyrec-37e6d9c37b2d8e49103ef61f0127bc8b15a51530.zip |
add some derivations
-rw-r--r-- | src/creator.rs | 1 | ||||
-rw-r--r-- | src/frame.rs | 1 | ||||
-rw-r--r-- | src/parser.rs | 2 |
3 files changed, 4 insertions, 0 deletions
diff --git a/src/creator.rs b/src/creator.rs index 02d0c12..e4a377a 100644 --- a/src/creator.rs +++ b/src/creator.rs @@ -1,5 +1,6 @@ use std::convert::TryFrom as _; +#[derive(Debug, Clone)] pub struct Creator { base_time: Option<std::time::Instant>, } diff --git a/src/frame.rs b/src/frame.rs index f4e8099..4b72378 100644 --- a/src/frame.rs +++ b/src/frame.rs @@ -1,3 +1,4 @@ +#[derive(Debug, Clone, PartialEq, Eq)] pub struct Frame { pub time: std::time::Duration, pub data: Vec<u8>, diff --git a/src/parser.rs b/src/parser.rs index 89c88ab..2118095 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -1,4 +1,5 @@ #[repr(packed)] +#[derive(Debug, Clone, Copy)] struct Header { secs: u32, micros: u32, @@ -17,6 +18,7 @@ impl Header { } } +#[derive(Debug, Clone)] pub struct Parser { reading: std::collections::VecDeque<u8>, read_state: Option<Header>, |