/// Create args from a Value.
///
/// The value may be a list of arguments or a single argument.
Create args from a Value.
The value may be a list of arguments or a single argument.
Create args from a Value . The value may be a list of arguments or a single argument .
pub fn from_value(v: Value) -> Result<Self, Error> {
        match v {
            Value::ArgList(args) => Ok(args),
            Value::List(v, Some(ListSeparator::Comma), false) => {
                Ok(CallArgs {
                    positional: v,
                    ..Default::default()
                })
            }
            Value::Map(args) => {
                let mut result = CallArgs::default();
                result.add_from_value_map(args)?;
                Ok(result)
            }
            Value::Null => Ok(Default::default()),
            v => Ok(CallArgs {
                positional: vec![v],
                ..Default::default()
            }),
        }
    }
pub fn from_value ( v : Value ) -> Result < Self , Error > { match v { Value :: ArgList ( args ) => Ok ( args ) , Value :: List ( v , Some ( ListSeparator :: Comma ) , false ) => { Ok ( CallArgs { positional : v , .. Default :: default ( ) } ) } Value :: Map ( args ) => { let mut result = CallArgs :: default ( ) ; result . add_from_value_map ( args ) ? ; Ok ( result ) } Value :: Null => Ok ( Default :: default ( ) ) , v => Ok ( CallArgs { positional : vec ! [ v ] , .. Default :: default ( ) } ) , } }
Create args from a Value.
Create args from a Value .
v
Value