Skip to main content

AttemptRecord

Struct AttemptRecord 

Source
pub struct AttemptRecord {
Show 13 fields pub id: Uuid, pub timestamp: DateTime<Utc>, pub cmd: String, pub cwd: String, pub session_id: String, pub tag: Option<String>, pub source_client: String, pub machine_id: Option<String>, pub hostname: Option<String>, pub executable: Option<String>, pub format_hint: Option<String>, pub metadata: HashMap<String, Value>, pub date: NaiveDate,
}
Expand description

An attempt record (the start of a command execution).

This represents the “attempt” to run a command - recorded at invocation start. The outcome (completion) is recorded separately in OutcomeRecord.

Fields§

§id: Uuid

Unique identifier (UUIDv7 for time-ordering).

§timestamp: DateTime<Utc>

When the attempt started.

§cmd: String

The full command string.

§cwd: String

Working directory when invocation was executed.

§session_id: String

Session identifier (groups related invocations).

§tag: Option<String>

User-defined tag (unique alias for this invocation, like git tags).

§source_client: String

Client identifier (user@hostname or application name).

§machine_id: Option<String>

Machine identifier (for multi-machine setups).

§hostname: Option<String>

Hostname where invocation was executed.

§executable: Option<String>

Extracted executable name (e.g., “make” from “make test”).

§format_hint: Option<String>

Detected output format (e.g., “gcc”, “pytest”).

§metadata: HashMap<String, Value>

Extensible metadata (user-defined key-value pairs). Stored as MAP(VARCHAR, JSON) in DuckDB.

§date: NaiveDate

Date for partitioning.

Implementations§

Source§

impl AttemptRecord

Source

pub fn new( session_id: impl Into<String>, cmd: impl Into<String>, cwd: impl Into<String>, source_client: impl Into<String>, ) -> Self

Create a new attempt record.

If BIRD_INVOCATION_UUID is set in the environment, uses that UUID to enable deduplication across nested BIRD clients.

Source

pub fn with_id( id: Uuid, session_id: impl Into<String>, cmd: impl Into<String>, cwd: impl Into<String>, source_client: impl Into<String>, ) -> Self

Create an attempt record with an explicit UUID.

Source

pub fn with_tag(self, tag: impl Into<String>) -> Self

Set the tag (unique alias for this invocation).

Source

pub fn with_machine_id(self, machine_id: impl Into<String>) -> Self

Set the machine ID.

Source

pub fn with_format_hint(self, hint: impl Into<String>) -> Self

Set the format hint.

Source

pub fn with_metadata(self, key: impl Into<String>, value: Value) -> Self

Add metadata entry.

Source

pub fn date(&self) -> NaiveDate

Get the date portion of the timestamp (for partitioning).

Trait Implementations§

Source§

impl Clone for AttemptRecord

Source§

fn clone(&self) -> AttemptRecord

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AttemptRecord

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for AttemptRecord

Source§

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 Serialize for AttemptRecord

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,