pub struct ZeroAllocMessageProcessor { /* private fields */ }Expand description
Zero-allocation WebSocket message processor with buffer reuse
Implementations§
Source§impl ZeroAllocMessageProcessor
impl ZeroAllocMessageProcessor
Sourcepub fn parse_order_to_pooled(&mut self, data: &[u8]) -> Result<OrderHandle>
pub fn parse_order_to_pooled(&mut self, data: &[u8]) -> Result<OrderHandle>
Parse order message with pooled object recycling
Returns a pooled order handle that automatically returns to pool on drop.
Sourcepub fn parse_trade_to_pooled(&mut self, data: &[u8]) -> Result<TradeHandle>
pub fn parse_trade_to_pooled(&mut self, data: &[u8]) -> Result<TradeHandle>
Parse trade message with pooled object recycling
Returns a pooled trade handle that automatically returns to pool on drop.
Sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Reset the processor for reuse
Clears internal buffers while keeping allocated capacity.
Sourcepub fn buffer_stats(&self) -> BufferStats
pub fn buffer_stats(&self) -> BufferStats
Get buffer statistics for monitoring
Sourcepub fn identify_message_type(
&mut self,
message_bytes: &[u8],
) -> Result<MessageType>
pub fn identify_message_type( &mut self, message_bytes: &[u8], ) -> Result<MessageType>
Process a message and determine its type without allocation
Sourcepub fn extract_error_message(
&mut self,
data: &[u8],
) -> Result<Option<SmartString>>
pub fn extract_error_message( &mut self, data: &[u8], ) -> Result<Option<SmartString>>
Extract error message without allocation
Sourcepub fn extract_request_id(&mut self, data: &[u8]) -> Result<Option<SmartString>>
pub fn extract_request_id(&mut self, data: &[u8]) -> Result<Option<SmartString>>
Extract request ID without allocation
Sourcepub fn extract_string_field(
&mut self,
data: &[u8],
field: &str,
) -> Result<Option<SmartString>>
pub fn extract_string_field( &mut self, data: &[u8], field: &str, ) -> Result<Option<SmartString>>
Extract string field without allocation using borrowed parsing
Sourcepub fn extract_decimal_field(
&mut self,
data: &[u8],
field: &str,
) -> Result<Option<Decimal>>
pub fn extract_decimal_field( &mut self, data: &[u8], field: &str, ) -> Result<Option<Decimal>>
Extract decimal field without string allocation
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ZeroAllocMessageProcessor
impl !RefUnwindSafe for ZeroAllocMessageProcessor
impl Send for ZeroAllocMessageProcessor
impl Sync for ZeroAllocMessageProcessor
impl Unpin for ZeroAllocMessageProcessor
impl !UnwindSafe for ZeroAllocMessageProcessor
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