pub struct InvocationRecord {Show 13 fields
pub id: Uuid,
pub session_id: String,
pub timestamp: DateTime<Utc>,
pub duration_ms: Option<i64>,
pub cwd: String,
pub cmd: String,
pub executable: Option<String>,
pub exit_code: i32,
pub format_hint: Option<String>,
pub client_id: String,
pub hostname: Option<String>,
pub username: Option<String>,
pub tag: Option<String>,
}Expand description
An invocation record (a captured command/process execution).
Fields§
§id: UuidUnique identifier (UUIDv7 for time-ordering).
session_id: StringSession identifier (groups related invocations).
timestamp: DateTime<Utc>When the invocation started.
duration_ms: Option<i64>How long the invocation took in milliseconds.
cwd: StringWorking directory when invocation was executed.
cmd: StringThe full command string.
executable: Option<String>Extracted executable name (e.g., “make” from “make test”).
exit_code: i32Exit code.
format_hint: Option<String>Detected output format (e.g., “gcc”, “pytest”).
client_id: StringClient identifier (user@hostname).
hostname: Option<String>Hostname where invocation was executed.
username: Option<String>Username who executed the invocation.
tag: Option<String>User-defined tag (unique alias for this invocation, like git tags).
Implementations§
Source§impl InvocationRecord
impl InvocationRecord
Sourcepub fn new(
session_id: impl Into<String>,
cmd: impl Into<String>,
cwd: impl Into<String>,
exit_code: i32,
client_id: impl Into<String>,
) -> Self
pub fn new( session_id: impl Into<String>, cmd: impl Into<String>, cwd: impl Into<String>, exit_code: i32, client_id: impl Into<String>, ) -> Self
Create a new invocation record.
If BIRD_INVOCATION_UUID is set in the environment, uses that UUID
to enable deduplication across nested BIRD clients.
Sourcepub fn with_id(
id: Uuid,
session_id: impl Into<String>,
cmd: impl Into<String>,
cwd: impl Into<String>,
exit_code: i32,
client_id: impl Into<String>,
) -> Self
pub fn with_id( id: Uuid, session_id: impl Into<String>, cmd: impl Into<String>, cwd: impl Into<String>, exit_code: i32, client_id: impl Into<String>, ) -> Self
Create a new invocation record with an explicit UUID.
Use this when you need to control the UUID (e.g., for testing or when the UUID is provided externally).
Sourcepub fn is_inherited() -> bool
pub fn is_inherited() -> bool
Check if this invocation was inherited from a parent BIRD client.
Sourcepub fn parent_client() -> Option<String>
pub fn parent_client() -> Option<String>
Get the parent BIRD client name, if any.
Sourcepub fn with_duration(self, duration_ms: i64) -> Self
pub fn with_duration(self, duration_ms: i64) -> Self
Set the duration.
Sourcepub fn with_format_hint(self, hint: impl Into<String>) -> Self
pub fn with_format_hint(self, hint: impl Into<String>) -> Self
Set the format hint.
Trait Implementations§
Source§impl Clone for InvocationRecord
impl Clone for InvocationRecord
Source§fn clone(&self) -> InvocationRecord
fn clone(&self) -> InvocationRecord
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more