CliError

Enum CliError 

Source
pub enum CliError<IoErr: Debug> {
    Io(IoErr),
    Node(String),
}
Expand description

Errors surfaced from CliSession::run.

Node flattens any NodeError<…> to a String via format!("{:?}", e) because the underlying error is generic over the MacBackend’s send and capacity error types and exposing it would force the CLI’s error type to inherit those generics. Callers can read the message but cannot react programmatically to specific node-layer failure modes.

TODO: revisit this if a CLI consumer needs to branch on node errors. Options include adding a second generic parameter that carries the underlying NodeError<E, C>, or replacing the loss with a richer enum that mirrors the variants we actually care about at this layer.

Variants§

§

Io(IoErr)

§

Node(String)

Trait Implementations§

Source§

impl<IoErr: Debug + Debug> Debug for CliError<IoErr>

Source§

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

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

impl<IoErr: Debug> From<IoErr> for CliError<IoErr>

Source§

fn from(e: IoErr) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<IoErr> Freeze for CliError<IoErr>
where IoErr: Freeze,

§

impl<IoErr> RefUnwindSafe for CliError<IoErr>
where IoErr: RefUnwindSafe,

§

impl<IoErr> Send for CliError<IoErr>
where IoErr: Send,

§

impl<IoErr> Sync for CliError<IoErr>
where IoErr: Sync,

§

impl<IoErr> Unpin for CliError<IoErr>
where IoErr: Unpin,

§

impl<IoErr> UnwindSafe for CliError<IoErr>
where IoErr: UnwindSafe,

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<!> for T

§

fn from(t: !) -> T

Converts to this type from the input type.
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

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> Same for T

Source§

type Output = T

Should always be Self
§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.