pub struct Command {
pub id: Option<i64>,
pub command: String,
pub timestamp: DateTime<Utc>,
pub directory: String,
pub tags: Vec<String>,
pub parameters: Vec<Parameter>,
}
Expand description
Represents a command with its metadata.
A command includes the actual command string, execution directory, timestamp, tags, and parameters.
§Example
use command_vault::db::models::Command;
use chrono::Utc;
let cmd = Command {
id: None,
command: "git push origin main".to_string(),
timestamp: Utc::now(),
directory: "/project".to_string(),
tags: vec!["git".to_string()],
parameters: vec![],
};
Fields§
§id: Option<i64>
Unique identifier for the command
command: String
The actual command string
timestamp: DateTime<Utc>
When the command was created or last modified
directory: String
Directory where the command should be executed
Tags associated with the command
parameters: Vec<Parameter>
Parameters that can be substituted in the command
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Command
impl<'de> Deserialize<'de> for Command
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
Auto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnwindSafe for Command
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more