pub trait InjectEvent<Input, Path>: Sized {
// Required method
fn inject_at(input: Input) -> Self;
}Expand description
Path-indexed injection into a structural event coproduct.
The path is compile-time routing evidence. It prevents the overlapping implementations that arise when an outer layer owns the same input type as an inner layer and makes that ownership choice explicit in the type system. Unsupported input has no construction capability:
ⓘ
let _ = <behavior::User<behavior::MailAddr, ()> as behavior::InjectEvent<u8, behavior::Here>>::inject_at(7);Repeated payload types require an explicit ownership path rather than an outermost-first runtime guess:
ⓘ
type Duplicate = behavior::EventLayer<u8, behavior::EventLayer<u8, behavior::User<behavior::MailAddr, ()>>>;
let _ = <Duplicate as behavior::InjectEvent<u8, _>>::inject_at(7);Required Methods§
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.