FixGroupEntry

Struct FixGroupEntry 

pub struct FixGroupEntry { /* private fields */ }
Expand description

Non-owning wrapper for FIX group entry (C++ TagValue*)

§Safety

This wrapper is only valid while the parent FIXMessage exists.

§Example

use fixantenna_bindings::FixMessage;

let mut msg = FixMessage::new("D", 4).unwrap();
msg.set(447, "1").unwrap(); // NoPartyIDs = 1

if let Some(group) = msg.get_group(447) {
    if let Some(mut entry) = group.get(0) {
        entry.set(448, "PARTY1").unwrap();
        println!("PartyID: {}", entry.get(448).unwrap());
    }
}

Implementations§

§

impl FixGroupEntry

pub fn as_ptr(&self) -> usize

Get the raw C++ pointer

pub fn get(&self, tag: i32) -> Option<String>

Get field value as string

Returns None if field doesn’t exist

pub fn set(&mut self, tag: i32, value: &str) -> Result<(), String>

Set field value from string

pub fn remove(&mut self, tag: i32) -> bool

Remove field from this entry

Returns true if field was removed, false if it didn’t exist

pub fn has_flag(&self, tag: i32) -> bool

Check if tag is a flag field

pub fn is_supported(&self, tag: i32) -> bool

Check if tag is supported in this entry

pub fn is_empty(&self, tag: i32) -> bool

Check if field is empty

pub fn has_value(&self, tag: i32) -> bool

Check if field has a value

pub fn get_group(&self, tag: i32) -> Option<FixGroup>

Get nested group from this entry

pub fn get_int32(&self, tag: i32) -> Result<i32, String>

Get field as i32

pub fn get_uint32(&self, tag: i32) -> Result<u32, String>

Get field as u32

pub fn get_int64(&self, tag: i32) -> Result<i64, String>

Get field as i64

pub fn get_uint64(&self, tag: i32) -> Result<u64, String>

Get field as u64

pub fn get_double(&self, tag: i32) -> Result<f64, String>

Get field as f64

pub fn get_decimal(&self, tag: i32) -> Result<Decimal, String>

Get field as Decimal

pub fn get_bool(&self, tag: i32) -> Result<bool, String>

Get field as bool

pub fn get_char(&self, tag: i32) -> Result<char, String>

Get field as char

pub fn get_string(&self, tag: i32) -> Result<String, String>

Get field as String (with copy)

pub fn get_string_ref(&self, tag: i32) -> Result<&str, String>

Get field as string slice (zero-copy, performance critical)

§Safety

The returned reference is only valid while this entry’s parent FIXMessage exists

pub fn set_int32(&mut self, tag: i32, value: i32) -> Result<(), String>

Set field as i32

pub fn set_uint32(&mut self, tag: i32, value: u32) -> Result<(), String>

Set field as u32

pub fn set_int64(&mut self, tag: i32, value: i64) -> Result<(), String>

Set field as i64

pub fn set_uint64(&mut self, tag: i32, value: u64) -> Result<(), String>

Set field as u64

pub fn set_double(&mut self, tag: i32, value: f64) -> Result<(), String>

Set field as f64

pub fn set_decimal(&mut self, tag: i32, value: Decimal) -> Result<(), String>

Set field as Decimal

pub fn set_bool(&mut self, tag: i32, value: bool) -> Result<(), String>

Set field as bool

pub fn set_char(&mut self, tag: i32, value: char) -> Result<(), String>

Set field as char

Trait Implementations§

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.