Struct LengthDelimited
pub struct LengthDelimited { /* private fields */ }Available on crate feature
io only.Expand description
A simple extractor that frames data by its length.
It uses 8 bytes to represent the length of the data at the beginning.
Implementations§
§impl LengthDelimited
impl LengthDelimited
pub fn new() -> LengthDelimited
pub fn new() -> LengthDelimited
Creates a new LengthDelimited framer.
pub fn length_field_len(&self) -> usize
pub fn length_field_len(&self) -> usize
Returns the length of the length field in bytes.
pub fn set_length_field_len(self, len_field_len: usize) -> LengthDelimited
pub fn set_length_field_len(self, len_field_len: usize) -> LengthDelimited
Sets the length of the length field in bytes.
pub fn length_field_is_big_endian(&self) -> bool
pub fn length_field_is_big_endian(&self) -> bool
Returns whether the length field is big-endian.
pub fn set_length_field_is_big_endian(self, big_endian: bool) -> LengthDelimited
pub fn set_length_field_is_big_endian(self, big_endian: bool) -> LengthDelimited
Sets whether the length field is big-endian.
Trait Implementations§
§impl Clone for LengthDelimited
impl Clone for LengthDelimited
§fn clone(&self) -> LengthDelimited
fn clone(&self) -> LengthDelimited
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for LengthDelimited
impl Debug for LengthDelimited
§impl Default for LengthDelimited
impl Default for LengthDelimited
§fn default() -> LengthDelimited
fn default() -> LengthDelimited
Returns the “default value” for a type. Read more
§impl Framer for LengthDelimited
impl Framer for LengthDelimited
§impl Hash for LengthDelimited
impl Hash for LengthDelimited
§impl Ord for LengthDelimited
impl Ord for LengthDelimited
§impl PartialEq for LengthDelimited
impl PartialEq for LengthDelimited
§impl PartialOrd for LengthDelimited
impl PartialOrd for LengthDelimited
impl Copy for LengthDelimited
impl Eq for LengthDelimited
impl StructuralPartialEq for LengthDelimited
Auto Trait Implementations§
impl Freeze for LengthDelimited
impl RefUnwindSafe for LengthDelimited
impl Send for LengthDelimited
impl Sync for LengthDelimited
impl Unpin for LengthDelimited
impl UnwindSafe for LengthDelimited
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more