pub fn describe<E: std::error::Error + 'static>(&self, err: &S<E>) -> String {
        use std::fmt::Write;
        let mut buf = format!("Error: {}\n", err.inner);

        if let Some(e) = self.0.get(err.span.0) {
            writeln!(&mut buf, "{}\n", e).unwrap();
        }

        let mut err: &(dyn std::error::Error + 'static) = &err.inner;
        while let Some(source) = err.source() {
            writeln!(&mut buf, "Cause: {}", source).unwrap();
            err = source;
        }

        buf
    }
/// Describes a spanned error as a human-readable string.
Describes a spanned error as a human-readable string.
Describes a spanned error as a human - readable string .
pub fn describe<E: std::error::Error + 'static>(&self, err: &S<E>) -> String {
        use std::fmt::Write;
        let mut buf = format!("Error: {}\n", err.inner);
        if let Some(e) = self.0.get(err.span.0) {
            writeln!(&mut buf, "{}\n", e).unwrap();
        }
        let mut err: &(dyn std::error::Error + 'static) = &err.inner;
        while let Some(source) = err.source() {
            writeln!(&mut buf, "Cause: {}", source).unwrap();
            err = source;
        }
        buf
    }
pub fn describe < E : std :: error :: Error + ' static > ( & self , err : & S < E > ) -> String { use std :: fmt :: Write ; let mut buf = format ! ( " \n " err inner ) ; if let Some ( e ) = self . 0 . get ( err . span . 0 ) { writeln ! ( mut buf " \n " e ) . unwrap ( ) ; } let mut err : & ( dyn std :: error :: Error + ' static ) = & err . inner ; while let Some ( source ) = err . source ( ) { writeln ! ( mut buf " " source ) . unwrap ( ) ; err = source ; } buf }
Describes a spanned error as a human-readable string.
Describes a spanned error as a human - readable string .
&self
err
&S<E>
&self
err
&S<E>