pub struct RunTerminalProjection {
pub status: RunStatus,
pub output_preview: Option<String>,
pub error: Option<RunTerminalError>,
}Expand description
Atomic terminal status, output, and diagnostic projection.
Fields§
§status: RunStatusTerminal durable status.
output_preview: Option<String>User-visible final output preview, not an error transport.
error: Option<RunTerminalError>Safe terminal diagnostic.
Implementations§
Source§impl RunTerminalProjection
impl RunTerminalProjection
Sourcepub fn try_new(
status: RunStatus,
output_preview: Option<String>,
error: Option<RunTerminalError>,
) -> Result<Self, RunTerminalProjectionError>
pub fn try_new( status: RunStatus, output_preview: Option<String>, error: Option<RunTerminalError>, ) -> Result<Self, RunTerminalProjectionError>
Build and validate a terminal projection.
§Errors
Returns an error for a non-terminal status, a failed status without a diagnostic, a completed status with a diagnostic, or an empty diagnostic field.
Sourcepub const fn completed(output_preview: Option<String>) -> Self
pub const fn completed(output_preview: Option<String>) -> Self
Build a successful terminal projection.
Sourcepub const fn failed(error: RunTerminalError) -> Self
pub const fn failed(error: RunTerminalError) -> Self
Build a failed terminal projection with no output preview.
Sourcepub const fn cancelled(error: Option<RunTerminalError>) -> Self
pub const fn cancelled(error: Option<RunTerminalError>) -> Self
Build a cancelled terminal projection with an optional safe reason.
Sourcepub fn validate(&self) -> Result<(), RunTerminalProjectionError>
pub fn validate(&self) -> Result<(), RunTerminalProjectionError>
Validate the projection as a new terminal write.
Historical records may lack a diagnostic. Stores validate this invariant only when terminalizing a non-terminal record, while preserving already-committed legacy evidence.
§Errors
Returns an error when the projection violates terminal status or diagnostic invariants.
Trait Implementations§
Source§impl Clone for RunTerminalProjection
impl Clone for RunTerminalProjection
Source§fn clone(&self) -> RunTerminalProjection
fn clone(&self) -> RunTerminalProjection
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more