Enum grafana_plugin_sdk::data::ValueMapping
source · #[non_exhaustive]pub enum ValueMapping {
ValueMapper(HashMap<String, ValueMappingResult>),
SpecialValueMapper {
match_: SpecialValueMatch,
result: ValueMappingResult,
},
RangeValueMapper {
from: ConfFloat64,
to: ConfFloat64,
result: ValueMappingResult,
},
}
Expand description
Allows input values to be mapped to text and colour.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
ValueMapper(HashMap<String, ValueMappingResult>)
Map strings to new strings directly.
SpecialValueMapper
Fields
§
match_: SpecialValueMatch
The input value to match.
§
result: ValueMappingResult
The result to be shown instead of the matched value.
Map special values to new values.
RangeValueMapper
Fields
§
from: ConfFloat64
The minimum value to match.
§
to: ConfFloat64
The maximum value to match.
§
result: ValueMappingResult
The result to be shown instead of the matched values.
Map ranges of floats to new values.
Trait Implementations§
source§impl Clone for ValueMapping
impl Clone for ValueMapping
source§fn clone(&self) -> ValueMapping
fn clone(&self) -> ValueMapping
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ValueMapping
impl Debug for ValueMapping
source§impl<'de> Deserialize<'de> for ValueMapping
impl<'de> Deserialize<'de> for ValueMapping
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for ValueMapping
impl PartialEq for ValueMapping
source§fn eq(&self, other: &ValueMapping) -> bool
fn eq(&self, other: &ValueMapping) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for ValueMapping
impl Serialize for ValueMapping
impl StructuralPartialEq for ValueMapping
Auto Trait Implementations§
impl RefUnwindSafe for ValueMapping
impl Send for ValueMapping
impl Sync for ValueMapping
impl Unpin for ValueMapping
impl UnwindSafe for ValueMapping
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request