Skip to main content

ParameterVariant

Trait ParameterVariant 

Source
pub trait ParameterVariant: Clone {
    // Required methods
    fn to_parameter_value(&self) -> ParameterValue;
    fn from_parameter_value(value: &ParameterValue) -> Option<Self>;
    fn parameter_type() -> ParameterType;
}
Expand description

Trait for types that can be used as typed parameters

This trait provides conversions between Rust types and ParameterValue, enabling type-safe parameter access.

Required Methods§

Source

fn to_parameter_value(&self) -> ParameterValue

Convert this type to a ParameterValue

Source

fn from_parameter_value(value: &ParameterValue) -> Option<Self>

Try to extract this type from a ParameterValue

Source

fn parameter_type() -> ParameterType

Get the expected parameter type

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 ParameterVariant for bool

Source§

impl ParameterVariant for f64

Source§

impl ParameterVariant for i64

Source§

impl ParameterVariant for String

Available on crate feature std only.
Source§

impl ParameterVariant for Vec<bool>

Available on crate feature std only.
Source§

impl ParameterVariant for Vec<f64>

Available on crate feature std only.
Source§

impl ParameterVariant for Vec<i64>

Available on crate feature std only.
Source§

impl ParameterVariant for Vec<String>

Available on crate feature std only.

Implementors§