Trait rune::runtime::GuardedArgs

source ·
pub trait GuardedArgs {
    type Guard;

    // Required methods
    unsafe fn unsafe_into_stack(
        self,
        stack: &mut Stack
    ) -> VmResult<Self::Guard>;
    fn count(&self) -> usize;
}
Expand description

Trait for converting arguments onto the stack.

This can take references, because it is unsafe to call. And should only be implemented in contexts where it can be guaranteed that the references will not outlive the call.

Required Associated Types§

source

type Guard

Guard that when dropped will invalidate any values encoded.

Required Methods§

source

unsafe fn unsafe_into_stack(self, stack: &mut Stack) -> VmResult<Self::Guard>

Encode arguments onto a stack.

§Safety

This is implemented for and allows encoding references on the stack. The returned guard must be dropped before any used references are invalidated.

source

fn count(&self) -> usize

The number of arguments.

Implementations on Foreign Types§

source§

impl GuardedArgs for ()

§

type Guard = ()

source§

unsafe fn unsafe_into_stack(self, stack: &mut Stack) -> VmResult<Self::Guard>

source§

fn count(&self) -> usize

source§

impl<A> GuardedArgs for (A,)
where A: UnsafeToValue,

§

type Guard = (<A as UnsafeToValue>::Guard,)

source§

unsafe fn unsafe_into_stack(self, stack: &mut Stack) -> VmResult<Self::Guard>

source§

fn count(&self) -> usize

source§

impl<A, B> GuardedArgs for (A, B)

§

type Guard = (<A as UnsafeToValue>::Guard, <B as UnsafeToValue>::Guard)

source§

unsafe fn unsafe_into_stack(self, stack: &mut Stack) -> VmResult<Self::Guard>

source§

fn count(&self) -> usize

source§

impl<A, B, C> GuardedArgs for (A, B, C)

§

type Guard = (<A as UnsafeToValue>::Guard, <B as UnsafeToValue>::Guard, <C as UnsafeToValue>::Guard)

source§

unsafe fn unsafe_into_stack(self, stack: &mut Stack) -> VmResult<Self::Guard>

source§

fn count(&self) -> usize

source§

impl<A, B, C, D> GuardedArgs for (A, B, C, D)

§

type Guard = (<A as UnsafeToValue>::Guard, <B as UnsafeToValue>::Guard, <C as UnsafeToValue>::Guard, <D as UnsafeToValue>::Guard)

source§

unsafe fn unsafe_into_stack(self, stack: &mut Stack) -> VmResult<Self::Guard>

source§

fn count(&self) -> usize

source§

impl<A, B, C, D, E> GuardedArgs for (A, B, C, D, E)

§

type Guard = (<A as UnsafeToValue>::Guard, <B as UnsafeToValue>::Guard, <C as UnsafeToValue>::Guard, <D as UnsafeToValue>::Guard, <E as UnsafeToValue>::Guard)

source§

unsafe fn unsafe_into_stack(self, stack: &mut Stack) -> VmResult<Self::Guard>

source§

fn count(&self) -> usize

source§

impl<A, B, C, D, E, F> GuardedArgs for (A, B, C, D, E, F)

§

type Guard = (<A as UnsafeToValue>::Guard, <B as UnsafeToValue>::Guard, <C as UnsafeToValue>::Guard, <D as UnsafeToValue>::Guard, <E as UnsafeToValue>::Guard, <F as UnsafeToValue>::Guard)

source§

unsafe fn unsafe_into_stack(self, stack: &mut Stack) -> VmResult<Self::Guard>

source§

fn count(&self) -> usize

source§

impl<A, B, C, D, E, F, G> GuardedArgs for (A, B, C, D, E, F, G)

§

type Guard = (<A as UnsafeToValue>::Guard, <B as UnsafeToValue>::Guard, <C as UnsafeToValue>::Guard, <D as UnsafeToValue>::Guard, <E as UnsafeToValue>::Guard, <F as UnsafeToValue>::Guard, <G as UnsafeToValue>::Guard)

source§

unsafe fn unsafe_into_stack(self, stack: &mut Stack) -> VmResult<Self::Guard>

source§

fn count(&self) -> usize

source§

impl<A, B, C, D, E, F, G, H> GuardedArgs for (A, B, C, D, E, F, G, H)

§

type Guard = (<A as UnsafeToValue>::Guard, <B as UnsafeToValue>::Guard, <C as UnsafeToValue>::Guard, <D as UnsafeToValue>::Guard, <E as UnsafeToValue>::Guard, <F as UnsafeToValue>::Guard, <G as UnsafeToValue>::Guard, <H as UnsafeToValue>::Guard)

source§

unsafe fn unsafe_into_stack(self, stack: &mut Stack) -> VmResult<Self::Guard>

source§

fn count(&self) -> usize

source§

impl<A, B, C, D, E, F, G, H, I> GuardedArgs for (A, B, C, D, E, F, G, H, I)

§

type Guard = (<A as UnsafeToValue>::Guard, <B as UnsafeToValue>::Guard, <C as UnsafeToValue>::Guard, <D as UnsafeToValue>::Guard, <E as UnsafeToValue>::Guard, <F as UnsafeToValue>::Guard, <G as UnsafeToValue>::Guard, <H as UnsafeToValue>::Guard, <I as UnsafeToValue>::Guard)

source§

unsafe fn unsafe_into_stack(self, stack: &mut Stack) -> VmResult<Self::Guard>

source§

fn count(&self) -> usize

source§

impl<A, B, C, D, E, F, G, H, I, J> GuardedArgs for (A, B, C, D, E, F, G, H, I, J)

§

type Guard = (<A as UnsafeToValue>::Guard, <B as UnsafeToValue>::Guard, <C as UnsafeToValue>::Guard, <D as UnsafeToValue>::Guard, <E as UnsafeToValue>::Guard, <F as UnsafeToValue>::Guard, <G as UnsafeToValue>::Guard, <H as UnsafeToValue>::Guard, <I as UnsafeToValue>::Guard, <J as UnsafeToValue>::Guard)

source§

unsafe fn unsafe_into_stack(self, stack: &mut Stack) -> VmResult<Self::Guard>

source§

fn count(&self) -> usize

source§

impl<A, B, C, D, E, F, G, H, I, J, K> GuardedArgs for (A, B, C, D, E, F, G, H, I, J, K)

§

type Guard = (<A as UnsafeToValue>::Guard, <B as UnsafeToValue>::Guard, <C as UnsafeToValue>::Guard, <D as UnsafeToValue>::Guard, <E as UnsafeToValue>::Guard, <F as UnsafeToValue>::Guard, <G as UnsafeToValue>::Guard, <H as UnsafeToValue>::Guard, <I as UnsafeToValue>::Guard, <J as UnsafeToValue>::Guard, <K as UnsafeToValue>::Guard)

source§

unsafe fn unsafe_into_stack(self, stack: &mut Stack) -> VmResult<Self::Guard>

source§

fn count(&self) -> usize

source§

impl<A, B, C, D, E, F, G, H, I, J, K, L> GuardedArgs for (A, B, C, D, E, F, G, H, I, J, K, L)

§

type Guard = (<A as UnsafeToValue>::Guard, <B as UnsafeToValue>::Guard, <C as UnsafeToValue>::Guard, <D as UnsafeToValue>::Guard, <E as UnsafeToValue>::Guard, <F as UnsafeToValue>::Guard, <G as UnsafeToValue>::Guard, <H as UnsafeToValue>::Guard, <I as UnsafeToValue>::Guard, <J as UnsafeToValue>::Guard, <K as UnsafeToValue>::Guard, <L as UnsafeToValue>::Guard)

source§

unsafe fn unsafe_into_stack(self, stack: &mut Stack) -> VmResult<Self::Guard>

source§

fn count(&self) -> usize

source§

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

§

type Guard = (<A as UnsafeToValue>::Guard, <B as UnsafeToValue>::Guard, <C as UnsafeToValue>::Guard, <D as UnsafeToValue>::Guard, <E as UnsafeToValue>::Guard, <F as UnsafeToValue>::Guard, <G as UnsafeToValue>::Guard, <H as UnsafeToValue>::Guard, <I as UnsafeToValue>::Guard, <J as UnsafeToValue>::Guard, <K as UnsafeToValue>::Guard, <L as UnsafeToValue>::Guard, <M as UnsafeToValue>::Guard)

source§

unsafe fn unsafe_into_stack(self, stack: &mut Stack) -> VmResult<Self::Guard>

source§

fn count(&self) -> usize

source§

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

§

type Guard = (<A as UnsafeToValue>::Guard, <B as UnsafeToValue>::Guard, <C as UnsafeToValue>::Guard, <D as UnsafeToValue>::Guard, <E as UnsafeToValue>::Guard, <F as UnsafeToValue>::Guard, <G as UnsafeToValue>::Guard, <H as UnsafeToValue>::Guard, <I as UnsafeToValue>::Guard, <J as UnsafeToValue>::Guard, <K as UnsafeToValue>::Guard, <L as UnsafeToValue>::Guard, <M as UnsafeToValue>::Guard, <N as UnsafeToValue>::Guard)

source§

unsafe fn unsafe_into_stack(self, stack: &mut Stack) -> VmResult<Self::Guard>

source§

fn count(&self) -> usize

source§

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

§

type Guard = (<A as UnsafeToValue>::Guard, <B as UnsafeToValue>::Guard, <C as UnsafeToValue>::Guard, <D as UnsafeToValue>::Guard, <E as UnsafeToValue>::Guard, <F as UnsafeToValue>::Guard, <G as UnsafeToValue>::Guard, <H as UnsafeToValue>::Guard, <I as UnsafeToValue>::Guard, <J as UnsafeToValue>::Guard, <K as UnsafeToValue>::Guard, <L as UnsafeToValue>::Guard, <M as UnsafeToValue>::Guard, <N as UnsafeToValue>::Guard, <O as UnsafeToValue>::Guard)

source§

unsafe fn unsafe_into_stack(self, stack: &mut Stack) -> VmResult<Self::Guard>

source§

fn count(&self) -> usize

source§

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

§

type Guard = (<A as UnsafeToValue>::Guard, <B as UnsafeToValue>::Guard, <C as UnsafeToValue>::Guard, <D as UnsafeToValue>::Guard, <E as UnsafeToValue>::Guard, <F as UnsafeToValue>::Guard, <G as UnsafeToValue>::Guard, <H as UnsafeToValue>::Guard, <I as UnsafeToValue>::Guard, <J as UnsafeToValue>::Guard, <K as UnsafeToValue>::Guard, <L as UnsafeToValue>::Guard, <M as UnsafeToValue>::Guard, <N as UnsafeToValue>::Guard, <O as UnsafeToValue>::Guard, <P as UnsafeToValue>::Guard)

source§

unsafe fn unsafe_into_stack(self, stack: &mut Stack) -> VmResult<Self::Guard>

source§

fn count(&self) -> usize

Implementors§