[][src]Struct statsdproto::statsd::StatsdPDU

pub struct StatsdPDU { /* fields omitted */ }

A StatsdPDU is an incoming protocol unit for statsd messages, commonly a single datagram or a line-delimitated message. This PDU type owns an incoming message and can offer references to protocol fields. It only performs limited parsing of the protocol unit.

Implementations

impl StatsdPDU[src]

pub fn name(&self) -> &[u8][src]

pub fn value(&self) -> &[u8][src]

pub fn pdu_type(&self) -> &[u8][src]

pub fn tags(&self) -> Option<&[u8]>[src]

pub fn sample_rate(&self) -> Option<&[u8]>[src]

pub fn len(&self) -> usize[src]

pub fn as_ref(&self) -> &[u8][src]

pub fn with_prefix_suffix(&self, prefix: &[u8], suffix: &[u8]) -> Self[src]

Return a clone of the PDU with a prefix and suffix attached to the statsd name

pub fn new(line: Bytes) -> Option<Self>[src]

Parse an incoming single protocol unit and capture internal field offsets for the positions and lengths of various protocol fields for later access. No parsing or validation of values is done, so at a low level this can be used to pass through unknown types and protocols.

Trait Implementations

impl Clone for StatsdPDU[src]

impl Debug for StatsdPDU[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.