pub struct RMonitorDecoder { /* private fields */ }Expand description
A decoder for RMonitor records, which wraps an underlying LinesCodec
to provide framing logic.
Implementations§
Source§impl RMonitorDecoder
impl RMonitorDecoder
Sourcepub fn new() -> Self
pub fn new() -> Self
Returns an RMonitorDecoder for decoding RMonitor records from a TCP stream.
§Note
The returned RMonitorDecoder will have an underlying LinesCodec with no upper
bound on the length of a buffered line. Consider using new_with_max_length instead.
Sourcepub fn new_with_max_length(max_length: usize) -> Self
pub fn new_with_max_length(max_length: usize) -> Self
Returns an RMonitorDecoder where the underlying LinesCodec has a maximum line length
limit.
It is recommended to set such a limit where the input to be supplied to the decoder is untrusted, as an attacker could send an unbounded amount of input with no newline characters.
Trait Implementations§
Source§impl Debug for RMonitorDecoder
impl Debug for RMonitorDecoder
Source§impl Decoder for RMonitorDecoder
impl Decoder for RMonitorDecoder
Source§type Error = RMonitorCodecError
type Error = RMonitorCodecError
The type of unrecoverable frame decoding errors. Read more
Source§fn decode(
&mut self,
src: &mut BytesMut,
) -> Result<Option<Self::Item>, Self::Error>
fn decode( &mut self, src: &mut BytesMut, ) -> Result<Option<Self::Item>, Self::Error>
Attempts to decode a frame from the provided buffer of bytes. Read more
Source§impl Default for RMonitorDecoder
impl Default for RMonitorDecoder
Source§fn default() -> RMonitorDecoder
fn default() -> RMonitorDecoder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RMonitorDecoder
impl RefUnwindSafe for RMonitorDecoder
impl Send for RMonitorDecoder
impl Sync for RMonitorDecoder
impl Unpin for RMonitorDecoder
impl UnwindSafe for RMonitorDecoder
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