Skip to main content

Terminal

Struct Terminal 

Source
pub struct Terminal { /* private fields */ }
Expand description

Immutable terminal fact shared by every waiter.

outcome is four words wide, so on its own it does not say much: if it is Outcome::Failed, the reason is one call away. failure_kind is the matchable classification and failure is the error itself, whose source chain reaches the concrete provider or hook error underneath.

if terminal.outcome() == lifecycle::Outcome::Failed {
    // Never report `Failed` on its own: these two say what happened.
    format!(
        "failed ({:?}): {}",
        terminal.failure_kind(),
        terminal.failure().map_or_else(|| "no detail".to_owned(), ToString::to_string),
    )
} else {
    format!("{:?}", terminal.outcome())
}

Implementations§

Source§

impl Terminal

Source

pub const fn outcome(&self) -> Outcome

Returns the authoritative portable outcome.

Source

pub const fn coord(&self) -> &Coord

Returns the Run coordinate.

Source

pub const fn stop_code(&self) -> Option<&StopCode>

Returns an explicit hook stop code when one ended the Run.

Source

pub fn failure(&self) -> Option<&(dyn Error + Send + Sync + 'static)>

Returns execution failure detail for a failed Run.

Some exactly when outcome is Failed. Its Display is already the complete rendered reason, stage and payload together — reef renders each failure where it is latched, because the crate-private stage error cannot outlive the Run and a classification alone does not diagnose anything. source is therefore for inspecting the failure rather than for re-rendering it: it reaches an underlying model-client, hook, transcript, or other error that caused the Run to fail. A nonfatal tool::ProviderError does not appear here; obtain it from the outward event’s as_error accessor. A chain walk that concatenates every link will see the tail of the first message repeated, which is why this is worth stating.

Source

pub const fn failure_kind(&self) -> Option<FailureKind>

Returns the portable classification of a failed Run.

Trait Implementations§

Source§

impl Debug for Terminal

Source§

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

States how the Run ended, rendering the failure through Display.

The failure is an arbitrary third-party error whose Debug this crate neither writes nor reviews; Display is the operator diagnostic the type is contracted to produce, so that is what a terminal reports.

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.