Skip to main content

define_update_engine_types

Macro define_update_engine_types 

Source
macro_rules! define_update_engine_types {
    ($v:vis $spec_type:ty) => { ... };
}
Expand description

Defines type aliases for types-crate types parameterized by a particular EngineSpec.

This macro defines a number of type aliases. For example:

oxide_update_engine_types::define_update_engine_types!(pub(crate) MySpec);

defines a number of type aliases, each of which are of the form:

pub(crate) type Event<S = MySpec> =
    oxide_update_engine_types::events::Event<S>;
pub(crate) type EventBuffer<S = MySpec> =
    oxide_update_engine_types::buffer::EventBuffer<S>;
// ... and so on.

These aliases make it easy to use a type without having to repeat the name of the specification over and over, while still providing a type parameter as an escape hatch if required.

For consumers that also depend on the engine crate, a companion macro oxide_update_engine::define_update_engine! generates aliases for engine-crate types.