pub struct LengthDelimitedCodec { /* private fields */ }
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§
Source§impl LengthDelimitedCodec
impl LengthDelimitedCodec
Sourcepub fn builder() -> Builder
pub fn builder() -> Builder
Creates a new length delimited codec builder with default configuration values.
Sourcepub fn max_frame_length(&self) -> usize
pub fn max_frame_length(&self) -> usize
Returns the current max frame setting
This is the largest size this codec will accept from the wire. Larger frames will be rejected.
Sourcepub fn set_max_frame_length(&mut self, val: usize)
pub fn set_max_frame_length(&mut self, val: usize)
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§
Source§impl Clone for LengthDelimitedCodec
impl Clone for LengthDelimitedCodec
Source§fn clone(&self) -> LengthDelimitedCodec
fn clone(&self) -> LengthDelimitedCodec
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for LengthDelimitedCodec
impl Debug for LengthDelimitedCodec
Source§impl Decoder for LengthDelimitedCodec
impl Decoder for LengthDelimitedCodec
Source§fn decode(&mut self, src: &mut BytesMut) -> Result<Option<BytesMut>>
fn decode(&mut self, src: &mut BytesMut) -> Result<Option<BytesMut>>
Source§impl Default for LengthDelimitedCodec
impl Default for LengthDelimitedCodec
Auto Trait Implementations§
impl Freeze for LengthDelimitedCodec
impl RefUnwindSafe for LengthDelimitedCodec
impl Send for LengthDelimitedCodec
impl Sync for LengthDelimitedCodec
impl Unpin for LengthDelimitedCodec
impl UnwindSafe for LengthDelimitedCodec
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 72 bytes