pub struct TurnStreamDecoder { /* private fields */ }Expand description
Sans-IO splitter for a TURN stream: push bytes as they arrive, pop whole messages. A message comes out exactly as it was on the wire, ChannelData padding included, which TURN’s decoders accept.
Implementations§
Source§impl TurnStreamDecoder
impl TurnStreamDecoder
Sourcepub fn extend_from_slice(&mut self, data: &[u8])
pub fn extend_from_slice(&mut self, data: &[u8])
Appends bytes read from the stream.
Sourcepub fn next_message(&mut self) -> Result<Option<Vec<u8>>>
pub fn next_message(&mut self) -> Result<Option<Vec<u8>>>
The next complete message, Ok(None) while one is still arriving, or an
error when the stream holds something that is not TURN.
Sourcepub fn buffered_len(&self) -> usize
pub fn buffered_len(&self) -> usize
Bytes held that do not yet make a whole message.
Trait Implementations§
Source§impl Debug for TurnStreamDecoder
impl Debug for TurnStreamDecoder
Auto Trait Implementations§
impl Freeze for TurnStreamDecoder
impl RefUnwindSafe for TurnStreamDecoder
impl Send for TurnStreamDecoder
impl Sync for TurnStreamDecoder
impl Unpin for TurnStreamDecoder
impl UnsafeUnpin for TurnStreamDecoder
impl UnwindSafe for TurnStreamDecoder
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