pub trait FunctionArg {
    // Required method
    fn to_datatype(type_map: &mut TypeMap) -> Option<DataType>;
}
Available on crate feature function only.
Expand description

Implemented by types that can be used as an argument in a function annotated with specta.

Required Methods§

source

fn to_datatype(type_map: &mut TypeMap) -> Option<DataType>

Gets the type of an argument as a DataType.

Some argument types should be ignored (eg. when doing dependency injection), so the value is optional.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T: Type> FunctionArg for T