pub struct ProtobufEncoder;
Expand description
An implementation of an Encoder
that converts a MetricFamily
proto
message into the binary wire format of protobuf.
Implementations§
Source§impl ProtobufEncoder
impl ProtobufEncoder
Sourcepub fn new() -> ProtobufEncoder
pub fn new() -> ProtobufEncoder
Create a new protobuf encoder.
Trait Implementations§
Source§impl Debug for ProtobufEncoder
impl Debug for ProtobufEncoder
Source§impl Default for ProtobufEncoder
impl Default for ProtobufEncoder
Source§fn default() -> ProtobufEncoder
fn default() -> ProtobufEncoder
Returns the “default value” for a type. Read more
Source§impl Encoder for ProtobufEncoder
impl Encoder for ProtobufEncoder
Source§fn encode<W>(
&self,
metric_families: &[MetricFamily],
writer: &mut W,
) -> Result<(), Error>where
W: Write,
fn encode<W>(
&self,
metric_families: &[MetricFamily],
writer: &mut W,
) -> Result<(), Error>where
W: Write,
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 ProtobufEncoder
impl RefUnwindSafe for ProtobufEncoder
impl Send for ProtobufEncoder
impl Sync for ProtobufEncoder
impl Unpin for ProtobufEncoder
impl UnwindSafe for ProtobufEncoder
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