pub struct JsonEncoder;
Expand description
An implementation of an Encoder
that converts a MetricFamily
proto message
into JSON format.
Implementations§
Source§impl JsonEncoder
impl JsonEncoder
Trait Implementations§
Source§impl Debug for JsonEncoder
impl Debug for JsonEncoder
Source§impl Default for JsonEncoder
impl Default for JsonEncoder
Source§fn default() -> JsonEncoder
fn default() -> JsonEncoder
Returns the “default value” for a type. Read more
Source§impl Encoder for JsonEncoder
impl Encoder for JsonEncoder
Source§fn encode<W: Write>(
&self,
metric_families: &[MetricFamily],
writer: &mut W,
) -> Result<()>
fn encode<W: Write>( &self, metric_families: &[MetricFamily], writer: &mut W, ) -> Result<()>
encode
converts a slice of MetricFamily proto messages into target
format and writes the resulting lines to writer
. This function does not
perform checks on the content of the metrics and label names,
i.e. invalid metrics or label names will result in invalid text format
output.Source§fn format_type(&self) -> &str
fn format_type(&self) -> &str
format_type
returns target format.Auto Trait Implementations§
impl Freeze for JsonEncoder
impl RefUnwindSafe for JsonEncoder
impl Send for JsonEncoder
impl Sync for JsonEncoder
impl Unpin for JsonEncoder
impl UnwindSafe for JsonEncoder
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§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