[][src]Enum serde_prometheus::Error

pub enum Error {
    Serde {
        context: String,
    },
    Io {
        context: Error,
    },
    NoMetricName,
    MapKeyMustBeString,
    LabelsMustBeMap,
    LabelKeyNotInFormat,
    LabelValueMustBeString,
    UnsupportedValue {
        kind: String,
    },
    MetricNameMustBeUtf8 {
        source: Utf8Error,
    },
    MetricNameNotInFormat {
        kind: String,
    },
    MetricValueMustBeNumeric {
        kind: String,
    },
    UnknownHint,
    InvalidLabel,
    InvalidModifier,
}

Variants

Serde

An error thrown by the serde::Serialize trait on a type. This error is thrown from outside of this crate, most likely from within serde for a std library type.

Fields of Serde

context: String
Io

A stdlib io error occurred whilst writing the serialized data out.

Fields of Io

context: Error
NoMetricName

The value attempting to be serialised does not belong to any metric, try serialising this value as a struct member or in a map.

MapKeyMustBeString

Thrown when serializing in a map that doesn't contain string keys.

LabelsMustBeMap

Caused by attempting to serialize labels from a format other than a map.

LabelKeyNotInFormat

Thrown when attempting to serialize a label which doesn't conform to the format defined here.

LabelValueMustBeString

Thrown when serializing a label map that doesn't use string values.

UnsupportedValue

Thrown when the main serializer encounters a value that isn't supported, value can only contain maps that contain numbers, or other structs that when followed, only lead to numbers.

Fields of UnsupportedValue

kind: String
MetricNameMustBeUtf8

UTF-8 error when attempting to serialize strings passed in by client.

Fields of MetricNameMustBeUtf8

source: Utf8Error
MetricNameNotInFormat

Thrown when attempting to serialize a metric name which doesn't conform to the format defined here.

Fields of MetricNameNotInFormat

kind: String
MetricValueMustBeNumeric

Thrown when attempting to serialize a metric value that isn't a stdlib numeric type.

Fields of MetricValueMustBeNumeric

kind: String
UnknownHint

Attempted to 'hint' that a value is a type that isn't defined in crate::TypeHint

InvalidLabel

Labels, when being passed to the serializer, must be in the format of key1=val1,key2=val2

InvalidModifier

A key modifier was passed that isn't recognised. See crate::Serializer::serialize_newtype_struct for recognised modifiers.

Trait Implementations

impl Debug for Error[src]

impl Display for Error[src]

impl Error for Error where
    Self: Debug + Display
[src]

impl Error for Error[src]

impl ErrorCompat for Error[src]

impl From<Error> for Error[src]

Auto Trait Implementations

impl !RefUnwindSafe for Error

impl Send for Error

impl Sync for Error

impl Unpin for Error

impl !UnwindSafe for Error

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> AsErrorSource for T where
    T: 'static + Error
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.