pub struct OwnedMessage { /* private fields */ }Expand description
Owned FIX message for storage and cross-thread transfer.
Unlike RawMessage, this struct owns its data and can be
safely sent across threads or stored for later use.
Implementations§
Source§impl OwnedMessage
impl OwnedMessage
Sourcepub fn from_raw(raw: &RawMessage<'_>) -> OwnedMessage
pub fn from_raw(raw: &RawMessage<'_>) -> OwnedMessage
Sourcepub fn new(
buffer: Bytes,
msg_type: MsgType,
field_offsets: Vec<(u32, Range<usize>)>,
) -> OwnedMessage
pub fn new( buffer: Bytes, msg_type: MsgType, field_offsets: Vec<(u32, Range<usize>)>, ) -> OwnedMessage
Creates an OwnedMessage from raw bytes.
§Arguments
buffer- The message bytesmsg_type- The message typefield_offsets- Field tag and value range pairs
Sourcepub fn get_field_str(&self, tag: u32) -> Option<&str>
pub fn get_field_str(&self, tag: u32) -> Option<&str>
Sourcepub fn field_count(&self) -> usize
pub fn field_count(&self) -> usize
Returns the number of fields.
Sourcepub fn into_bytes(self) -> Bytes
pub fn into_bytes(self) -> Bytes
Consumes the message and returns the underlying buffer.
Trait Implementations§
Source§impl Clone for OwnedMessage
impl Clone for OwnedMessage
Source§fn clone(&self) -> OwnedMessage
fn clone(&self) -> OwnedMessage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !Freeze for OwnedMessage
impl RefUnwindSafe for OwnedMessage
impl Send for OwnedMessage
impl Sync for OwnedMessage
impl Unpin for OwnedMessage
impl UnwindSafe for OwnedMessage
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