Lines Matching defs:Error
0 //! Error reporting
52 pub type Result<T, E = Error> = StdResult<T, E>;
54 /// Command Line Argument Parser Error
59 pub struct Error<F: ErrorFormatter = DefaultFormatter> {
70 source: Option<Box<dyn error::Error + Send + Sync>>,
77 impl<F: ErrorFormatter> Error<F> {
81 /// a place that has access to the `Command` at which point you can call [`Error::format`].
104 /// - [`Error::insert`]
105 /// - [`Error::with_cmd`]
117 /// let mut err = clap::Error::new(ErrorKind::ValueValidation)
143 /// Generally, this is used with [`Error::new`]
165 pub fn apply<EF: ErrorFormatter>(self) -> Error<EF> {
166 Error {
238 /// err.print().expect("Error writing Error");
288 pub(crate) fn set_source(mut self, source: Box<dyn error::Error + Send + Sync>) -> Self {
606 err: Box<dyn error::Error + Send + Sync>,
753 impl<F: ErrorFormatter> From<io::Error> for Error<F> {
754 fn from(e: io::Error) -> Self {
755 Error::raw(ErrorKind::Io, e)
759 impl<F: ErrorFormatter> From<fmt::Error> for Error<F> {
760 fn from(e: fmt::Error) -> Self {
761 Error::raw(ErrorKind::Format, e)
765 impl<F: ErrorFormatter> std::fmt::Debug for Error<F> {
766 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
771 impl<F: ErrorFormatter> error::Error for Error<F> {
773 fn source(&self) -> Option<&(dyn error::Error + 'static)> {
778 impl<F: ErrorFormatter> Display for Error<F> {
875 static_assertions::assert_impl_all!(Error: Send, Sync, Unpin);