pub struct ReportFromStr<T>(pub T);Expand description
Wrapper for clap that uses snafu::Report for richer error display.
Use as a clap argument type to get multi-line error chain output when
parsing complex types like LocationPattern or Name:
ⓘ
#[derive(clap::Parser)]
struct Cli {
pattern: ReportFromStr<LocationPattern>,
}Tuple Fields§
§0: TTrait Implementations§
Source§impl<T: Clone> Clone for ReportFromStr<T>
impl<T: Clone> Clone for ReportFromStr<T>
Source§fn clone(&self) -> ReportFromStr<T>
fn clone(&self) -> ReportFromStr<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<T: Copy> Copy for ReportFromStr<T>
Source§impl<T: Debug> Debug for ReportFromStr<T>
impl<T: Debug> Debug for ReportFromStr<T>
Source§impl<T> FromStr for ReportFromStr<T>
impl<T> FromStr for ReportFromStr<T>
Auto Trait Implementations§
impl<T> Freeze for ReportFromStr<T>where
T: Freeze,
impl<T> RefUnwindSafe for ReportFromStr<T>where
T: RefUnwindSafe,
impl<T> Send for ReportFromStr<T>where
T: Send,
impl<T> Sync for ReportFromStr<T>where
T: Sync,
impl<T> Unpin for ReportFromStr<T>where
T: Unpin,
impl<T> UnsafeUnpin for ReportFromStr<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for ReportFromStr<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<S> DecodeExt for Swhere
S: ?Sized,
impl<S> DecodeExt for Swhere
S: ?Sized,
fn decode<T>(
self,
) -> impl Future<Output = Result<T, <T as DecodeFrom<Self>>::Error>> + Sendwhere
Self: Sized,
T: DecodeFrom<Self>,
fn decode_one<'s, T>(
&'s mut self,
) -> impl Future<Output = Result<T, <T as DecodeFrom<&'s mut Self>>::Error>>where
T: DecodeFrom<&'s mut Self>,
fn into_decode_stream<T, Error>(self) -> impl Stream<Item = Result<T, Error>>where
Self: Sized,
T: for<'s> DecodeFrom<&'s mut Self, Error = Error>,
&'s mut Self: for<'s> AsyncBufRead,
Error: From<Error>,
Source§impl<S> EncodeExt for Swhere
S: ?Sized,
impl<S> EncodeExt for Swhere
S: ?Sized,
fn encode<T>(
self,
item: T,
) -> impl Future<Output = Result<<T as EncodeInto<Self>>::Output, <T as EncodeInto<Self>>::Error>> + Sendwhere
Self: Sized,
T: EncodeInto<Self>,
fn encode_one<'s, T>(
&'s mut self,
item: T,
) -> impl Future<Output = Result<<T as EncodeInto<&'s mut Self>>::Output, <T as EncodeInto<&'s mut Self>>::Error>>where
Self: Sized,
T: EncodeInto<&'s mut Self>,
fn into_encode_sink<T, Error>(self) -> impl Sink<T, Error = Error>where
Self: Sized,
T: for<'s> EncodeInto<&'s mut Self, Error = Error>,
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>
Converts
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>
Converts
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