Trait magnus::ArgList

source ·
pub trait ArgList {
    type Value: ReprValue;
    type Output: AsRef<[Self::Value]>;

    // Required methods
    fn into_arg_list_with(self, handle: &Ruby) -> Self::Output;
    fn contains_kw_args(&self) -> bool;
}
Expand description

Trait for types that can be used as an arguments list when calling Ruby methods.

Required Associated Types§

source

type Value: ReprValue

The specific Ruby value type.

source

type Output: AsRef<[Self::Value]>

The type of the arguments list. Must convert to &[Self::Value] with AsRef.

Required Methods§

source

fn into_arg_list_with(self, handle: &Ruby) -> Self::Output

Convert self into a type that can be used as a Ruby argument list.

source

fn contains_kw_args(&self) -> bool

Whether the argument list contains keyword arguments. If true, the last element of the &[Self::Value] produced by Self::into_arg_list_with and AsRef must be a RHash

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl ArgList for (KwArgs,)

§

type Value = Value

§

type Output = [<(KwArgs,) as ArgList>::Value; 1]

source§

fn into_arg_list_with(self, handle: &Ruby) -> Self::Output

source§

fn contains_kw_args(&self) -> bool

source§

impl ArgList for ()

§

type Value = Value

§

type Output = [<() as ArgList>::Value; 0]

source§

fn into_arg_list_with(self, handle: &Ruby) -> Self::Output

source§

fn contains_kw_args(&self) -> bool

source§

impl<'a, T> ArgList for &'a [T]
where T: ReprValue,

§Safety

The implmentation of ArgList for slices is not intended to suggest that it is valid to build a Vec of Ruby values to then convert to a slice. Ruby values should never be put into a Vec.

§

type Value = T

§

type Output = &'a [<&'a [T] as ArgList>::Value]

source§

fn into_arg_list_with(self, _: &Ruby) -> Self::Output

source§

fn contains_kw_args(&self) -> bool

source§

impl<T0> ArgList for (T0, KwArgs)
where T0: IntoValue,

§

type Value = Value

§

type Output = [<(T0, KwArgs) as ArgList>::Value; 2]

source§

fn into_arg_list_with(self, handle: &Ruby) -> Self::Output

source§

fn contains_kw_args(&self) -> bool

source§

impl<T0> ArgList for (T0,)
where T0: IntoValue,

§

type Value = Value

§

type Output = [<(T0,) as ArgList>::Value; 1]

source§

fn into_arg_list_with(self, handle: &Ruby) -> Self::Output

source§

fn contains_kw_args(&self) -> bool

source§

impl<T0, T1> ArgList for (T0, T1, KwArgs)
where T0: IntoValue, T1: IntoValue,

§

type Value = Value

§

type Output = [<(T0, T1, KwArgs) as ArgList>::Value; 3]

source§

fn into_arg_list_with(self, handle: &Ruby) -> Self::Output

source§

fn contains_kw_args(&self) -> bool

source§

impl<T0, T1> ArgList for (T0, T1)
where T0: IntoValue, T1: IntoValue,

§

type Value = Value

§

type Output = [<(T0, T1) as ArgList>::Value; 2]

source§

fn into_arg_list_with(self, handle: &Ruby) -> Self::Output

source§

fn contains_kw_args(&self) -> bool

source§

impl<T0, T1, T2> ArgList for (T0, T1, T2, KwArgs)
where T0: IntoValue, T1: IntoValue, T2: IntoValue,

§

type Value = Value

§

type Output = [<(T0, T1, T2, KwArgs) as ArgList>::Value; 4]

source§

fn into_arg_list_with(self, handle: &Ruby) -> Self::Output

source§

fn contains_kw_args(&self) -> bool

source§

impl<T0, T1, T2> ArgList for (T0, T1, T2)
where T0: IntoValue, T1: IntoValue, T2: IntoValue,

source§

impl<T0, T1, T2, T3> ArgList for (T0, T1, T2, T3, KwArgs)
where T0: IntoValue, T1: IntoValue, T2: IntoValue, T3: IntoValue,

§

type Value = Value

§

type Output = [<(T0, T1, T2, T3, KwArgs) as ArgList>::Value; 5]

source§

fn into_arg_list_with(self, handle: &Ruby) -> Self::Output

source§

fn contains_kw_args(&self) -> bool

source§

impl<T0, T1, T2, T3> ArgList for (T0, T1, T2, T3)
where T0: IntoValue, T1: IntoValue, T2: IntoValue, T3: IntoValue,

source§

impl<T0, T1, T2, T3, T4> ArgList for (T0, T1, T2, T3, T4, KwArgs)
where T0: IntoValue, T1: IntoValue, T2: IntoValue, T3: IntoValue, T4: IntoValue,

§

type Value = Value

§

type Output = [<(T0, T1, T2, T3, T4, KwArgs) as ArgList>::Value; 6]

source§

fn into_arg_list_with(self, handle: &Ruby) -> Self::Output

source§

fn contains_kw_args(&self) -> bool

source§

impl<T0, T1, T2, T3, T4> ArgList for (T0, T1, T2, T3, T4)
where T0: IntoValue, T1: IntoValue, T2: IntoValue, T3: IntoValue, T4: IntoValue,

source§

impl<T0, T1, T2, T3, T4, T5> ArgList for (T0, T1, T2, T3, T4, T5, KwArgs)
where T0: IntoValue, T1: IntoValue, T2: IntoValue, T3: IntoValue, T4: IntoValue, T5: IntoValue,

§

type Value = Value

§

type Output = [<(T0, T1, T2, T3, T4, T5, KwArgs) as ArgList>::Value; 7]

source§

fn into_arg_list_with(self, handle: &Ruby) -> Self::Output

source§

fn contains_kw_args(&self) -> bool

source§

impl<T0, T1, T2, T3, T4, T5> ArgList for (T0, T1, T2, T3, T4, T5)
where T0: IntoValue, T1: IntoValue, T2: IntoValue, T3: IntoValue, T4: IntoValue, T5: IntoValue,

source§

impl<T0, T1, T2, T3, T4, T5, T6> ArgList for (T0, T1, T2, T3, T4, T5, T6, KwArgs)
where T0: IntoValue, T1: IntoValue, T2: IntoValue, T3: IntoValue, T4: IntoValue, T5: IntoValue, T6: IntoValue,

§

type Value = Value

§

type Output = [<(T0, T1, T2, T3, T4, T5, T6, KwArgs) as ArgList>::Value; 8]

source§

fn into_arg_list_with(self, handle: &Ruby) -> Self::Output

source§

fn contains_kw_args(&self) -> bool

source§

impl<T0, T1, T2, T3, T4, T5, T6> ArgList for (T0, T1, T2, T3, T4, T5, T6)
where T0: IntoValue, T1: IntoValue, T2: IntoValue, T3: IntoValue, T4: IntoValue, T5: IntoValue, T6: IntoValue,

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7> ArgList for (T0, T1, T2, T3, T4, T5, T6, T7, KwArgs)
where T0: IntoValue, T1: IntoValue, T2: IntoValue, T3: IntoValue, T4: IntoValue, T5: IntoValue, T6: IntoValue, T7: IntoValue,

§

type Value = Value

§

type Output = [<(T0, T1, T2, T3, T4, T5, T6, T7, KwArgs) as ArgList>::Value; 9]

source§

fn into_arg_list_with(self, handle: &Ruby) -> Self::Output

source§

fn contains_kw_args(&self) -> bool

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7> ArgList for (T0, T1, T2, T3, T4, T5, T6, T7)
where T0: IntoValue, T1: IntoValue, T2: IntoValue, T3: IntoValue, T4: IntoValue, T5: IntoValue, T6: IntoValue, T7: IntoValue,

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8> ArgList for (T0, T1, T2, T3, T4, T5, T6, T7, T8, KwArgs)
where T0: IntoValue, T1: IntoValue, T2: IntoValue, T3: IntoValue, T4: IntoValue, T5: IntoValue, T6: IntoValue, T7: IntoValue, T8: IntoValue,

§

type Value = Value

§

type Output = [<(T0, T1, T2, T3, T4, T5, T6, T7, T8, KwArgs) as ArgList>::Value; 10]

source§

fn into_arg_list_with(self, handle: &Ruby) -> Self::Output

source§

fn contains_kw_args(&self) -> bool

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8> ArgList for (T0, T1, T2, T3, T4, T5, T6, T7, T8)
where T0: IntoValue, T1: IntoValue, T2: IntoValue, T3: IntoValue, T4: IntoValue, T5: IntoValue, T6: IntoValue, T7: IntoValue, T8: IntoValue,

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> ArgList for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, KwArgs)
where T0: IntoValue, T1: IntoValue, T2: IntoValue, T3: IntoValue, T4: IntoValue, T5: IntoValue, T6: IntoValue, T7: IntoValue, T8: IntoValue, T9: IntoValue,

§

type Value = Value

§

type Output = [<(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, KwArgs) as ArgList>::Value; 11]

source§

fn into_arg_list_with(self, handle: &Ruby) -> Self::Output

source§

fn contains_kw_args(&self) -> bool

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> ArgList for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)
where T0: IntoValue, T1: IntoValue, T2: IntoValue, T3: IntoValue, T4: IntoValue, T5: IntoValue, T6: IntoValue, T7: IntoValue, T8: IntoValue, T9: IntoValue,

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ArgList for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, KwArgs)
where T0: IntoValue, T1: IntoValue, T2: IntoValue, T3: IntoValue, T4: IntoValue, T5: IntoValue, T6: IntoValue, T7: IntoValue, T8: IntoValue, T9: IntoValue, T10: IntoValue,

§

type Value = Value

§

type Output = [<(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, KwArgs) as ArgList>::Value; 12]

source§

fn into_arg_list_with(self, handle: &Ruby) -> Self::Output

source§

fn contains_kw_args(&self) -> bool

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ArgList for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)
where T0: IntoValue, T1: IntoValue, T2: IntoValue, T3: IntoValue, T4: IntoValue, T5: IntoValue, T6: IntoValue, T7: IntoValue, T8: IntoValue, T9: IntoValue, T10: IntoValue,

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> ArgList for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, KwArgs)
where T0: IntoValue, T1: IntoValue, T2: IntoValue, T3: IntoValue, T4: IntoValue, T5: IntoValue, T6: IntoValue, T7: IntoValue, T8: IntoValue, T9: IntoValue, T10: IntoValue, T11: IntoValue,

§

type Value = Value

§

type Output = [<(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, KwArgs) as ArgList>::Value; 13]

source§

fn into_arg_list_with(self, handle: &Ruby) -> Self::Output

source§

fn contains_kw_args(&self) -> bool

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> ArgList for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)
where T0: IntoValue, T1: IntoValue, T2: IntoValue, T3: IntoValue, T4: IntoValue, T5: IntoValue, T6: IntoValue, T7: IntoValue, T8: IntoValue, T9: IntoValue, T10: IntoValue, T11: IntoValue,

source§

impl<T, const N: usize> ArgList for [T; N]
where T: ReprValue,

§

type Value = T

§

type Output = [<[T; N] as ArgList>::Value; N]

source§

fn into_arg_list_with(self, _: &Ruby) -> Self::Output

source§

fn contains_kw_args(&self) -> bool

Implementors§