pub trait DataStackPack: Sized {
// Required methods
fn stack_push(self, stack: &mut DataStack);
fn stack_pop(stack: &mut DataStack) -> Self;
fn pack_types() -> Vec<TypeHash>;
// Provided method
fn stack_push_reversed(self, stack: &mut DataStack) { ... }
}Expand description
Moves a tuple of values on and off a DataStack in one step.
This is the bridge between a Rust call with typed arguments and the untyped
stack. Argument tuples and result tuples both go through it.
Implemented for tuples of up to sixteen elements, and for ().
Required Methods§
Sourcefn stack_push(self, stack: &mut DataStack)
fn stack_push(self, stack: &mut DataStack)
Pushes every element in tuple order.
Sourcefn pack_types() -> Vec<TypeHash>
fn pack_types() -> Vec<TypeHash>
Returns the types of the tuple elements, in order.
Provided Methods§
Sourcefn stack_push_reversed(self, stack: &mut DataStack)
fn stack_push_reversed(self, stack: &mut DataStack)
Pushes every element so that the first one ends up on top.
This is the order a callee expects, since it pops its arguments from first to last.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".