macro_rules! gen_cast {
( $name:ident, $type:ty, $expected:expr, $variant:pat, $result:expr ) => { ... };
}Expand description
Generate an as_* method returning a reference to the expected
type, or a type error. This only works for types that implement
Copy, as returning a reference to an inner thunk value is not
possible.
Generate an as_*/to_* accessor method that returns either the
expected type, or a type error.