---
source: crates/oopsie-macros/src/derive/mod.rs
expression: output
---
# [doc = "Context selector for `MyError`."] # [derive (Debug , Copy , Clone)] pub (crate) struct MyOopsie < __T0 > { # [doc = "Value for the `message` field of `MyError`.\n\nField type: `String`"] pub message : __T0 } impl < __T0 > MyOopsie < __T0 > where __T0 : :: core :: convert :: Into < String > { # [doc = "Builds `MyError` from this selector's fields."] # [must_use] # [track_caller] pub fn build (self) -> MyError { MyError { message : self . message . into () , } } # [doc = "Builds `MyError` and returns it as `Err`."] # [track_caller] pub fn fail < __T > (self) -> :: core :: result :: Result < __T , MyError > { :: core :: result :: Result :: Err (self . build ()) } } impl < __T0 > crate :: Contextual < crate :: NoSource > for MyOopsie < __T0 > where __T0 : :: core :: convert :: Into < String > { type Destination = MyError ; # [track_caller] fn build_error (self , _ : crate :: NoSource) -> MyError { self . build () } } impl :: core :: fmt :: Display for MyError { fn fmt (& self , __oopsie_fmt : & mut :: core :: fmt :: Formatter < '_ >) -> :: core :: fmt :: Result { # [allow (unused_variables)] let Self { message , .. } = self ; :: core :: write ! (__oopsie_fmt , "Test error: {message}") } } impl :: core :: error :: Error for MyError { fn source (& self) -> :: core :: option :: Option < & (dyn :: core :: error :: Error + 'static) > { :: core :: option :: Option :: None } } impl crate :: Diagnostic for MyError { } # [doc (hidden)] # [allow (unused_imports)] const _ : () = { use crate :: __private :: documented :: helper :: oopsie as _ ; use crate :: __private :: documented :: helper :: oopsie as _ ; use crate :: __private :: documented :: helper :: oopsie as _ ; use crate :: __private :: documented :: helper :: oopsie as _ ; use crate :: __private :: documented :: container :: vis as _ ; use crate :: __private :: documented :: container :: suffix as _ ; use crate :: __private :: documented :: container :: path as _ ; } ; crate :: __register_generated_site ! () ;