[−][src]Trait glsp::ToCallArgs
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>,
E: Extend<Slot>,
Implementations on Foreign Types
impl<T> ToCallArgs for [T; 6] where
T: ToVal,
[src]
T: ToVal,
fn arg_count(&self) -> usize
[src]
fn to_call_args<E>(&self, dst: &mut E) -> Result<(), GError> where
E: Extend<Slot>,
[src]
E: Extend<Slot>,
impl<A, B> ToCallArgs for (A, B) where
A: ToVal,
B: ToVal,
[src]
A: ToVal,
B: ToVal,
fn arg_count(&self) -> usize
[src]
fn to_call_args<EE>(&self, dst: &mut EE) -> Result<(), GError> where
EE: Extend<Slot>,
[src]
EE: Extend<Slot>,
impl<T> ToCallArgs for [T; 10] where
T: ToVal,
[src]
T: ToVal,
fn arg_count(&self) -> usize
[src]
fn to_call_args<E>(&self, dst: &mut E) -> Result<(), GError> where
E: Extend<Slot>,
[src]
E: Extend<Slot>,
impl<T> ToCallArgs for [T; 9] where
T: ToVal,
[src]
T: ToVal,
fn arg_count(&self) -> usize
[src]
fn to_call_args<E>(&self, dst: &mut E) -> Result<(), GError> where
E: Extend<Slot>,
[src]
E: Extend<Slot>,
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]
A: ToVal,
B: ToVal,
C: ToVal,
D: ToVal,
E: ToVal,
F: ToVal,
G: ToVal,
H: ToVal,
I: ToVal,
fn arg_count(&self) -> usize
[src]
fn to_call_args<EE>(&self, dst: &mut EE) -> Result<(), GError> where
EE: Extend<Slot>,
[src]
EE: Extend<Slot>,
impl<T> ToCallArgs for [T; 7] where
T: ToVal,
[src]
T: ToVal,
fn arg_count(&self) -> usize
[src]
fn to_call_args<E>(&self, dst: &mut E) -> Result<(), GError> where
E: Extend<Slot>,
[src]
E: Extend<Slot>,
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]
A: ToVal,
B: ToVal,
C: ToVal,
D: ToVal,
E: ToVal,
F: ToVal,
G: ToVal,
H: ToVal,
I: ToVal,
J: ToVal,
fn arg_count(&self) -> usize
[src]
fn to_call_args<EE>(&self, dst: &mut EE) -> Result<(), GError> where
EE: Extend<Slot>,
[src]
EE: Extend<Slot>,
impl<T> ToCallArgs for [T; 0]
[src]
fn arg_count(&self) -> usize
[src]
fn to_call_args<E>(&self, _dst: &mut E) -> Result<(), GError> where
E: Extend<Slot>,
[src]
E: Extend<Slot>,
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]
A: ToVal,
B: ToVal,
C: ToVal,
D: ToVal,
E: ToVal,
F: ToVal,
G: ToVal,
fn arg_count(&self) -> usize
[src]
fn to_call_args<EE>(&self, dst: &mut EE) -> Result<(), GError> where
EE: Extend<Slot>,
[src]
EE: Extend<Slot>,
impl<A, B, C> ToCallArgs for (A, B, C) where
A: ToVal,
B: ToVal,
C: ToVal,
[src]
A: ToVal,
B: ToVal,
C: ToVal,
fn arg_count(&self) -> usize
[src]
fn to_call_args<EE>(&self, dst: &mut EE) -> Result<(), GError> where
EE: Extend<Slot>,
[src]
EE: Extend<Slot>,
impl<A> ToCallArgs for (A,) where
A: ToVal,
[src]
A: ToVal,
fn arg_count(&self) -> usize
[src]
fn to_call_args<EE>(&self, dst: &mut EE) -> Result<(), GError> where
EE: Extend<Slot>,
[src]
EE: Extend<Slot>,
impl<A, B, C, D> ToCallArgs for (A, B, C, D) where
A: ToVal,
B: ToVal,
C: ToVal,
D: ToVal,
[src]
A: ToVal,
B: ToVal,
C: ToVal,
D: ToVal,
fn arg_count(&self) -> usize
[src]
fn to_call_args<EE>(&self, dst: &mut EE) -> Result<(), GError> where
EE: Extend<Slot>,
[src]
EE: Extend<Slot>,
impl ToCallArgs for ()
[src]
fn arg_count(&self) -> usize
[src]
fn to_call_args<E>(&self, _dst: &mut E) -> Result<(), GError> where
E: Extend<Slot>,
[src]
E: Extend<Slot>,
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]
A: ToVal,
B: ToVal,
C: ToVal,
D: ToVal,
E: ToVal,
F: ToVal,
G: ToVal,
H: ToVal,
I: ToVal,
J: ToVal,
K: ToVal,
L: ToVal,
fn arg_count(&self) -> usize
[src]
fn to_call_args<EE>(&self, dst: &mut EE) -> Result<(), GError> where
EE: Extend<Slot>,
[src]
EE: Extend<Slot>,
impl<T> ToCallArgs for [T; 2] where
T: ToVal,
[src]
T: ToVal,
fn arg_count(&self) -> usize
[src]
fn to_call_args<E>(&self, dst: &mut E) -> Result<(), GError> where
E: Extend<Slot>,
[src]
E: Extend<Slot>,
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]
A: ToVal,
B: ToVal,
C: ToVal,
D: ToVal,
E: ToVal,
fn arg_count(&self) -> usize
[src]
fn to_call_args<EE>(&self, dst: &mut EE) -> Result<(), GError> where
EE: Extend<Slot>,
[src]
EE: Extend<Slot>,
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]
A: ToVal,
B: ToVal,
C: ToVal,
D: ToVal,
E: ToVal,
F: ToVal,
fn arg_count(&self) -> usize
[src]
fn to_call_args<EE>(&self, dst: &mut EE) -> Result<(), GError> where
EE: Extend<Slot>,
[src]
EE: Extend<Slot>,
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]
A: ToVal,
B: ToVal,
C: ToVal,
D: ToVal,
E: ToVal,
F: ToVal,
G: ToVal,
H: ToVal,
fn arg_count(&self) -> usize
[src]
fn to_call_args<EE>(&self, dst: &mut EE) -> Result<(), GError> where
EE: Extend<Slot>,
[src]
EE: Extend<Slot>,
impl<T> ToCallArgs for [T; 5] where
T: ToVal,
[src]
T: ToVal,
fn arg_count(&self) -> usize
[src]
fn to_call_args<E>(&self, dst: &mut E) -> Result<(), GError> where
E: Extend<Slot>,
[src]
E: Extend<Slot>,
impl<T> ToCallArgs for [T; 11] where
T: ToVal,
[src]
T: ToVal,
fn arg_count(&self) -> usize
[src]
fn to_call_args<E>(&self, dst: &mut E) -> Result<(), GError> where
E: Extend<Slot>,
[src]
E: Extend<Slot>,
impl<T> ToCallArgs for [T; 1] where
T: ToVal,
[src]
T: ToVal,
fn arg_count(&self) -> usize
[src]
fn to_call_args<E>(&self, dst: &mut E) -> Result<(), GError> where
E: Extend<Slot>,
[src]
E: Extend<Slot>,
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]
A: ToVal,
B: ToVal,
C: ToVal,
D: ToVal,
E: ToVal,
F: ToVal,
G: ToVal,
H: ToVal,
I: ToVal,
J: ToVal,
K: ToVal,
fn arg_count(&self) -> usize
[src]
fn to_call_args<EE>(&self, dst: &mut EE) -> Result<(), GError> where
EE: Extend<Slot>,
[src]
EE: Extend<Slot>,
impl<T> ToCallArgs for [T; 12] where
T: ToVal,
[src]
T: ToVal,
fn arg_count(&self) -> usize
[src]
fn to_call_args<E>(&self, dst: &mut E) -> Result<(), GError> where
E: Extend<Slot>,
[src]
E: Extend<Slot>,
impl<T> ToCallArgs for [T; 4] where
T: ToVal,
[src]
T: ToVal,
fn arg_count(&self) -> usize
[src]
fn to_call_args<E>(&self, dst: &mut E) -> Result<(), GError> where
E: Extend<Slot>,
[src]
E: Extend<Slot>,
impl<T> ToCallArgs for [T; 3] where
T: ToVal,
[src]
T: ToVal,
fn arg_count(&self) -> usize
[src]
fn to_call_args<E>(&self, dst: &mut E) -> Result<(), GError> where
E: Extend<Slot>,
[src]
E: Extend<Slot>,
impl<T> ToCallArgs for [T] where
T: ToVal,
[src]
T: ToVal,
fn arg_count(&self) -> usize
[src]
fn to_call_args<E>(&self, dst: &mut E) -> Result<(), GError> where
E: Extend<Slot>,
[src]
E: Extend<Slot>,
impl<T> ToCallArgs for [T; 8] where
T: ToVal,
[src]
T: ToVal,
fn arg_count(&self) -> usize
[src]
fn to_call_args<E>(&self, dst: &mut E) -> Result<(), GError> where
E: Extend<Slot>,
[src]
E: Extend<Slot>,