File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 1+ #![ warn( missing_docs) ]
12//! A macro which makes errors easy to write
23//!
34//! Minimum type is like this:
@@ -981,10 +982,20 @@ macro_rules! quick_error {
981982}
982983
983984
985+ /// Generic context type
986+ ///
987+ /// Used mostly as a transport for `ResultExt::context` method
984988#[ derive( Debug ) ]
985989pub struct Context < X , E > ( pub X , pub E ) ;
986990
991+ /// Result extension trait adding a `context` method
987992pub trait ResultExt < T , E > {
993+ /// The method is use to add context information to current operation
994+ ///
995+ /// The context data is then used in error constructor to store additional
996+ /// information within error. For example, you may add a filename as a
997+ /// context for file operation. See crate documentation for the actual
998+ /// example.
988999 fn context < X > ( self , x : X ) -> Result < T , Context < X , E > > ;
9891000}
9901001
You can’t perform that action at this time.
0 commit comments