pub struct DatabentoLiveClient {
pub dataset: String,
/* private fields */
}Fields§
§dataset: StringImplementations§
Source§impl DatabentoLiveClient
impl DatabentoLiveClient
Sourcepub fn new(
key: String,
dataset: String,
publishers_filepath: PathBuf,
use_exchange_as_venue: bool,
bars_timestamp_on_close: Option<bool>,
reconnect_timeout_mins: Option<i64>,
) -> Result<Self>
pub fn new( key: String, dataset: String, publishers_filepath: PathBuf, use_exchange_as_venue: bool, bars_timestamp_on_close: Option<bool>, reconnect_timeout_mins: Option<i64>, ) -> Result<Self>
Creates a new DatabentoLiveClient instance.
§Errors
Returns an error if reading or parsing the publishers file fails.
pub const fn is_running(&self) -> bool
pub const fn is_closed(&self) -> bool
Sourcepub fn subscribe(
&mut self,
schema: String,
instrument_ids: Vec<InstrumentId>,
start: Option<u64>,
snapshot: Option<bool>,
price_precisions: Option<Vec<Option<u8>>>,
stype_in: Option<String>,
) -> Result<()>
pub fn subscribe( &mut self, schema: String, instrument_ids: Vec<InstrumentId>, start: Option<u64>, snapshot: Option<bool>, price_precisions: Option<Vec<Option<u8>>>, stype_in: Option<String>, ) -> Result<()>
Subscribes to Databento live data for the requested instruments.
§Errors
Returns an error if symbology, schema, timestamp, or precision inputs are invalid, or if the command cannot be sent to the feed handler.
Sourcepub fn start(
&mut self,
) -> Result<(DatabentoFeedHandler, UnboundedReceiver<DatabentoMessage>)>
pub fn start( &mut self, ) -> Result<(DatabentoFeedHandler, UnboundedReceiver<DatabentoMessage>)>
Starts the live feed handler and returns its message receiver.
§Errors
Returns an error if the client is already closed, already running, or cannot start.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DatabentoLiveClient
impl RefUnwindSafe for DatabentoLiveClient
impl Send for DatabentoLiveClient
impl Sync for DatabentoLiveClient
impl Unpin for DatabentoLiveClient
impl UnsafeUnpin for DatabentoLiveClient
impl UnwindSafe for DatabentoLiveClient
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more