Skip to content

Commit

Permalink
Make AnyResult public
Browse files Browse the repository at this point in the history
  • Loading branch information
connorslade committed Dec 19, 2023
1 parent 96b518c commit ff963f7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ Coming Soon
- Implement Debug for Query
- Rename `Query::from_body` to `Query::from_str`
- Made internal::handle::handle function public for use in custom event loops.
- Made `error::AnyResult` public

# 2.2.1

Expand Down
4 changes: 3 additions & 1 deletion lib/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ use crate::{HeaderName, Method};

/// Easy way to use a Result<T, [`crate::Error`]>
pub type Result<T> = result::Result<T, Error>;
pub(crate) type AnyResult<T = ()> = result::Result<T, Box<dyn error::Error>>;
/// Easy way to use a Result<T, Box<dyn [`std::error::Error`]>>.
/// This lets you return any error type that implements [`std::error::Error`] (basically any error) from a route handler.
pub type AnyResult<T = ()> = result::Result<T, Box<dyn error::Error>>;

/// A generic error type for afire.
/// Contains variants for [Startup][`StartupError`], [Stream][`StreamError`], [Handle][`HandleError`], [Parse][`ParseError`], [IO][`std::io::Error`] and [Miscellaneous][`String`] errors.
Expand Down

0 comments on commit ff963f7

Please sign in to comment.