pub struct DatabentoDataClient { /* private fields */ }
Expand description
A Databento data client that combines live streaming and historical data functionality.
This client uses the existing DatabentoFeedHandler
for live data subscriptions
and DatabentoHistoricalClient
for historical data requests. It supports multiple
datasets simultaneously, with separate feed handlers per dataset.
Implementations§
Source§impl DatabentoDataClient
impl DatabentoDataClient
Sourcepub fn new(
client_id: ClientId,
config: DatabentoDataClientConfig,
clock: &'static AtomicTime,
) -> Result<Self>
pub fn new( client_id: ClientId, config: DatabentoDataClientConfig, clock: &'static AtomicTime, ) -> Result<Self>
Creates a new DatabentoDataClient
instance.
§Errors
Returns an error if client creation or publisher configuration loading fails.
Trait Implementations§
Source§impl DataClient for DatabentoDataClient
impl DataClient for DatabentoDataClient
Source§fn connect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn connect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Connects external API’s if needed. Read more
Source§fn disconnect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn disconnect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Disconnects external API’s if needed. Read more
Source§fn is_connected(&self) -> bool
fn is_connected(&self) -> bool
Returns
true
if the client is currently connected.Source§fn is_disconnected(&self) -> bool
fn is_disconnected(&self) -> bool
Returns
true
if the client is currently disconnected.Source§fn subscribe_quotes(&mut self, cmd: &SubscribeQuotes) -> Result<()>
fn subscribe_quotes(&mut self, cmd: &SubscribeQuotes) -> Result<()>
Subscribes to quote updates for the specified instrument. Read more
Source§fn subscribe_trades(&mut self, cmd: &SubscribeTrades) -> Result<()>
fn subscribe_trades(&mut self, cmd: &SubscribeTrades) -> Result<()>
Subscribes to trade updates for the specified instrument. Read more
Source§fn subscribe_book_deltas(&mut self, cmd: &SubscribeBookDeltas) -> Result<()>
fn subscribe_book_deltas(&mut self, cmd: &SubscribeBookDeltas) -> Result<()>
Subscribes to order book delta updates for the specified instrument. Read more
Source§fn subscribe_instrument_status(
&mut self,
cmd: &SubscribeInstrumentStatus,
) -> Result<()>
fn subscribe_instrument_status( &mut self, cmd: &SubscribeInstrumentStatus, ) -> Result<()>
Subscribes to status updates for the specified instrument. Read more
Source§fn unsubscribe_quotes(&mut self, cmd: &UnsubscribeQuotes) -> Result<()>
fn unsubscribe_quotes(&mut self, cmd: &UnsubscribeQuotes) -> Result<()>
Unsubscribes from quote updates for the specified instrument. Read more
Source§fn unsubscribe_trades(&mut self, cmd: &UnsubscribeTrades) -> Result<()>
fn unsubscribe_trades(&mut self, cmd: &UnsubscribeTrades) -> Result<()>
Unsubscribes from trade updates for the specified instrument. Read more
Source§fn unsubscribe_book_deltas(&mut self, cmd: &UnsubscribeBookDeltas) -> Result<()>
fn unsubscribe_book_deltas(&mut self, cmd: &UnsubscribeBookDeltas) -> Result<()>
Unsubscribes from order book delta updates for the specified instrument. Read more
Source§fn unsubscribe_instrument_status(
&mut self,
cmd: &UnsubscribeInstrumentStatus,
) -> Result<()>
fn unsubscribe_instrument_status( &mut self, cmd: &UnsubscribeInstrumentStatus, ) -> Result<()>
Unsubscribes from instrument status updates for the specified instrument. Read more
Source§fn request_instruments(&self, request: &RequestInstruments) -> Result<()>
fn request_instruments(&self, request: &RequestInstruments) -> Result<()>
Requests a list of instruments from the provider for a given venue. Read more
Source§fn request_quotes(&self, request: &RequestQuotes) -> Result<()>
fn request_quotes(&self, request: &RequestQuotes) -> Result<()>
Requests historical or streaming quote data for a specified instrument. Read more
Source§fn request_trades(&self, request: &RequestTrades) -> Result<()>
fn request_trades(&self, request: &RequestTrades) -> Result<()>
Requests historical or streaming trade data for a specified instrument. Read more
Source§fn request_bars(&self, request: &RequestBars) -> Result<()>
fn request_bars(&self, request: &RequestBars) -> Result<()>
Requests historical or streaming bar data for a specified instrument and bar type. Read more
§fn subscribe(&mut self, cmd: &SubscribeCustomData) -> Result<(), Error>
fn subscribe(&mut self, cmd: &SubscribeCustomData) -> Result<(), Error>
Subscribes to custom data types according to the command. Read more
§fn subscribe_instruments(
&mut self,
cmd: &SubscribeInstruments,
) -> Result<(), Error>
fn subscribe_instruments( &mut self, cmd: &SubscribeInstruments, ) -> Result<(), Error>
Subscribes to instruments list for the specified venue. Read more
§fn subscribe_instrument(
&mut self,
cmd: &SubscribeInstrument,
) -> Result<(), Error>
fn subscribe_instrument( &mut self, cmd: &SubscribeInstrument, ) -> Result<(), Error>
Subscribes to data for a single instrument. Read more
§fn subscribe_book_depth10(
&mut self,
cmd: &SubscribeBookDepth10,
) -> Result<(), Error>
fn subscribe_book_depth10( &mut self, cmd: &SubscribeBookDepth10, ) -> Result<(), Error>
Subscribes to top 10 order book depth updates for the specified instrument. Read more
§fn subscribe_book_snapshots(
&mut self,
cmd: &SubscribeBookSnapshots,
) -> Result<(), Error>
fn subscribe_book_snapshots( &mut self, cmd: &SubscribeBookSnapshots, ) -> Result<(), Error>
Subscribes to periodic order book snapshots for the specified instrument. Read more
§fn subscribe_mark_prices(
&mut self,
cmd: &SubscribeMarkPrices,
) -> Result<(), Error>
fn subscribe_mark_prices( &mut self, cmd: &SubscribeMarkPrices, ) -> Result<(), Error>
Subscribes to mark price updates for the specified instrument. Read more
§fn subscribe_index_prices(
&mut self,
cmd: &SubscribeIndexPrices,
) -> Result<(), Error>
fn subscribe_index_prices( &mut self, cmd: &SubscribeIndexPrices, ) -> Result<(), Error>
Subscribes to index price updates for the specified instrument. Read more
§fn subscribe_bars(&mut self, cmd: &SubscribeBars) -> Result<(), Error>
fn subscribe_bars(&mut self, cmd: &SubscribeBars) -> Result<(), Error>
Subscribes to bar updates of the specified bar type. Read more
§fn subscribe_instrument_close(
&mut self,
cmd: &SubscribeInstrumentClose,
) -> Result<(), Error>
fn subscribe_instrument_close( &mut self, cmd: &SubscribeInstrumentClose, ) -> Result<(), Error>
Subscribes to instrument close events for the specified instrument. Read more
§fn subscribe_blocks(&mut self, cmd: &SubscribeBlocks) -> Result<(), Error>
fn subscribe_blocks(&mut self, cmd: &SubscribeBlocks) -> Result<(), Error>
Subscribes to blocks for a specified blockchain. Read more
§fn subscribe_pool(&mut self, cmd: &SubscribePool) -> Result<(), Error>
fn subscribe_pool(&mut self, cmd: &SubscribePool) -> Result<(), Error>
Subscribes to pool definition updates for a specified AMM pool. Read more
§fn subscribe_pool_swaps(
&mut self,
cmd: &SubscribePoolSwaps,
) -> Result<(), Error>
fn subscribe_pool_swaps( &mut self, cmd: &SubscribePoolSwaps, ) -> Result<(), Error>
Subscribes to pool swaps for a specified AMM pool. Read more
§fn subscribe_pool_liquidity_updates(
&mut self,
cmd: &SubscribePoolLiquidityUpdates,
) -> Result<(), Error>
fn subscribe_pool_liquidity_updates( &mut self, cmd: &SubscribePoolLiquidityUpdates, ) -> Result<(), Error>
Subscribes to pool liquidity updates for a specified AMM pool. Read more
§fn unsubscribe(&mut self, cmd: &UnsubscribeCustomData) -> Result<(), Error>
fn unsubscribe(&mut self, cmd: &UnsubscribeCustomData) -> Result<(), Error>
Unsubscribes from custom data types according to the command. Read more
§fn unsubscribe_instruments(
&mut self,
cmd: &UnsubscribeInstruments,
) -> Result<(), Error>
fn unsubscribe_instruments( &mut self, cmd: &UnsubscribeInstruments, ) -> Result<(), Error>
Unsubscribes from instruments list for the specified venue. Read more
§fn unsubscribe_instrument(
&mut self,
cmd: &UnsubscribeInstrument,
) -> Result<(), Error>
fn unsubscribe_instrument( &mut self, cmd: &UnsubscribeInstrument, ) -> Result<(), Error>
Unsubscribes from data for the specified instrument. Read more
§fn unsubscribe_book_depth10(
&mut self,
cmd: &UnsubscribeBookDepth10,
) -> Result<(), Error>
fn unsubscribe_book_depth10( &mut self, cmd: &UnsubscribeBookDepth10, ) -> Result<(), Error>
Unsubscribes from top 10 order book depth updates for the specified instrument. Read more
§fn unsubscribe_book_snapshots(
&mut self,
cmd: &UnsubscribeBookSnapshots,
) -> Result<(), Error>
fn unsubscribe_book_snapshots( &mut self, cmd: &UnsubscribeBookSnapshots, ) -> Result<(), Error>
Unsubscribes from periodic order book snapshots for the specified instrument. Read more
§fn unsubscribe_mark_prices(
&mut self,
cmd: &UnsubscribeMarkPrices,
) -> Result<(), Error>
fn unsubscribe_mark_prices( &mut self, cmd: &UnsubscribeMarkPrices, ) -> Result<(), Error>
Unsubscribes from mark price updates for the specified instrument. Read more
§fn unsubscribe_index_prices(
&mut self,
cmd: &UnsubscribeIndexPrices,
) -> Result<(), Error>
fn unsubscribe_index_prices( &mut self, cmd: &UnsubscribeIndexPrices, ) -> Result<(), Error>
Unsubscribes from index price updates for the specified instrument. Read more
§fn unsubscribe_bars(&mut self, cmd: &UnsubscribeBars) -> Result<(), Error>
fn unsubscribe_bars(&mut self, cmd: &UnsubscribeBars) -> Result<(), Error>
Unsubscribes from bar updates of the specified bar type. Read more
§fn unsubscribe_instrument_close(
&mut self,
cmd: &UnsubscribeInstrumentClose,
) -> Result<(), Error>
fn unsubscribe_instrument_close( &mut self, cmd: &UnsubscribeInstrumentClose, ) -> Result<(), Error>
Unsubscribes from instrument close events for the specified instrument. Read more
§fn unsubscribe_blocks(&mut self, cmd: &UnsubscribeBlocks) -> Result<(), Error>
fn unsubscribe_blocks(&mut self, cmd: &UnsubscribeBlocks) -> Result<(), Error>
Unsubscribes from blocks for a specified blockchain. Read more
§fn unsubscribe_pool(&mut self, cmd: &UnsubscribePool) -> Result<(), Error>
fn unsubscribe_pool(&mut self, cmd: &UnsubscribePool) -> Result<(), Error>
Unsubscribes from pool definition updates for a specified AMM pool. Read more
§fn unsubscribe_pool_swaps(
&mut self,
cmd: &UnsubscribePoolSwaps,
) -> Result<(), Error>
fn unsubscribe_pool_swaps( &mut self, cmd: &UnsubscribePoolSwaps, ) -> Result<(), Error>
Unsubscribes from swaps for a specified AMM pool. Read more
§fn unsubscribe_pool_liquidity_updates(
&mut self,
cmd: &UnsubscribePoolLiquidityUpdates,
) -> Result<(), Error>
fn unsubscribe_pool_liquidity_updates( &mut self, cmd: &UnsubscribePoolLiquidityUpdates, ) -> Result<(), Error>
Unsubscribes from pool liquidity updates for a specified AMM pool. Read more
§fn request_data(&self, request: &RequestCustomData) -> Result<(), Error>
fn request_data(&self, request: &RequestCustomData) -> Result<(), Error>
Sends a custom data request to the provider. Read more
Source§impl Debug for DatabentoDataClient
impl Debug for DatabentoDataClient
Source§impl<'py> IntoPyObject<'py> for DatabentoDataClient
impl<'py> IntoPyObject<'py> for DatabentoDataClient
Source§type Target = DatabentoDataClient
type Target = DatabentoDataClient
The Python output type
Source§type Output = Bound<'py, <DatabentoDataClient as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <DatabentoDataClient as IntoPyObject<'py>>::Target>
The smart pointer type to use. Read more
Source§fn into_pyobject(
self,
py: Python<'py>,
) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
fn into_pyobject( self, py: Python<'py>, ) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
Performs the conversion.
Source§impl PyClass for DatabentoDataClient
impl PyClass for DatabentoDataClient
Source§impl PyClassImpl for DatabentoDataClient
impl PyClassImpl for DatabentoDataClient
Source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
#[pyclass(subclass)]
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
#[pyclass(extends=…)]
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
#[pyclass(mapping)]
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
#[pyclass(sequence)]
Source§const IS_IMMUTABLE_TYPE: bool = false
const IS_IMMUTABLE_TYPE: bool = false
#[pyclass(immutable_type)]
Source§type ThreadChecker = SendablePyClass<DatabentoDataClient>
type ThreadChecker = SendablePyClass<DatabentoDataClient>
This handles following two situations: Read more
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Immutable or mutable
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
The closest native ancestor. This is
PyAny
by default, and when you declare
#[pyclass(extends=PyDict)]
, it’s PyDict
.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
Source§impl<'a, 'py> PyFunctionArgument<'a, 'py, false> for &'a DatabentoDataClient
impl<'a, 'py> PyFunctionArgument<'a, 'py, false> for &'a DatabentoDataClient
Source§impl<'a, 'py> PyFunctionArgument<'a, 'py, false> for &'a mut DatabentoDataClient
impl<'a, 'py> PyFunctionArgument<'a, 'py, false> for &'a mut DatabentoDataClient
Source§impl PyTypeInfo for DatabentoDataClient
impl PyTypeInfo for DatabentoDataClient
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
Returns the PyTypeObject instance for this type.
§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
Returns the safe abstraction over the type object.
§fn is_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_type_of(object: &Bound<'_, PyAny>) -> bool
Checks if
object
is an instance of this type or a subclass of this type.§fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
Checks if
object
is an instance of this type.impl DerefToPyAny for DatabentoDataClient
Auto Trait Implementations§
impl !Freeze for DatabentoDataClient
impl !RefUnwindSafe for DatabentoDataClient
impl Send for DatabentoDataClient
impl Sync for DatabentoDataClient
impl Unpin for DatabentoDataClient
impl !UnwindSafe for DatabentoDataClient
Blanket Implementations§
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
§fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
Converts
self
into an owned Python object, dropping type information.§fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
Converts
self
into an owned Python object, dropping type information and unbinding it
from the 'py
lifetime.§fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
Converts
self
into a Python object. Read more