Skip to main content

ReusableMessageRecipe

Trait ReusableMessageRecipe 

Source
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§

Source

fn prepare( parent: &mut Parent, instruction: &I, context: &Context, ) -> Result<Self>

Construct the message from the parent’s capabilities and runtime inputs.

§Errors

Returns construction or validation failures. Mutations made before an error, including successful operand pops, are retained.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<C, F, I, Context: ?Sized> ReusableMessageRecipe<C, F, I, Context> for NoMessage
where C: Field<F>, C::Child: Execute<I, Message = NoMessage>,

Source§

impl<C, F, I, Context: ?Sized> ReusableMessageRecipe<C, F, I, Context> for PopFromStack<()>
where C: Composite + Field<F> + HasOperandStack<I>, C::Child: Execute<I, Message = PopFromStack<()>>,

Source§

impl<C, F, I, T, Context: ?Sized> ReusableMessageRecipe<C, F, I, Context> for PopFromStack<StackBatch<T>>
where C: Composite + Field<F> + HasOperandStack<I>, C::Child: Execute<I, Message = PopFromStack<StackBatch<T>>> + StackInputCount<I>, T: StackValue + 'static, C::Source: PopStack<T::Storage> + PopStack<Word>,

Source§

impl<Parent, Route, Inst, Context: ?Sized, A: StackValue, B: StackValue, C: StackValue, D: StackValue, E: StackValue, F: StackValue, G: StackValue, H: StackValue, I: StackValue, J: StackValue, K: StackValue, L: StackValue, M: StackValue, N: StackValue, O: StackValue, P: StackValue> ReusableMessageRecipe<Parent, Route, Inst, Context> for PopFromStack<(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P)>

Source§

impl<Parent, Route, Inst, Context: ?Sized, A: StackValue, B: StackValue, C: StackValue, D: StackValue, E: StackValue, F: StackValue, G: StackValue, H: StackValue, I: StackValue, J: StackValue, K: StackValue, L: StackValue, M: StackValue, N: StackValue, O: StackValue> ReusableMessageRecipe<Parent, Route, Inst, Context> for PopFromStack<(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)>

Source§

impl<Parent, Route, Inst, Context: ?Sized, A: StackValue, B: StackValue, C: StackValue, D: StackValue, E: StackValue, F: StackValue, G: StackValue, H: StackValue, I: StackValue, J: StackValue, K: StackValue, L: StackValue, M: StackValue, N: StackValue> ReusableMessageRecipe<Parent, Route, Inst, Context> for PopFromStack<(A, B, C, D, E, F, G, H, I, J, K, L, M, N)>

Source§

impl<Parent, Route, Inst, Context: ?Sized, A: StackValue, B: StackValue, C: StackValue, D: StackValue, E: StackValue, F: StackValue, G: StackValue, H: StackValue, I: StackValue, J: StackValue, K: StackValue, L: StackValue, M: StackValue> ReusableMessageRecipe<Parent, Route, Inst, Context> for PopFromStack<(A, B, C, D, E, F, G, H, I, J, K, L, M)>

Source§

impl<Parent, Route, Inst, Context: ?Sized, A: StackValue, B: StackValue, C: StackValue, D: StackValue, E: StackValue, F: StackValue, G: StackValue, H: StackValue, I: StackValue, J: StackValue, K: StackValue, L: StackValue> ReusableMessageRecipe<Parent, Route, Inst, Context> for PopFromStack<(A, B, C, D, E, F, G, H, I, J, K, L)>

Source§

impl<Parent, Route, Inst, Context: ?Sized, A: StackValue, B: StackValue, C: StackValue, D: StackValue, E: StackValue, F: StackValue, G: StackValue, H: StackValue, I: StackValue, J: StackValue, K: StackValue> ReusableMessageRecipe<Parent, Route, Inst, Context> for PopFromStack<(A, B, C, D, E, F, G, H, I, J, K)>

Source§

impl<Parent, Route, Inst, Context: ?Sized, A: StackValue, B: StackValue, C: StackValue, D: StackValue, E: StackValue, F: StackValue, G: StackValue, H: StackValue, I: StackValue, J: StackValue> ReusableMessageRecipe<Parent, Route, Inst, Context> for PopFromStack<(A, B, C, D, E, F, G, H, I, J)>

Source§

impl<Parent, Route, Inst, Context: ?Sized, A: StackValue, B: StackValue, C: StackValue, D: StackValue, E: StackValue, F: StackValue, G: StackValue, H: StackValue, I: StackValue> ReusableMessageRecipe<Parent, Route, Inst, Context> for PopFromStack<(A, B, C, D, E, F, G, H, I)>

Source§

impl<Parent, Route, Inst, Context: ?Sized, A: StackValue, B: StackValue, C: StackValue, D: StackValue, E: StackValue, F: StackValue, G: StackValue, H: StackValue> ReusableMessageRecipe<Parent, Route, Inst, Context> for PopFromStack<(A, B, C, D, E, F, G, H)>
where Parent: Composite + Field<Route> + HasOperandStack<Inst>, Parent::Child: Execute<Inst, Message = PopFromStack<(A, B, C, D, E, F, G, H)>>, Parent::Source: PopStack<A::Storage> + PopStack<B::Storage> + PopStack<C::Storage> + PopStack<D::Storage> + PopStack<E::Storage> + PopStack<F::Storage> + PopStack<G::Storage> + PopStack<H::Storage> + Sized,

Source§

impl<Parent, Route, Inst, Context: ?Sized, A: StackValue, B: StackValue, C: StackValue, D: StackValue, E: StackValue, F: StackValue, G: StackValue> ReusableMessageRecipe<Parent, Route, Inst, Context> for PopFromStack<(A, B, C, D, E, F, G)>
where Parent: Composite + Field<Route> + HasOperandStack<Inst>, Parent::Child: Execute<Inst, Message = PopFromStack<(A, B, C, D, E, F, G)>>, Parent::Source: PopStack<A::Storage> + PopStack<B::Storage> + PopStack<C::Storage> + PopStack<D::Storage> + PopStack<E::Storage> + PopStack<F::Storage> + PopStack<G::Storage> + Sized,

Source§

impl<Parent, Route, Inst, Context: ?Sized, A: StackValue, B: StackValue, C: StackValue, D: StackValue, E: StackValue, F: StackValue> ReusableMessageRecipe<Parent, Route, Inst, Context> for PopFromStack<(A, B, C, D, E, F)>
where Parent: Composite + Field<Route> + HasOperandStack<Inst>, Parent::Child: Execute<Inst, Message = PopFromStack<(A, B, C, D, E, F)>>, Parent::Source: PopStack<A::Storage> + PopStack<B::Storage> + PopStack<C::Storage> + PopStack<D::Storage> + PopStack<E::Storage> + PopStack<F::Storage> + Sized,

Source§

impl<Parent, Route, Inst, Context: ?Sized, A: StackValue, B: StackValue, C: StackValue, D: StackValue, E: StackValue> ReusableMessageRecipe<Parent, Route, Inst, Context> for PopFromStack<(A, B, C, D, E)>
where Parent: Composite + Field<Route> + HasOperandStack<Inst>, Parent::Child: Execute<Inst, Message = PopFromStack<(A, B, C, D, E)>>, Parent::Source: PopStack<A::Storage> + PopStack<B::Storage> + PopStack<C::Storage> + PopStack<D::Storage> + PopStack<E::Storage> + Sized,

Source§

impl<Parent, Route, Inst, Context: ?Sized, A: StackValue, B: StackValue, C: StackValue, D: StackValue> ReusableMessageRecipe<Parent, Route, Inst, Context> for PopFromStack<(A, B, C, D)>
where Parent: Composite + Field<Route> + HasOperandStack<Inst>, Parent::Child: Execute<Inst, Message = PopFromStack<(A, B, C, D)>>, Parent::Source: PopStack<A::Storage> + PopStack<B::Storage> + PopStack<C::Storage> + PopStack<D::Storage> + Sized,

Source§

impl<Parent, Route, Inst, Context: ?Sized, A: StackValue, B: StackValue, C: StackValue> ReusableMessageRecipe<Parent, Route, Inst, Context> for PopFromStack<(A, B, C)>
where Parent: Composite + Field<Route> + HasOperandStack<Inst>, Parent::Child: Execute<Inst, Message = PopFromStack<(A, B, C)>>, Parent::Source: PopStack<A::Storage> + PopStack<B::Storage> + PopStack<C::Storage> + Sized,

Source§

impl<Parent, Route, Inst, Context: ?Sized, A: StackValue, B: StackValue> ReusableMessageRecipe<Parent, Route, Inst, Context> for PopFromStack<(A, B)>
where Parent: Composite + Field<Route> + HasOperandStack<Inst>, Parent::Child: Execute<Inst, Message = PopFromStack<(A, B)>>, Parent::Source: PopStack<A::Storage> + PopStack<B::Storage> + Sized,

Source§

impl<Parent, Route, Inst, Context: ?Sized, A: StackValue> ReusableMessageRecipe<Parent, Route, Inst, Context> for PopFromStack<(A,)>
where Parent: Composite + Field<Route> + HasOperandStack<Inst>, Parent::Child: Execute<Inst, Message = PopFromStack<(A,)>>, Parent::Source: PopStack<A::Storage> + Sized,