pub struct RunInfo {Show 13 fields
pub run_id: RunId,
pub name: String,
pub component_type: String,
pub input: Value,
pub output: Option<Value>,
pub error: Option<String>,
pub start_time: DateTime<Utc>,
pub end_time: Option<DateTime<Utc>>,
pub duration: Option<Duration>,
pub tags: Vec<String>,
pub metadata: HashMap<String, Value>,
pub parent_run_id: Option<RunId>,
pub child_run_ids: Vec<RunId>,
}
Expand description
Information about a run
Fields§
§run_id: RunId
The run ID
name: String
The name of the component being run
component_type: String
The type of the component
input: Value
Input to the component
output: Option<Value>
Output from the component (if completed)
error: Option<String>
Error that occurred (if any)
start_time: DateTime<Utc>
Start time of the run
end_time: Option<DateTime<Utc>>
End time of the run (if completed)
duration: Option<Duration>
Duration of the run (if completed)
Tags associated with the run
metadata: HashMap<String, Value>
Metadata associated with the run
parent_run_id: Option<RunId>
Parent run ID (if this is a sub-run)
child_run_ids: Vec<RunId>
Child run IDs
Implementations§
Source§impl RunInfo
impl RunInfo
Sourcepub fn new(
run_id: RunId,
name: impl Into<String>,
component_type: impl Into<String>,
input: Value,
) -> Self
pub fn new( run_id: RunId, name: impl Into<String>, component_type: impl Into<String>, input: Value, ) -> Self
Create a new run info
Sourcepub fn complete_with_output(self, output: Value) -> Self
pub fn complete_with_output(self, output: Value) -> Self
Mark the run as completed with output
Sourcepub fn complete_with_error(self, error: impl Into<String>) -> Self
pub fn complete_with_error(self, error: impl Into<String>) -> Self
Mark the run as failed with error
Sourcepub fn add_metadata(self, key: impl Into<String>, value: Value) -> Self
pub fn add_metadata(self, key: impl Into<String>, value: Value) -> Self
Add metadata to the run
Sourcepub fn with_parent(self, parent_run_id: RunId) -> Self
pub fn with_parent(self, parent_run_id: RunId) -> Self
Set the parent run ID
Sourcepub fn is_completed(&self) -> bool
pub fn is_completed(&self) -> bool
Check if the run is completed
Sourcepub fn is_successful(&self) -> bool
pub fn is_successful(&self) -> bool
Check if the run succeeded
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RunInfo
impl<'de> Deserialize<'de> for RunInfo
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 Serializable for RunInfo
impl Serializable for RunInfo
Source§fn is_serializable() -> bool
fn is_serializable() -> bool
Check if this object is serializable Read more
Source§fn to_json_pretty(&self) -> Result<String>
fn to_json_pretty(&self) -> Result<String>
Serialize this object to a pretty-printed JSON string
Source§fn to_dict(&self) -> Result<HashMap<String, Value>>
fn to_dict(&self) -> Result<HashMap<String, Value>>
Serialize this object to a dictionary (HashMap)
impl StructuralPartialEq for RunInfo
Auto Trait Implementations§
impl Freeze for RunInfo
impl RefUnwindSafe for RunInfo
impl Send for RunInfo
impl Sync for RunInfo
impl Unpin for RunInfo
impl UnwindSafe for RunInfo
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