Expand description
§dispatch-lite
Lightweight enum dispatch for trait objects.
A minimal alternative to dynamic dispatch — apply #[dispatch_lite]
to a trait and enum pair to generate zero-cost static dispatch.
§Usage
ⓘ
use dispatch_lite::dispatch_lite;
#[dispatch_lite]
trait Animal {
fn sound(&self) -> String;
}
enum Pet {
Dog(Dog),
Cat(Cat),
}Attribute Macros§
- dispatch_
lite - Apply to a trait definition to generate enum dispatch implementations.