pub struct StreamAssembler { /* private fields */ }Expand description
The receiving side of a stream (§9.4).
Implementations§
Source§impl StreamAssembler
impl StreamAssembler
Sourcepub fn open_segments(&self) -> Vec<(String, i64)>
pub fn open_segments(&self) -> Vec<(String, i64)>
How many segments are partially received.
Sourcepub fn buffered_bytes(&self) -> usize
pub fn buffered_bytes(&self) -> usize
How many bytes are buffered across every open segment.
Sourcepub fn accept(
&mut self,
chunk: &ChunkRef,
bytes: &[u8],
) -> Result<Option<StreamSegment>>
pub fn accept( &mut self, chunk: &ChunkRef, bytes: &[u8], ) -> Result<Option<StreamSegment>>
Accepts one chunk, returning the segment when it completes.
§Errors
NodeError::Pattern when the chunk’s seq is not the one expected —
a gap or a reordering, either of which would silently corrupt the
reassembled bytes.
Sourcepub fn accept_event(&mut self, event: Event) -> Result<AcceptedChunk>
pub fn accept_event(&mut self, event: Event) -> Result<AcceptedChunk>
Accepts one event, returning the segment when it completes.
An event that is not a stream chunk is returned unchanged, so a node’s loop can offer every input to the assembler and handle what it does not take.
§Errors
Trait Implementations§
Source§impl Debug for StreamAssembler
impl Debug for StreamAssembler
Auto Trait Implementations§
impl Freeze for StreamAssembler
impl RefUnwindSafe for StreamAssembler
impl Send for StreamAssembler
impl Sync for StreamAssembler
impl Unpin for StreamAssembler
impl UnsafeUnpin for StreamAssembler
impl UnwindSafe for StreamAssembler
Blanket Implementations§
impl<T> Allocation for T
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