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) ]
1
2
//! A macro which makes errors easy to write
2
3
//!
3
4
//! Minimum type is like this:
@@ -981,10 +982,20 @@ macro_rules! quick_error {
981
982
}
982
983
983
984
985
+ /// Generic context type
986
+ ///
987
+ /// Used mostly as a transport for `ResultExt::context` method
984
988
#[ derive( Debug ) ]
985
989
pub struct Context < X , E > ( pub X , pub E ) ;
986
990
991
+ /// Result extension trait adding a `context` method
987
992
pub 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.
988
999
fn context < X > ( self , x : X ) -> Result < T , Context < X , E > > ;
989
1000
}
990
1001
You can’t perform that action at this time.
0 commit comments