atuin/src/local/history.rs

26 lines
510 B
Rust
Raw Normal View History

use chrono;
2021-02-13 10:02:52 -07:00
use uuid::Uuid;
#[derive(Debug)]
pub struct History {
2021-02-13 10:02:52 -07:00
pub id: String,
pub timestamp: i64,
2021-02-13 10:02:52 -07:00
pub duration: i64,
pub exit: i64,
pub command: String,
pub cwd: String,
}
impl History {
2021-02-13 12:37:00 -07:00
pub fn new(timestamp: i64, command: String, cwd: String, exit: i64, duration: i64) -> History {
History {
2021-02-13 10:02:52 -07:00
id: Uuid::new_v4().to_simple().to_string(),
2021-02-13 12:37:00 -07:00
timestamp,
command,
cwd,
2021-02-13 10:02:52 -07:00
exit,
duration,
}
}
}