[][src]Trait glsp::ToCallArgs

pub trait ToCallArgs: Sealed {
    fn arg_count(&self) -> usize;
fn to_call_args<E>(&self, dst: &mut E) -> Result<(), GError>
    where
        E: Extend<Slot>
; }

A type which can be converted into the arguments to a function call.

It's not possible to implement this trait for your own types, but it's implemented for tuples and vectors of various sizes, when their elements all implement ToVal.

Functions like glsp:call and Obj::call are generic over this trait. They usually define their arguments as &T where T: ToCallArgs, so tuples of arguments will need to be passed by reference:

let push_rfn: RFn = glsp::global("push!");
glsp::call(&push_rfn, &(my_arr, 100i32))?;

Required methods

fn arg_count(&self) -> usize

fn to_call_args<E>(&self, dst: &mut E) -> Result<(), GError> where
    E: Extend<Slot>, 

Loading content...

Implementations on Foreign Types

impl<T> ToCallArgs for [T; 3] where
    T: ToVal
[src]

impl<A, B, C, D, E, F, G, H, I> ToCallArgs for (A, B, C, D, E, F, G, H, I) where
    A: ToVal,
    B: ToVal,
    C: ToVal,
    D: ToVal,
    E: ToVal,
    F: ToVal,
    G: ToVal,
    H: ToVal,
    I: ToVal
[src]

impl<T> ToCallArgs for [T; 0][src]

impl<T> ToCallArgs for [T; 7] where
    T: ToVal
[src]

impl<A, B, C, D, E, F, G> ToCallArgs for (A, B, C, D, E, F, G) where
    A: ToVal,
    B: ToVal,
    C: ToVal,
    D: ToVal,
    E: ToVal,
    F: ToVal,
    G: ToVal
[src]

impl<T> ToCallArgs for [T; 4] where
    T: ToVal
[src]

impl<A, B, C, D, E, F, G, H> ToCallArgs for (A, B, C, D, E, F, G, H) where
    A: ToVal,
    B: ToVal,
    C: ToVal,
    D: ToVal,
    E: ToVal,
    F: ToVal,
    G: ToVal,
    H: ToVal
[src]

impl<A, B, C, D> ToCallArgs for (A, B, C, D) where
    A: ToVal,
    B: ToVal,
    C: ToVal,
    D: ToVal
[src]

impl<T> ToCallArgs for [T; 1] where
    T: ToVal
[src]

impl<A, B, C> ToCallArgs for (A, B, C) where
    A: ToVal,
    B: ToVal,
    C: ToVal
[src]

impl<T> ToCallArgs for [T; 6] where
    T: ToVal
[src]

impl<A, B, C, D, E, F> ToCallArgs for (A, B, C, D, E, F) where
    A: ToVal,
    B: ToVal,
    C: ToVal,
    D: ToVal,
    E: ToVal,
    F: ToVal
[src]

impl<T> ToCallArgs for [T; 9] where
    T: ToVal
[src]

impl<A, B, C, D, E> ToCallArgs for (A, B, C, D, E) where
    A: ToVal,
    B: ToVal,
    C: ToVal,
    D: ToVal,
    E: ToVal
[src]

impl<T> ToCallArgs for [T; 10] where
    T: ToVal
[src]

impl<T> ToCallArgs for [T; 11] where
    T: ToVal
[src]

impl<A, B, C, D, E, F, G, H, I, J, K> ToCallArgs for (A, B, C, D, E, F, G, H, I, J, K) where
    A: ToVal,
    B: ToVal,
    C: ToVal,
    D: ToVal,
    E: ToVal,
    F: ToVal,
    G: ToVal,
    H: ToVal,
    I: ToVal,
    J: ToVal,
    K: ToVal
[src]

impl<T> ToCallArgs for [T; 5] where
    T: ToVal
[src]

impl<T> ToCallArgs for [T; 12] where
    T: ToVal
[src]

impl ToCallArgs for ()[src]

impl<A, B> ToCallArgs for (A, B) where
    A: ToVal,
    B: ToVal
[src]

impl<T> ToCallArgs for [T] where
    T: ToVal
[src]

impl<A> ToCallArgs for (A,) where
    A: ToVal
[src]

impl<T> ToCallArgs for [T; 2] where
    T: ToVal
[src]

impl<A, B, C, D, E, F, G, H, I, J> ToCallArgs for (A, B, C, D, E, F, G, H, I, J) where
    A: ToVal,
    B: ToVal,
    C: ToVal,
    D: ToVal,
    E: ToVal,
    F: ToVal,
    G: ToVal,
    H: ToVal,
    I: ToVal,
    J: ToVal
[src]

impl<T> ToCallArgs for [T; 8] where
    T: ToVal
[src]

impl<A, B, C, D, E, F, G, H, I, J, K, L> ToCallArgs for (A, B, C, D, E, F, G, H, I, J, K, L) where
    A: ToVal,
    B: ToVal,
    C: ToVal,
    D: ToVal,
    E: ToVal,
    F: ToVal,
    G: ToVal,
    H: ToVal,
    I: ToVal,
    J: ToVal,
    K: ToVal,
    L: ToVal
[src]

Loading content...

Implementors

Loading content...