Skip to content
This repository was archived by the owner on Aug 16, 2021. It is now read-only.

Commit f768c42

Browse files
committed
Better documentation for ChainedError.
1 parent 086a428 commit f768c42

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/lib.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -358,17 +358,15 @@ pub fn make_backtrace() -> Option<Arc<Backtrace>> {
358358
}
359359
}
360360

361-
/// This trait is an implementation detail which must be implemented on each
362-
/// ErrorKind. We can't do it globally since each ErrorKind is different.
361+
/// This trait is implemented on all the errors generated by the `error_chain`
362+
/// macro.
363363
pub trait ChainedError: error::Error + Send + 'static {
364364
/// Associated kind type.
365365
type ErrorKind;
366366
/// Creates an error from it's parts.
367367
fn new(kind: Self::ErrorKind, state: State) -> Self;
368-
/// Use downcasts to extract the backtrace from types we know,
369-
/// to avoid generating a new one. It would be better to not
370-
/// define this in the macro, but types need some additional
371-
/// machinery to make it work.
368+
/// Returns the first known backtrace, either from it's State or from one
369+
/// of the errors from `foreign_links`.
372370
#[cfg(feature = "backtrace")]
373371
fn extract_backtrace(e: &(error::Error + Send + 'static))
374372
-> Option<Option<Arc<Backtrace>>>;

0 commit comments

Comments
 (0)