Struct tokio_util::codec::length_delimited::LengthDelimitedCodec [−][src]
pub struct LengthDelimitedCodec { /* fields omitted */ }
codec
only.Expand description
A codec for frames delimited by a frame head specifying their lengths.
This allows the consumer to work with entire frames without having to worry about buffering or other framing logic.
See module level documentation for more detail.
Implementations
impl LengthDelimitedCodec
[src]
impl LengthDelimitedCodec
[src]pub fn builder() -> Builder
[src]
pub fn builder() -> Builder
[src]Creates a new length delimited codec builder with default configuration values.
pub fn max_frame_length(&self) -> usize
[src]
pub fn max_frame_length(&self) -> usize
[src]Returns the current max frame setting
This is the largest size this codec will accept from the wire. Larger frames will be rejected.
pub fn set_max_frame_length(&mut self, val: usize)
[src]
pub fn set_max_frame_length(&mut self, val: usize)
[src]Updates the max frame setting.
The change takes effect the next time a frame is decoded. In other
words, if a frame is currently in process of being decoded with a frame
size greater than val
but less than the max frame length in effect
before calling this function, then the frame will be allowed.
Trait Implementations
impl Debug for LengthDelimitedCodec
[src]
impl Debug for LengthDelimitedCodec
[src]impl Decoder for LengthDelimitedCodec
[src]
impl Decoder for LengthDelimitedCodec
[src]fn decode(&mut self, src: &mut BytesMut) -> Result<Option<BytesMut>>
[src]
fn decode(&mut self, src: &mut BytesMut) -> Result<Option<BytesMut>>
[src]Attempts to decode a frame from the provided buffer of bytes. Read more
impl Default for LengthDelimitedCodec
[src]
impl Default for LengthDelimitedCodec
[src]