Trait grafana_plugin_sdk::data::IntoFieldType
source · pub trait IntoFieldType {
type ElementType;
const TYPE_INFO_TYPE: TypeInfoType;
// Required method
fn into_field_type(self) -> Option<Self::ElementType>;
}
Expand description
Indicates that a type can be converted to one that is FieldType
, and holds associated metadata.
For example, DateTime<T>
s are valid Field
values, but must first be converted
to nanoseconds-since-the-epoch in i64 values; the original type and corresponding
TypeInfoType
is stored here.
This trait mainly exists to enable smoother APIs when creating Field
s.
Required Associated Types§
sourcetype ElementType
type ElementType
The type to which Self
will be converted when storing values in a Field
.
Required Associated Constants§
sourceconst TYPE_INFO_TYPE: TypeInfoType
const TYPE_INFO_TYPE: TypeInfoType
The corresponding TypeInfoType
for this original data type.
Required Methods§
sourcefn into_field_type(self) -> Option<Self::ElementType>
fn into_field_type(self) -> Option<Self::ElementType>
Convert this type into an (optional) field type.
Object Safety§
This trait is not object safe.