pub struct Decoder { /* private fields */ }Expand description
Decoder for metrics received from an Encoder
Implements MetricsSource to export the decoded metrics to OpenMetrics.
Implementations§
Source§impl Decoder
 
impl Decoder
Sourcepub fn import(&mut self, update: Update)
 
pub fn import(&mut self, update: Update)
Imports a metric update.
Updates the decoder’s schema (if provided) and values with the given update.
Sourcepub fn import_bytes(&mut self, data: &[u8]) -> Result<(), Error>
 
pub fn import_bytes(&mut self, data: &[u8]) -> Result<(), Error>
Imports a metric update from serialized bytes.
Deserializes the bytes using postcard and imports the resulting update.
Sourcepub fn iter(&self) -> DecoderIter<'_> ⓘ
 
pub fn iter(&self) -> DecoderIter<'_> ⓘ
Creates an iterator over the decoded metric items.
Returns an iterator that yields Item instances combining schema and value data.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Decoder
impl RefUnwindSafe for Decoder
impl Send for Decoder
impl Sync for Decoder
impl Unpin for Decoder
impl UnwindSafe for Decoder
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