Skip to main content

SecurityInfo

Struct SecurityInfo 

Source
pub struct SecurityInfo {
Show 32 fields pub asset_category: AssetCategory, pub symbol: String, pub description: Option<String>, pub conid: String, pub security_id: Option<String>, pub security_id_type: Option<SecurityIdType>, pub cusip: Option<String>, pub isin: Option<String>, pub figi: Option<String>, pub sedol: Option<String>, pub multiplier: Option<Decimal>, pub strike: Option<Decimal>, pub expiry: Option<NaiveDate>, pub put_call: Option<PutCall>, pub underlying_conid: Option<String>, pub underlying_symbol: Option<String>, pub maturity: Option<NaiveDate>, pub principal_adjust_factor: Option<Decimal>, pub currency: Option<String>, pub listing_exchange: Option<String>, pub underlying_security_id: Option<String>, pub underlying_listing_exchange: Option<String>, pub issuer: Option<String>, pub issuer_country_code: Option<String>, pub sub_category: Option<SubCategory>, pub delivery_month: Option<String>, pub serial_number: Option<String>, pub delivery_type: Option<String>, pub commodity_type: Option<String>, pub fineness: Option<Decimal>, pub weight: Option<String>, pub code: Option<String>,
}
Expand description

Security information (reference data)

Provides detailed reference data for securities in the statement. Includes identifiers (CUSIP, ISIN, FIGI), exchange info, and derivative details. Fields are organized into CORE and EXTENDED sections.

§Example

use ib_flex::parse_activity_flex;
use ib_flex::AssetCategory;

let xml = std::fs::read_to_string("activity.xml")?;
let statement = parse_activity_flex(&xml)?;

for security in &statement.securities_info.items {
    println!("{} ({})", security.symbol, security.conid);

    // Print description
    if let Some(desc) = &security.description {
        println!("  Description: {}", desc);
    }

    // Print identifiers
    if let Some(cusip) = &security.cusip {
        println!("  CUSIP: {}", cusip);
    }
    if let Some(isin) = &security.isin {
        println!("  ISIN: {}", isin);
    }

    // Show derivative info for options
    if security.asset_category == AssetCategory::Option {
        println!("  Underlying: {:?}", security.underlying_symbol);
        println!("  Strike: {:?}", security.strike);
        println!("  Expiry: {:?}", security.expiry);
        println!("  Type: {:?}", security.put_call);
        println!("  Multiplier: {:?}", security.multiplier);
    }
}

Fields§

§asset_category: AssetCategory

Asset category

§symbol: String

Ticker symbol

§description: Option<String>

Security description

§conid: String

IB contract ID

§security_id: Option<String>

Security ID

§security_id_type: Option<SecurityIdType>

Security ID type

§cusip: Option<String>

CUSIP

§isin: Option<String>

ISIN

§figi: Option<String>

FIGI

§sedol: Option<String>

SEDOL

§multiplier: Option<Decimal>

Multiplier

§strike: Option<Decimal>

Strike (for options)

§expiry: Option<NaiveDate>

Expiry (for options/futures)

§put_call: Option<PutCall>

Put or Call

§underlying_conid: Option<String>

Underlying contract ID

§underlying_symbol: Option<String>

Underlying symbol

§maturity: Option<NaiveDate>

Maturity date (for bonds)

§principal_adjust_factor: Option<Decimal>

Principal adjustment factor

§currency: Option<String>

Currency

§listing_exchange: Option<String>

Listing exchange

§underlying_security_id: Option<String>

Underlying security ID

§underlying_listing_exchange: Option<String>

Underlying listing exchange

§issuer: Option<String>

Issuer

§issuer_country_code: Option<String>

Issuer country code

§sub_category: Option<SubCategory>

Sub-category

§delivery_month: Option<String>

Delivery month (for futures)

§serial_number: Option<String>

Serial number

§delivery_type: Option<String>

Delivery type

§commodity_type: Option<String>

Commodity type

§fineness: Option<Decimal>

Fineness (for precious metals)

§weight: Option<String>

Weight

§code: Option<String>

Code

Trait Implementations§

Source§

impl Clone for SecurityInfo

Source§

fn clone(&self) -> SecurityInfo

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 SecurityInfo

Source§

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

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

impl<'de> Deserialize<'de> for SecurityInfo

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for SecurityInfo

Source§

fn eq(&self, other: &SecurityInfo) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for SecurityInfo

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for SecurityInfo

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, 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> 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<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,