pub struct MessageAssembler { /* private fields */ }Expand description
Reassembles multiple TDS packets into complete messages.
TDS messages are framed with the END_OF_MESSAGE status flag on the final
packet. This assembler buffers packets until a complete message is received.
Implementations§
Source§impl MessageAssembler
impl MessageAssembler
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create a new message assembler with pre-allocated capacity.
Sourcepub fn push(&mut self, packet: Packet) -> Option<Message>
pub fn push(&mut self, packet: Packet) -> Option<Message>
Push a packet into the assembler.
Returns Some(Message) if this packet completes a message,
None if more packets are needed.
Sourcepub fn has_partial(&self) -> bool
pub fn has_partial(&self) -> bool
Check if the assembler has partial data buffered.
Sourcepub fn packet_count(&self) -> usize
pub fn packet_count(&self) -> usize
Get the number of packets accumulated so far.
Sourcepub fn buffer_len(&self) -> usize
pub fn buffer_len(&self) -> usize
Get the current buffer length.
Trait Implementations§
Source§impl Debug for MessageAssembler
impl Debug for MessageAssembler
Auto Trait Implementations§
impl Freeze for MessageAssembler
impl RefUnwindSafe for MessageAssembler
impl Send for MessageAssembler
impl Sync for MessageAssembler
impl Unpin for MessageAssembler
impl UnwindSafe for MessageAssembler
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