Skip to main content

DataPointType

Trait DataPointType 

Source
pub trait DataPointType:
    Clone
    + Send
    + Sync
    + 'static {
    // Required methods
    fn data_type() -> DataType;
    fn from_value(value: &Value) -> Option<Self>;
    fn to_value(&self) -> Value;
    fn type_name() -> &'static str;
}
Expand description

A trait for types that can be stored in data points.

Required Methods§

Source

fn data_type() -> DataType

The data type enum variant for this type.

Source

fn from_value(value: &Value) -> Option<Self>

Convert from Value.

Source

fn to_value(&self) -> Value

Convert to Value.

Source

fn type_name() -> &'static str

Get the type name.

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

Source§

impl DataPointType for f32

Source§

impl DataPointType for f64

Source§

impl DataPointType for i32

Source§

impl DataPointType for i64

Source§

impl DataPointType for u32

Source§

impl DataPointType for u64

Source§

impl DataPointType for String

Implementors§