pub trait ReusableMessageRecipe<Parent, Route, I, Context: ?Sized>: Sized {
// Required method
fn prepare(
parent: &mut Parent,
instruction: &I,
context: &Context,
) -> Result<Self>;
}Expand description
Reusable message construction over machines with specified capabilities.
Upstream message authors implement this trait generically over Parent,
requiring capabilities such as crate::Field or operand-stack access
instead of depending on a particular composite type. Route identifies the
destination device, I supplies instruction data, and Context supplies
shared read-only runtime data. Context may be unsized.
A recipe does not provide a BuildMessage implementation. Composite
authors choose whether to call Self::prepare on the message type from the
body of their own BuildMessage::build_message implementation, or construct
the message using machine-specific logic instead.
Available with the experimental typed-declarations feature. “Reusable”
describes the intended use; implementations may also name a concrete parent.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".