Struct Dictionary

Source
pub struct Dictionary(/* private fields */);
Expand description

For storage and retrieval of key/value pairs.

Implementations§

Source§

impl Dictionary

Source

pub fn new() -> Self

Create a new empty struct.

Source

pub fn with_name(name: &str) -> Result<Self, QuickFixError>

Try to create new empty struct with a given name.

Source

pub fn contains(&self, key: &str) -> Result<bool, QuickFixError>

Check if dictionary contains key.

Source

pub fn get<T>(&self, key: &str) -> Result<T, QuickFixError>
where Self: ForeignPropertyGetter<T>,

Read value from dictionary for a given key.

Source

pub fn set<T>(&mut self, key: &str, value: T) -> Result<(), QuickFixError>
where Self: ForeignPropertySetter<T>,

Write value into dictionary for a given key.

Source§

impl Dictionary

Source

pub fn try_from_items( items: &[&dyn DictionaryItem], ) -> Result<Self, QuickFixError>

Build dictionary parameters from multiple items.

Examples found in repository?
examples/demo_config.rs (lines 25-29)
20fn build_settings() -> Result<SessionSettings, QuickFixError> {
21    let mut settings = SessionSettings::new();
22
23    settings.set(
24        None,
25        Dictionary::try_from_items(&[
26            &ConnectionType::Acceptor,
27            &ReconnectInterval(60),
28            &FileStorePath("store"),
29        ])?,
30    )?;
31
32    settings.set(
33        Some(&SessionId::try_new("FIX.4.4", "ME", "THEIR", "")?),
34        Dictionary::try_from_items(&[
35            &StartTime("12:30:00"),
36            &EndTime("23:30:00"),
37            &HeartBtInt(20),
38            &SocketAcceptPort(4000),
39            &DataDictionary("quickfix-ffi/libquickfix/spec/FIX41.xml"),
40        ])?,
41    )?;
42
43    Ok(settings)
44}

Trait Implementations§

Source§

impl Debug for Dictionary

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Dictionary

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Drop for Dictionary

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl ForeignPropertyGetter<DayOfWeek> for Dictionary

Source§

fn ffi_get(&self, key: CString) -> Result<DayOfWeek, QuickFixError>

Read foreign value from object.
Source§

impl ForeignPropertyGetter<String> for Dictionary

Source§

fn ffi_get(&self, key: CString) -> Result<String, QuickFixError>

Read foreign value from object.
Source§

impl ForeignPropertyGetter<bool> for Dictionary

Source§

fn ffi_get(&self, key: CString) -> Result<bool, QuickFixError>

Read foreign value from object.
Source§

impl ForeignPropertyGetter<f64> for Dictionary

Source§

fn ffi_get(&self, key: CString) -> Result<f64, QuickFixError>

Read foreign value from object.
Source§

impl ForeignPropertyGetter<i32> for Dictionary

Source§

fn ffi_get(&self, key: CString) -> Result<i32, QuickFixError>

Read foreign value from object.
Source§

impl ForeignPropertySetter<&str> for Dictionary

Source§

fn ffi_set(&mut self, key: CString, value: &str) -> Result<(), QuickFixError>

Write foreign value into object.
Source§

impl ForeignPropertySetter<DayOfWeek> for Dictionary

Source§

fn ffi_set( &mut self, key: CString, value: DayOfWeek, ) -> Result<(), QuickFixError>

Write foreign value into object.
Source§

impl ForeignPropertySetter<String> for Dictionary

Source§

fn ffi_set(&mut self, key: CString, value: String) -> Result<(), QuickFixError>

Write foreign value into object.
Source§

impl ForeignPropertySetter<bool> for Dictionary

Source§

fn ffi_set(&mut self, key: CString, value: bool) -> Result<(), QuickFixError>

Write foreign value into object.
Source§

impl ForeignPropertySetter<f64> for Dictionary

Source§

fn ffi_set(&mut self, key: CString, value: f64) -> Result<(), QuickFixError>

Write foreign value into object.
Source§

impl ForeignPropertySetter<i32> for Dictionary

Source§

fn ffi_set(&mut self, key: CString, value: i32) -> Result<(), QuickFixError>

Write foreign value into object.

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.