pub trait MockTypes: 'static {
const MOCKED_TYPES: &'static [&'static str];
}
Expand description
Trait allowing to mock out type annotation support together with WithMockedTypes
.
It specifies recognized type annotations; if any other annotation is used, an error
will be raised.
When used as a Parse
r, all Features
are on.
§Examples
struct MockedTypesList;
impl MockTypes for MockedTypesList {
const MOCKED_TYPES: &'static [&'static str] = &["Num"];
}
// Grammar that recognizes `Num` type annotation.
type Grammar = WithMockedTypes<F64Grammar, MockedTypesList>;
Required Associated Constants§
Sourceconst MOCKED_TYPES: &'static [&'static str]
const MOCKED_TYPES: &'static [&'static str]
List of mocked type annotations.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.