pub struct ZeroCopyAdapter { /* private fields */ }Expand description
Adapter for converting zero-copy structures to model structures
Implementations§
Source§impl ZeroCopyAdapter
impl ZeroCopyAdapter
Sourcepub const fn new(config: ZeroCopyConfig) -> Self
pub const fn new(config: ZeroCopyConfig) -> Self
Create a new ZeroCopyAdapter with the given configuration
§Note
This constructor is not const fn because ZeroCopyConfig contains
a FxHashMap which is not const-constructible. Use at runtime only.
Sourcepub fn message_type(&self, buffer: &[u8]) -> Result<MessageType>
pub fn message_type(&self, buffer: &[u8]) -> Result<MessageType>
Get the message type from a buffer without parsing the full message
Sourcepub fn parse_and_send(
&self,
buffer: &[u8],
channels: &MarketDataChannels,
) -> Result<()>
pub fn parse_and_send( &self, buffer: &[u8], channels: &MarketDataChannels, ) -> Result<()>
Parse and send a message directly to the appropriate channel
Sourcepub fn parse_orderbook(&self, data: &[u8]) -> Result<OrderBook>
pub fn parse_orderbook(&self, data: &[u8]) -> Result<OrderBook>
Parse an orderbook update from binary (direct method)
Sourcepub fn parse_trade(&self, data: &[u8]) -> Result<MarketTrade>
pub fn parse_trade(&self, data: &[u8]) -> Result<MarketTrade>
Parse a trade from binary (direct method)
Auto Trait Implementations§
impl Freeze for ZeroCopyAdapter
impl RefUnwindSafe for ZeroCopyAdapter
impl Send for ZeroCopyAdapter
impl Sync for ZeroCopyAdapter
impl Unpin for ZeroCopyAdapter
impl UnwindSafe for ZeroCopyAdapter
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