GuestErrorType only needs to have a success constructor

This commit is contained in:
Pat Hickey
2020-03-27 14:31:59 -07:00
parent 9ca3bf532e
commit 167a040ea5
5 changed files with 12 additions and 27 deletions

View File

@@ -66,16 +66,11 @@ use syn::parse_macro_input;
///
/// /// For all types used in the `Error` position of a `Result` in the module
/// /// traits, you must implement `GuestErrorType` which tells wiggle-generated
/// /// code how to determine if a method call has been successful, as well as
/// /// how to translate a wiggle runtime error into an ABI-level error.
/// impl<'a> GuestErrorType<'a> for types::Errno {
/// type Context = YourCtxType;
/// /// code what value to return when the method returns Ok(...).
/// impl GuestErrorType for types::Errno {
/// fn success() -> Self {
/// unimplemented!()
/// }
/// fn from_error(_e: wiggle::GuestError, _c: &Self::Context) -> Self {
/// unimplemented!()
/// }
/// }
///
/// # fn main() { println!("this fools doc tests into compiling the above outside a function body")