Struct stun_codec::MessageDecoder
source · [−]pub struct MessageDecoder<A: Attribute> { /* private fields */ }
Expand description
Message
decoder.
Implementations
sourceimpl<A: Attribute> MessageDecoder<A>
impl<A: Attribute> MessageDecoder<A>
Trait Implementations
sourceimpl<A: Debug + Attribute> Debug for MessageDecoder<A>
impl<A: Debug + Attribute> Debug for MessageDecoder<A>
sourceimpl<A: Attribute> Decode for MessageDecoder<A>
impl<A: Attribute> Decode for MessageDecoder<A>
type Item = DecodedMessage<A>
type Item = DecodedMessage<A>
The type of items to be decoded.
sourcefn decode(&mut self, buf: &[u8], eos: Eos) -> Result<usize>
fn decode(&mut self, buf: &[u8], eos: Eos) -> Result<usize>
Consumes the given buffer (a part of a byte sequence), and proceeds the decoding process. Read more
sourcefn finish_decoding(&mut self) -> Result<Self::Item>
fn finish_decoding(&mut self) -> Result<Self::Item>
Finishes the current decoding process and returns the decoded item. Read more
sourcefn requiring_bytes(&self) -> ByteCount
fn requiring_bytes(&self) -> ByteCount
Returns the lower bound of the number of bytes needed to decode the next item. Read more
Auto Trait Implementations
impl<A> !RefUnwindSafe for MessageDecoder<A>
impl<A> Send for MessageDecoder<A> where
A: Send,
<A as Attribute>::Decoder: Send,
impl<A> Sync for MessageDecoder<A> where
A: Sync,
<A as Attribute>::Decoder: Sync,
impl<A> Unpin for MessageDecoder<A> where
A: Unpin,
<A as Attribute>::Decoder: Unpin,
impl<A> !UnwindSafe for MessageDecoder<A>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> DecodeExt for T where
T: Decode,
impl<T> DecodeExt for T where
T: Decode,
sourcefn map<T, F>(self, f: F) -> Map<Self, T, F> where
F: Fn(Self::Item) -> T,
fn map<T, F>(self, f: F) -> Map<Self, T, F> where
F: Fn(Self::Item) -> T,
Creates a decoder that converts decoded values by calling the given function. Read more
sourcefn try_map<T, E, F>(self, f: F) -> TryMap<Self, T, E, F> where
F: Fn(Self::Item) -> Result<T, E>,
Error: From<E>,
fn try_map<T, E, F>(self, f: F) -> TryMap<Self, T, E, F> where
F: Fn(Self::Item) -> Result<T, E>,
Error: From<E>,
Creates a decoder that tries to convert decoded values by calling the given function. Read more
sourcefn map_err<E, F>(self, f: F) -> MapErr<Self, E, F> where
F: Fn(Error) -> E,
Error: From<E>,
fn map_err<E, F>(self, f: F) -> MapErr<Self, E, F> where
F: Fn(Error) -> E,
Error: From<E>,
Creates a decoder for modifying decoding errors produced by self
. Read more
sourcefn and_then<D, F>(self, f: F) -> AndThen<Self, D, F> where
F: Fn(Self::Item) -> D,
D: Decode,
fn and_then<D, F>(self, f: F) -> AndThen<Self, D, F> where
F: Fn(Self::Item) -> D,
D: Decode,
Creates a decoder that enables conditional decoding. Read more
sourcefn collect<T>(self) -> Collect<Self, T> where
T: Extend<Self::Item> + Default,
fn collect<T>(self) -> Collect<Self, T> where
T: Extend<Self::Item> + Default,
Creates a decoder for collecting decoded items. Read more
sourcefn collectn<T>(self, n: usize) -> CollectN<Self, T> where
T: Extend<Self::Item> + Default,
fn collectn<T>(self, n: usize) -> CollectN<Self, T> where
T: Extend<Self::Item> + Default,
Creates a decoder that decodes n
items by using self
and collecting the result. Read more
sourcefn length(self, expected_bytes: u64) -> Length<Self>
fn length(self, expected_bytes: u64) -> Length<Self>
Creates a decoder that consumes the specified number of bytes exactly. Read more
sourcefn omit(self, do_omit: bool) -> Omittable<Self>
fn omit(self, do_omit: bool) -> Omittable<Self>
Creates a decoder that will omit decoding items if do_omit = true
is specified. Read more
sourcefn max_bytes(self, bytes: u64) -> MaxBytes<Self>
fn max_bytes(self, bytes: u64) -> MaxBytes<Self>
Creates a decoder that will fail if the number of consumed bytes exceeds bytes
. Read more
sourcefn chain<T>(self, other: T) -> TupleDecoder<(Self, T)> where
T: Decode,
fn chain<T>(self, other: T) -> TupleDecoder<(Self, T)> where
T: Decode,
Takes two decoders and creates a new decoder that decodes both items in sequence. Read more
sourcefn slice(self) -> Slice<Self>
fn slice(self) -> Slice<Self>
Creates a decoder that makes it possible to slice the input byte sequence in arbitrary units. Read more
sourcefn peekable(self) -> Peekable<Self>
fn peekable(self) -> Peekable<Self>
Creates a decoder that enables to peek decoded items before calling finish_decoding
method. Read more