document main types

This commit is contained in:
Jane Lusby 2020-04-25 10:01:42 -07:00
parent 4e85352a1e
commit 6c4194a711
2 changed files with 18 additions and 4 deletions

View File

@ -4,10 +4,19 @@ color-eyre
A custom context for the [`eyre`] crate for colorful error reports, suggestions,
and [`tracing-error`] support.
This crate is currently pre-release while I try to upstream changes I made to
[`color-backtrace`] to support this crate. Until then I cannot publish this to
crates.io, the documentation is filled out however so simply run `cargo doc
--open` for an explanation of usage.
This crate works by defining a `Context` type which implements `EyreContext`
and a pair of type aliases for setting this context object as the parameter of
`eyre::Report`.
```rust
pub type Report = eyre::Report<Context>;
pub type Result<T, E = Report> = core::result::Result<T, E>;
```
**Disclaimer**: This crate is currently pre-release while I try to upstream
changes I made to [`color-backtrace`] to support this crate. Until then I
cannot publish this to crates.io, the documentation is filled out however so
simply run `cargo doc --open` for an explanation of usage.
## Setup

View File

@ -1,6 +1,10 @@
//! This library provides a custom [`eyre::EyreContext`] type for colorful error
//! reports with custom help text for the [`eyre`] crate.
//!
//! **Disclaimer**: This library is currently in pre-release while I work on upstreaming changes I
//! made to [`color-backtrace`], until then this depends on unreleased versions on github and so it
//! cannot be published to crates.io
//!
//! # Features
//!
//! - captures a [`backtrace::Backtrace`] and prints using [`color-backtrace`]
@ -68,6 +72,7 @@
//! ![full report format](https://github.com/yaahc/color-eyre/blob/master/pictures/full.png)
//!
//! [`eyre::EyreContext`]: https://docs.rs/eyre/0.3.8/eyre/trait.EyreContext.html
//! [`eyre`]: https://docs.rs/eyre
//! [`backtrace::Backtrace`]: https://docs.rs/backtrace/0.3.46/backtrace/struct.Backtrace.html
//! [`tracing_error::SpanTrace`]: https://docs.rs/tracing-error/0.1.2/tracing_error/struct.SpanTrace.html
//! [`color-backtrace`]: https://docs.rs/color-backtrace