pub enum Disposition {
Success,
AcceptedUnvalidated,
WarnUnvalidated,
RejectUnvalidated,
}Expand description
What main should do with a finished command.
Variants§
Success
Print stdout, say nothing on stderr, exit 0.
AcceptedUnvalidated
Print stdout, print a one-line note on stderr, exit 0. (--offline)
WarnUnvalidated
Print stdout, print the banner on stderr, exit 3. (default)
RejectUnvalidated
Suppress stdout, print the banner on stderr, exit 1. (--require-live)
Implementations§
Source§impl Disposition
impl Disposition
Sourcepub fn prints_stdout(self) -> bool
pub fn prints_stdout(self) -> bool
Whether the command’s stdout should be printed at all.
Only --require-live withholds it: the user asked for verified data, so
handing them unverified data would be the same bug in a quieter form.
Whether the framed stderr banner should be emitted.
Sourcepub fn prints_note(self) -> bool
pub fn prints_note(self) -> bool
Whether the short --offline acknowledgement should be emitted.
Sourcepub fn exit_code(self) -> u8
pub fn exit_code(self) -> u8
Process exit status.
3 is a new code, deliberately outside the documented 0/1/2 range rather
than folded into it: the command did run and its stdout is printed,
so it is not the runtime failure 1 means, and it is certainly not a
usage error. A script that only tests -ne 0 treats it as failure
(which is the point); one that wants the old behaviour opts in with
--offline.
Trait Implementations§
Source§impl Clone for Disposition
impl Clone for Disposition
Source§fn clone(&self) -> Disposition
fn clone(&self) -> Disposition
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for Disposition
Source§impl Debug for Disposition
impl Debug for Disposition
impl Eq for Disposition
Source§impl PartialEq for Disposition
impl PartialEq for Disposition
impl StructuralPartialEq for Disposition
Auto Trait Implementations§
impl Freeze for Disposition
impl RefUnwindSafe for Disposition
impl Send for Disposition
impl Sync for Disposition
impl Unpin for Disposition
impl UnsafeUnpin for Disposition
impl UnwindSafe for Disposition
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more