Enum bpaf::ParseFailure
source · [−]Expand description
Unsuccessful command line parsing outcome
Useful for unit testing for user parsers, intented to
be consumed with ParseFailure::unwrap_stdout
and ParseFailure::unwrap_stdout
Variants
Stdout(String)
Terminate and print this to stdout
Stderr(String)
Terminate and print this to stderr
Implementations
sourceimpl ParseFailure
impl ParseFailure
sourcepub fn unwrap_stderr(self) -> String
pub fn unwrap_stderr(self) -> String
Returns the contained stderr
values
Intended to be used with unit tests
Panics
Will panic if failure contains stdout
sourcepub fn unwrap_stdout(self) -> String
pub fn unwrap_stdout(self) -> String
Returns the contained stdout
values
Intended to be used with unit tests
Panics
Will panic if failure contains stderr
Trait Implementations
sourceimpl Clone for ParseFailure
impl Clone for ParseFailure
sourcefn clone(&self) -> ParseFailure
fn clone(&self) -> ParseFailure
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl RefUnwindSafe for ParseFailure
impl Send for ParseFailure
impl Sync for ParseFailure
impl Unpin for ParseFailure
impl UnwindSafe for ParseFailure
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more