Skip to main content

TaskRecord

Trait TaskRecord 

Source
pub trait TaskRecord<Kind> {
    // Required methods
    fn id(&self) -> i64;
    fn kind(&self) -> Kind;
    fn payload_json(&self) -> &str;
    fn result_json(&self) -> Option<&str>;
}
Expand description

Minimal read-only view over a persisted task row.

Product crates implement this for their database model so Forge can decode typed payloads and results without depending on a concrete ORM entity or schema extension columns.

Required Methods§

Source

fn id(&self) -> i64

Stable database identifier used in diagnostics.

Source

fn kind(&self) -> Kind

Product-owned task kind enum.

Source

fn payload_json(&self) -> &str

Stored JSON payload.

Source

fn result_json(&self) -> Option<&str>

Stored JSON result, if the task has completed with one.

Implementors§