Trait FromArgs

Source
pub trait FromArgs<'a>: Sized {
    // Required method
    fn from_args(args: &'a Args, index: usize) -> Result<Self, KclError>;
}
Expand description

Types which impl this trait can be read out of the Args passed into a KCL function.

Required Methods§

Source

fn from_args(args: &'a Args, index: usize) -> Result<Self, KclError>

Get this type from the args passed into a KCL function, at the given index in the argument list.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'a, A, B> FromArgs<'a> for (A, B)
where A: FromArgs<'a>, B: FromArgs<'a>,

Source§

fn from_args(args: &'a Args, i: usize) -> Result<Self, KclError>

Source§

impl<'a, A, B, C> FromArgs<'a> for (A, B, C)
where A: FromArgs<'a>, B: FromArgs<'a>, C: FromArgs<'a>,

Source§

fn from_args(args: &'a Args, i: usize) -> Result<Self, KclError>

Source§

impl<'a, A, B, C, D> FromArgs<'a> for (A, B, C, D)
where A: FromArgs<'a>, B: FromArgs<'a>, C: FromArgs<'a>, D: FromArgs<'a>,

Source§

fn from_args(args: &'a Args, i: usize) -> Result<Self, KclError>

Source§

impl<'a, T> FromArgs<'a> for Option<T>
where T: FromKclValue<'a> + Sized,

Source§

fn from_args(args: &'a Args, i: usize) -> Result<Self, KclError>

Implementors§

Source§

impl<'a, T> FromArgs<'a> for T
where T: FromKclValue<'a> + Sized,