rune::runtime

Trait GuardedArgs

Source
pub trait GuardedArgs {
    type Guard;

    // Required methods
    unsafe fn guarded_into_stack(
        self,
        stack: &mut Stack,
    ) -> VmResult<Self::Guard>;
    unsafe fn guarded_into_vec(self) -> VmResult<(Vec<Value>, 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 guarded_into_stack(self, stack: &mut Stack) -> VmResult<Self::Guard>

Encode arguments onto a stack.

§Safety

This can encode references onto the stack. The caller must ensure that the guard is dropped before any references which have been encoded are no longer alive.

Source

unsafe fn guarded_into_vec(self) -> VmResult<(Vec<Value>, Self::Guard)>

Encode arguments into a vector.

§Safety

This can encode references into the vector. The caller must ensure that the guard is dropped before any references which have been encoded are no longer alive.

Source

fn count(&self) -> usize

The number of arguments.

Implementations on Foreign Types§

Source§

impl GuardedArgs for ()

Source§

type Guard = ()

Source§

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

Source§

unsafe fn guarded_into_vec(self) -> VmResult<(Vec<Value>, Self::Guard)>

Source§

fn count(&self) -> usize

Source§

impl GuardedArgs for Vec<Value>

Source§

type Guard = ()

Source§

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

Source§

unsafe fn guarded_into_vec(self) -> VmResult<(Vec<Value>, Self::Guard)>

Source§

fn count(&self) -> usize

Source§

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

Source§

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

Source§

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

Source§

unsafe fn guarded_into_vec(self) -> VmResult<(Vec<Value>, Self::Guard)>

Source§

fn count(&self) -> usize

Source§

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

Source§

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

Source§

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

Source§

unsafe fn guarded_into_vec(self) -> VmResult<(Vec<Value>, Self::Guard)>

Source§

fn count(&self) -> usize

Source§

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

Source§

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

Source§

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

Source§

unsafe fn guarded_into_vec(self) -> VmResult<(Vec<Value>, Self::Guard)>

Source§

fn count(&self) -> usize

Source§

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

Source§

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

Source§

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

Source§

unsafe fn guarded_into_vec(self) -> VmResult<(Vec<Value>, Self::Guard)>

Source§

fn count(&self) -> usize

Source§

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

Source§

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 guarded_into_stack(self, stack: &mut Stack) -> VmResult<Self::Guard>

Source§

unsafe fn guarded_into_vec(self) -> VmResult<(Vec<Value>, Self::Guard)>

Source§

fn count(&self) -> usize

Source§

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

Source§

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 guarded_into_stack(self, stack: &mut Stack) -> VmResult<Self::Guard>

Source§

unsafe fn guarded_into_vec(self) -> VmResult<(Vec<Value>, 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)

Source§

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 guarded_into_stack(self, stack: &mut Stack) -> VmResult<Self::Guard>

Source§

unsafe fn guarded_into_vec(self) -> VmResult<(Vec<Value>, 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)

Source§

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 guarded_into_stack(self, stack: &mut Stack) -> VmResult<Self::Guard>

Source§

unsafe fn guarded_into_vec(self) -> VmResult<(Vec<Value>, 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)

Source§

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 guarded_into_stack(self, stack: &mut Stack) -> VmResult<Self::Guard>

Source§

unsafe fn guarded_into_vec(self) -> VmResult<(Vec<Value>, 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)

Source§

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 guarded_into_stack(self, stack: &mut Stack) -> VmResult<Self::Guard>

Source§

unsafe fn guarded_into_vec(self) -> VmResult<(Vec<Value>, 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)

Source§

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 guarded_into_stack(self, stack: &mut Stack) -> VmResult<Self::Guard>

Source§

unsafe fn guarded_into_vec(self) -> VmResult<(Vec<Value>, 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)

Source§

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 guarded_into_stack(self, stack: &mut Stack) -> VmResult<Self::Guard>

Source§

unsafe fn guarded_into_vec(self) -> VmResult<(Vec<Value>, 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)

Source§

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 guarded_into_stack(self, stack: &mut Stack) -> VmResult<Self::Guard>

Source§

unsafe fn guarded_into_vec(self) -> VmResult<(Vec<Value>, 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)

Source§

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 guarded_into_stack(self, stack: &mut Stack) -> VmResult<Self::Guard>

Source§

unsafe fn guarded_into_vec(self) -> VmResult<(Vec<Value>, 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)

Source§

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 guarded_into_stack(self, stack: &mut Stack) -> VmResult<Self::Guard>

Source§

unsafe fn guarded_into_vec(self) -> VmResult<(Vec<Value>, 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)

Source§

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 guarded_into_stack(self, stack: &mut Stack) -> VmResult<Self::Guard>

Source§

unsafe fn guarded_into_vec(self) -> VmResult<(Vec<Value>, Self::Guard)>

Source§

fn count(&self) -> usize

Implementors§

Source§

impl GuardedArgs for rune::alloc::Vec<Value>