RithmicConfig

Struct RithmicConfig 

Source
pub struct RithmicConfig {
    pub account_id: String,
    pub fcm_id: String,
    pub ib_id: String,
    pub url: String,
    pub beta_url: String,
    pub user: String,
    pub password: String,
    pub system_name: String,
    pub env: RithmicEnv,
}
Expand description

Configuration for Rithmic connections.

This struct contains both account information and connection details.

§Fields

  • Account-related: account_id, fcm_id, ib_id
  • Connection-related: url, beta_url, user, password, system_name, env

Fields§

§account_id: String§fcm_id: String§ib_id: String§url: String§beta_url: String§user: String§password: String§system_name: String§env: RithmicEnv

Implementations§

Source§

impl RithmicConfig

Source

pub fn from_env(env: RithmicEnv) -> Result<Self, ConfigError>

Create a configuration by loading values from environment variables.

See examples/.env.blank for a template of all required environment variables.

§Required environment variables

For Demo environment:

  • RITHMIC_DEMO_ACCOUNT_ID: Demo account ID
  • RITHMIC_DEMO_FCM_ID: Demo FCM (Futures Commission Merchant) ID
  • RITHMIC_DEMO_IB_ID: Demo IB (Introducing Broker) ID
  • RITHMIC_DEMO_USER: Demo username
  • RITHMIC_DEMO_PW: Demo password
  • RITHMIC_DEMO_URL: Demo WebSocket URL
  • RITHMIC_DEMO_ALT_URL: Demo alternative/beta WebSocket URL

For Live environment:

  • RITHMIC_LIVE_ACCOUNT_ID: Live account ID
  • RITHMIC_LIVE_FCM_ID: Live FCM (Futures Commission Merchant) ID
  • RITHMIC_LIVE_IB_ID: Live IB (Introducing Broker) ID
  • RITHMIC_LIVE_USER: Live username
  • RITHMIC_LIVE_PW: Live password
  • RITHMIC_LIVE_URL: Live WebSocket URL
  • RITHMIC_LIVE_ALT_URL: Live alternative/beta WebSocket URL

For Test environment:

  • RITHMIC_TEST_ACCOUNT_ID: Test account ID
  • RITHMIC_TEST_FCM_ID: Test FCM (Futures Commission Merchant) ID
  • RITHMIC_TEST_IB_ID: Test IB (Introducing Broker) ID
  • RITHMIC_TEST_USER: Test username
  • RITHMIC_TEST_PW: Test password
  • RITHMIC_TEST_URL: Test WebSocket URL
  • RITHMIC_TEST_ALT_URL: Test alternative/beta WebSocket URL
§Example
use rithmic_rs::config::{RithmicConfig, RithmicEnv};

// Load from environment variables
let config = RithmicConfig::from_env(RithmicEnv::Demo)?;
Source

pub fn builder(env: RithmicEnv) -> RithmicConfigBuilder

Create a builder for programmatic configuration.

Use this to set configuration values directly in code.

§Example
use rithmic_rs::config::{RithmicConfig, RithmicEnv};

let config = RithmicConfig::builder(RithmicEnv::Demo)
    .account_id("my_account")
    .fcm_id("my_fcm")
    .ib_id("my_ib")
    .user("my_user")
    .password("my_password")
    .build()?;

Trait Implementations§

Source§

impl Clone for RithmicConfig

Source§

fn clone(&self) -> RithmicConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RithmicConfig

Source§

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

Formats the value using the given formatter. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more