Skip to main content

DataStackPack

Trait DataStackPack 

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

Source

fn stack_push(self, stack: &mut DataStack)

Pushes every element in tuple order.

Source

fn stack_pop(stack: &mut DataStack) -> Self

Pops every element in tuple order.

§Panics

Panics when the stack does not hold the expected types.

Source

fn pack_types() -> Vec<TypeHash>

Returns the types of the tuple elements, in order.

Provided Methods§

Source

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".

Implementations on Foreign Types§

Source§

impl DataStackPack for ()

Source§

impl<A: 'static, B: 'static, C: 'static, D: 'static, E: 'static, F: 'static, G: 'static, H: 'static, I: 'static, J: 'static, K: 'static, L: 'static, M: 'static, N: 'static, O: 'static, P: 'static> DataStackPack for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P)

Source§

fn stack_push(self, stack: &mut DataStack)

Source§

fn stack_pop(stack: &mut DataStack) -> Self

Source§

fn pack_types() -> Vec<TypeHash>

Source§

impl<A: 'static, B: 'static, C: 'static, D: 'static, E: 'static, F: 'static, G: 'static, H: 'static, I: 'static, J: 'static, K: 'static, L: 'static, M: 'static, N: 'static, O: 'static> DataStackPack for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)

Source§

fn stack_push(self, stack: &mut DataStack)

Source§

fn stack_pop(stack: &mut DataStack) -> Self

Source§

fn pack_types() -> Vec<TypeHash>

Source§

impl<A: 'static, B: 'static, C: 'static, D: 'static, E: 'static, F: 'static, G: 'static, H: 'static, I: 'static, J: 'static, K: 'static, L: 'static, M: 'static, N: 'static> DataStackPack for (A, B, C, D, E, F, G, H, I, J, K, L, M, N)

Source§

fn stack_push(self, stack: &mut DataStack)

Source§

fn stack_pop(stack: &mut DataStack) -> Self

Source§

fn pack_types() -> Vec<TypeHash>

Source§

impl<A: 'static, B: 'static, C: 'static, D: 'static, E: 'static, F: 'static, G: 'static, H: 'static, I: 'static, J: 'static, K: 'static, L: 'static, M: 'static> DataStackPack for (A, B, C, D, E, F, G, H, I, J, K, L, M)

Source§

fn stack_push(self, stack: &mut DataStack)

Source§

fn stack_pop(stack: &mut DataStack) -> Self

Source§

fn pack_types() -> Vec<TypeHash>

Source§

impl<A: 'static, B: 'static, C: 'static, D: 'static, E: 'static, F: 'static, G: 'static, H: 'static, I: 'static, J: 'static, K: 'static, L: 'static> DataStackPack for (A, B, C, D, E, F, G, H, I, J, K, L)

Source§

fn stack_push(self, stack: &mut DataStack)

Source§

fn stack_pop(stack: &mut DataStack) -> Self

Source§

fn pack_types() -> Vec<TypeHash>

Source§

impl<A: 'static, B: 'static, C: 'static, D: 'static, E: 'static, F: 'static, G: 'static, H: 'static, I: 'static, J: 'static, K: 'static> DataStackPack for (A, B, C, D, E, F, G, H, I, J, K)

Source§

fn stack_push(self, stack: &mut DataStack)

Source§

fn stack_pop(stack: &mut DataStack) -> Self

Source§

fn pack_types() -> Vec<TypeHash>

Source§

impl<A: 'static, B: 'static, C: 'static, D: 'static, E: 'static, F: 'static, G: 'static, H: 'static, I: 'static, J: 'static> DataStackPack for (A, B, C, D, E, F, G, H, I, J)

Source§

fn stack_push(self, stack: &mut DataStack)

Source§

fn stack_pop(stack: &mut DataStack) -> Self

Source§

fn pack_types() -> Vec<TypeHash>

Source§

impl<A: 'static, B: 'static, C: 'static, D: 'static, E: 'static, F: 'static, G: 'static, H: 'static, I: 'static> DataStackPack for (A, B, C, D, E, F, G, H, I)

Source§

fn stack_push(self, stack: &mut DataStack)

Source§

fn stack_pop(stack: &mut DataStack) -> Self

Source§

fn pack_types() -> Vec<TypeHash>

Source§

impl<A: 'static, B: 'static, C: 'static, D: 'static, E: 'static, F: 'static, G: 'static, H: 'static> DataStackPack for (A, B, C, D, E, F, G, H)

Source§

fn stack_push(self, stack: &mut DataStack)

Source§

fn stack_pop(stack: &mut DataStack) -> Self

Source§

fn pack_types() -> Vec<TypeHash>

Source§

impl<A: 'static, B: 'static, C: 'static, D: 'static, E: 'static, F: 'static, G: 'static> DataStackPack for (A, B, C, D, E, F, G)

Source§

fn stack_push(self, stack: &mut DataStack)

Source§

fn stack_pop(stack: &mut DataStack) -> Self

Source§

fn pack_types() -> Vec<TypeHash>

Source§

impl<A: 'static, B: 'static, C: 'static, D: 'static, E: 'static, F: 'static> DataStackPack for (A, B, C, D, E, F)

Source§

fn stack_push(self, stack: &mut DataStack)

Source§

fn stack_pop(stack: &mut DataStack) -> Self

Source§

fn pack_types() -> Vec<TypeHash>

Source§

impl<A: 'static, B: 'static, C: 'static, D: 'static, E: 'static> DataStackPack for (A, B, C, D, E)

Source§

fn stack_push(self, stack: &mut DataStack)

Source§

fn stack_pop(stack: &mut DataStack) -> Self

Source§

fn pack_types() -> Vec<TypeHash>

Source§

impl<A: 'static, B: 'static, C: 'static, D: 'static> DataStackPack for (A, B, C, D)

Source§

fn stack_push(self, stack: &mut DataStack)

Source§

fn stack_pop(stack: &mut DataStack) -> Self

Source§

fn pack_types() -> Vec<TypeHash>

Source§

impl<A: 'static, B: 'static, C: 'static> DataStackPack for (A, B, C)

Source§

fn stack_push(self, stack: &mut DataStack)

Source§

fn stack_pop(stack: &mut DataStack) -> Self

Source§

fn pack_types() -> Vec<TypeHash>

Source§

impl<A: 'static, B: 'static> DataStackPack for (A, B)

Source§

fn stack_push(self, stack: &mut DataStack)

Source§

fn stack_pop(stack: &mut DataStack) -> Self

Source§

fn pack_types() -> Vec<TypeHash>

Source§

impl<A: 'static> DataStackPack for (A,)

Source§

fn stack_push(self, stack: &mut DataStack)

Source§

fn stack_pop(stack: &mut DataStack) -> Self

Source§

fn pack_types() -> Vec<TypeHash>

Implementors§