Trait arithmetic_parser::grammars::MockTypes

source ·
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 Parser, 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§

source

const MOCKED_TYPES: &'static [&'static str]

List of mocked type annotations.

Object Safety§

This trait is not object safe.

Implementors§