pub struct CliStop { /* private fields */ }Expand description
Why a CLI run ends with a given event and exit code instead of its own outcome: an argv rejection, a refused pre-run check, a handler’s projection that cannot proceed, or a defect in how the program read its invocation.
Built from a CliError (the registry’s own usage errors, exit 2), from an
InvocationReadError (cli_invocation_invalid, exit 1), with
CliStop::invalid_argument for a value constraint the registry cannot
express, or from any event and code with CliStop::new.
Implementations§
Source§impl CliStop
impl CliStop
pub fn new(event: Event, exit_code: u8) -> Self
Sourcepub fn invalid_argument(message: &str, hint: &str) -> Self
pub fn invalid_argument(message: &str, hint: &str) -> Self
A value the registry’s types cannot judge — exactly one character, a
well-formed address — refused under the same classification the parser
uses for its own value errors: cli_invalid_argument_value, exit 2.
pub fn event(&self) -> &Event
pub const fn exit_code(&self) -> u8
pub fn into_parts(self) -> (Event, u8)
Trait Implementations§
Source§impl From<InvocationReadError> for CliStop
impl From<InvocationReadError> for CliStop
Source§fn from(error: InvocationReadError) -> Self
fn from(error: InvocationReadError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Forget for CliStop
impl Freeze for CliStopwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Value>: Freeze,
*const LeafNode<String, Value> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, Value)>>: Freeze,
impl Move for CliStop
impl RefUnwindSafe for CliStop
impl Send for CliStop
impl Sync for CliStop
impl Unpin for CliStop
impl UnsafeUnpin for CliStopwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
*const LeafNode<String, Value> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, Value)>>: UnsafeUnpin,
impl UnwindSafe for CliStop
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