pub struct RawMessage<'a> { /* private fields */ }Expand description
Zero-copy view into a FIX message buffer.
This struct holds references to the original message buffer, avoiding allocation during parsing. Fields are stored as offset ranges into the buffer.
Implementations§
Source§impl<'a> RawMessage<'a>
impl<'a> RawMessage<'a>
Sourcepub fn new(
buffer: &'a [u8],
begin_string: Range<usize>,
body: Range<usize>,
msg_type: MsgType,
fields: SmallVec<[FieldRef<'a>; 32]>,
) -> Self
pub fn new( buffer: &'a [u8], begin_string: Range<usize>, body: Range<usize>, msg_type: MsgType, fields: SmallVec<[FieldRef<'a>; 32]>, ) -> Self
Creates a new RawMessage from parsed components.
§Arguments
buffer- The complete message bufferbegin_string- Range of the BeginString valuebody- Range of the message bodymsg_type- The parsed message typefields- Parsed field references
Sourcepub fn begin_string(&self) -> &'a str
pub fn begin_string(&self) -> &'a str
Returns the BeginString value (e.g., “FIX.4.4”).
Sourcepub fn fields(&self) -> impl Iterator<Item = &FieldRef<'a>>
pub fn fields(&self) -> impl Iterator<Item = &FieldRef<'a>>
Returns an iterator over all fields.
Sourcepub fn field_count(&self) -> usize
pub fn field_count(&self) -> usize
Returns the number of fields in the message.
Sourcepub fn get_field_str(&self, tag: u32) -> Option<&'a str>
pub fn get_field_str(&self, tag: u32) -> Option<&'a str>
Sourcepub fn get_field_as<T: FromStr>(&self, tag: u32) -> Result<T, DecodeError>
pub fn get_field_as<T: FromStr>(&self, tag: u32) -> Result<T, DecodeError>
Sourcepub fn body_range(&self) -> &Range<usize>
pub fn body_range(&self) -> &Range<usize>
Returns the message body range.
Sourcepub fn to_owned(&self) -> OwnedMessage
pub fn to_owned(&self) -> OwnedMessage
Converts this borrowed message to an owned message.
Trait Implementations§
Source§impl<'a> Clone for RawMessage<'a>
impl<'a> Clone for RawMessage<'a>
Source§fn clone(&self) -> RawMessage<'a>
fn clone(&self) -> RawMessage<'a>
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<'a> Freeze for RawMessage<'a>
impl<'a> RefUnwindSafe for RawMessage<'a>
impl<'a> Send for RawMessage<'a>
impl<'a> Sync for RawMessage<'a>
impl<'a> Unpin for RawMessage<'a>
impl<'a> UnwindSafe for RawMessage<'a>
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