Trait InstrumentDefRec

Source
pub trait InstrumentDefRec: HasRType {
    // Required methods
    fn raw_symbol(&self) -> Result<&str>;
    fn asset(&self) -> Result<&str>;
    fn security_type(&self) -> Result<&str>;
    fn security_update_action(&self) -> Result<SecurityUpdateAction>;
    fn channel_id(&self) -> u16;
}
Expand description

A trait for compatibility between different versions of definition records.

Required Methods§

Source

fn raw_symbol(&self) -> Result<&str>

Returns the instrument raw symbol assigned by the publisher as a &str.

§Errors

This function returns an error if raw_symbol contains invalid UTF-8.

Source

fn asset(&self) -> Result<&str>

Returns the underlying asset code (product code) of the instrument as a &str.

§Errors

This function returns an error if asset contains invalid UTF-8.

Source

fn security_type(&self) -> Result<&str>

Returns the Security type of the instrument, e.g. FUT for future or future spread as a &str.

§Errors

This function returns an error if security_type contains invalid UTF-8.

Source

fn security_update_action(&self) -> Result<SecurityUpdateAction>

Returns the action indicating whether the instrument definition has been added, modified, or deleted.

§Errors

This function returns an error if the security_update_action field does not contain a valid SecurityUpdateAction.

Source

fn channel_id(&self) -> u16

The channel ID assigned by Databento as an incrementing integer starting at zero.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§