pub struct CommandRecord {
pub id: Option<i64>,
pub command: String,
pub timestamp: DateTime<Utc>,
pub exit_code: i32,
pub duration_ms: i64,
pub working_dir: String,
pub category: String,
pub usage_count: i32,
pub last_used: DateTime<Utc>,
}Expand description
Represents a single command execution record
Fields§
§id: Option<i64>Unique identifier (database primary key)
command: StringThe command text as executed
timestamp: DateTime<Utc>When the command was executed
exit_code: i32Exit code (0 = success, non-zero = failure)
duration_ms: i64How long the command took to execute (milliseconds)
working_dir: StringWorking directory where command was executed
category: StringAutomatically assigned category (git, docker, etc.)
usage_count: i32Number of times this command has been executed
last_used: DateTime<Utc>Timestamp of most recent execution
Implementations§
Source§impl CommandRecord
impl CommandRecord
Sourcepub fn new(
command: String,
timestamp: DateTime<Utc>,
exit_code: i32,
duration_ms: i64,
working_dir: String,
category: String,
) -> Self
pub fn new( command: String, timestamp: DateTime<Utc>, exit_code: i32, duration_ms: i64, working_dir: String, category: String, ) -> Self
Create a new command record (before database insertion)
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Check if the command was successful (exit code 0)
Sourcepub fn status_symbol(&self) -> &str
pub fn status_symbol(&self) -> &str
Get a display-friendly status indicator
Sourcepub fn duration_display(&self) -> String
pub fn duration_display(&self) -> String
Format duration for human-readable display
Trait Implementations§
Source§impl Clone for CommandRecord
impl Clone for CommandRecord
Source§fn clone(&self) -> CommandRecord
fn clone(&self) -> CommandRecord
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CommandRecord
impl Debug for CommandRecord
Source§impl<'de> Deserialize<'de> for CommandRecord
impl<'de> Deserialize<'de> for CommandRecord
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for CommandRecord
impl PartialEq for CommandRecord
Source§impl Serialize for CommandRecord
impl Serialize for CommandRecord
impl StructuralPartialEq for CommandRecord
Auto Trait Implementations§
impl Freeze for CommandRecord
impl RefUnwindSafe for CommandRecord
impl Send for CommandRecord
impl Sync for CommandRecord
impl Unpin for CommandRecord
impl UnsafeUnpin for CommandRecord
impl UnwindSafe for CommandRecord
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more