Skip to main content

FromArgs

Trait FromArgs 

Source
pub trait FromArgs: Sized {
    const PARAMS: Option<&'static [Param]> = None;

    // Required method
    fn from_args(
        vm: &VirtualMachine,
        args: &mut FuncArgs,
    ) -> Result<Self, ArgumentError>;

    // Provided method
    fn arity() -> RangeInclusive<usize> ⓘ { ... }
}
Expand description

Implemented by any type that can be accepted as a parameter to a built-in function.

Provided Associated Constants§

Source

const PARAMS: Option<&'static [Param]> = None

Parameters this type contributes to a text signature.

None: the argument is one positional-only parameter, named by the function argument. Some(&[]): the argument contributes nothing. Some(params): the type supplies those parameters and the argument name is ignored.

Required Methods§

Source

fn from_args( vm: &VirtualMachine, args: &mut FuncArgs, ) -> Result<Self, ArgumentError>

Extracts this item from the next argument(s).

Provided Methods§

Source

fn arity() -> RangeInclusive<usize> ⓘ

The range of positional arguments permitted by the function signature.

Returns an empty range if not applicable.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl FromArgs for ()

Source§

const PARAMS: Option<&'static [Param]>

Source§

fn from_args( _vm: &VirtualMachine, _args: &mut FuncArgs, ) -> Result<Self, ArgumentError>

Source§

impl<A, B, C, D, E, F, G, H> FromArgs for (A, B, C, D, E, F, G, H)
where A: FromArgs, B: FromArgs, C: FromArgs, D: FromArgs, E: FromArgs, F: FromArgs, G: FromArgs, H: FromArgs,

Source§

impl<A, B, C, D, E, F, G> FromArgs for (A, B, C, D, E, F, G)
where A: FromArgs, B: FromArgs, C: FromArgs, D: FromArgs, E: FromArgs, F: FromArgs, G: FromArgs,

Source§

impl<A, B, C, D, E, F> FromArgs for (A, B, C, D, E, F)
where A: FromArgs, B: FromArgs, C: FromArgs, D: FromArgs, E: FromArgs, F: FromArgs,

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl<A> FromArgs for (A,)
where A: FromArgs,

Implementors§

Source§

impl FromArgs for FuncArgs

Source§

const PARAMS: Option<&'static [Param]>

Source§

impl FromArgs for OpenArgs

Source§

const PARAMS: Option<&'static [Param]>

Source§

impl FromArgs for OptionalRangeArgs

Source§

const PARAMS: Option<&'static [Param]>

Source§

impl FromArgs for PositionalIterable

Source§

const PARAMS: Option<&'static [Param]>

Source§

impl FromArgs for StructSequenceNewArgs

Source§

const PARAMS: Option<&'static [Param]>

Source§

impl FromArgs for TargetIsDirectory

Source§

const PARAMS: Option<&'static [Param]>

Source§

impl FromArgs for WeakProxyNewArgs

Source§

const PARAMS: Option<&'static [Param]>

Source§

impl<T, Name: ArgName> FromArgs for KwArgs<T, Name>
where T: TryFromObject,

Source§

const PARAMS: Option<&'static [Param]>

Source§

impl<T, Name: ArgName> FromArgs for PosArgs<T, Name>
where T: TryFromObject,

Source§

const PARAMS: Option<&'static [Param]>

Source§

impl<T> FromArgs for OptionalArg<T>
where T: TryFromObject,

Source§

const PARAMS: Option<&'static [Param]>

Source§

impl<T> FromArgs for T
where T: TryFromObject,

Source§

impl<const AVAILABLE: usize, KW: DirFdKeyword> FromArgs for DirFd<'_, AVAILABLE, KW>

Source§

const PARAMS: Option<&'static [Param]>