Skip to main content

kind

Function kind 

pub fn kind(k: InstrumentType) -> InstrumentKind
Expand description

Instrument kind of a broker message to the domain [InstrumentKind].

Bond, share, currency, ETF, futures and option map one to one. Everything else (indicatives, structured notes, …) is [InstrumentKind::Other].

§Examples

use brokapi_core::InstrumentKind;
use brokapi_tbank::map::instrument::kind;
use brokapi_tbank_protocol::v1::InstrumentType;

assert_eq!(kind(InstrumentType::Share), InstrumentKind::Stock);
assert_eq!(kind(InstrumentType::Futures), InstrumentKind::Future);