pub struct PostgresCacheDatabase {
pub pool: PgPool,
/* private fields */
}
Fields§
§pool: PgPool
Implementations§
Trait Implementations§
Source§impl CacheDatabaseAdapter for PostgresCacheDatabase
impl CacheDatabaseAdapter for PostgresCacheDatabase
fn close(&mut self) -> Result<()>
fn flush(&mut self) -> Result<()>
fn load_all<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<CacheMap>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load(&self) -> Result<HashMap<String, Bytes>>
fn load_currencies<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<HashMap<Ustr, Currency>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_instruments<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<HashMap<InstrumentId, InstrumentAny>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_synthetics<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<HashMap<InstrumentId, SyntheticInstrument>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_accounts<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<HashMap<AccountId, AccountAny>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_orders<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<HashMap<ClientOrderId, OrderAny>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_positions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<HashMap<PositionId, Position>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_index_order_position(&self) -> Result<HashMap<ClientOrderId, Position>>
fn load_index_order_client(&self) -> Result<HashMap<ClientOrderId, ClientId>>
fn load_currency<'life0, 'life1, 'async_trait>(
&'life0 self,
code: &'life1 Ustr,
) -> Pin<Box<dyn Future<Output = Result<Option<Currency>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_instrument<'life0, 'life1, 'async_trait>(
&'life0 self,
instrument_id: &'life1 InstrumentId,
) -> Pin<Box<dyn Future<Output = Result<Option<InstrumentAny>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_synthetic<'life0, 'life1, 'async_trait>(
&'life0 self,
instrument_id: &'life1 InstrumentId,
) -> Pin<Box<dyn Future<Output = Result<Option<SyntheticInstrument>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_account<'life0, 'life1, 'async_trait>(
&'life0 self,
account_id: &'life1 AccountId,
) -> Pin<Box<dyn Future<Output = Result<Option<AccountAny>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_order<'life0, 'life1, 'async_trait>(
&'life0 self,
client_order_id: &'life1 ClientOrderId,
) -> Pin<Box<dyn Future<Output = Result<Option<OrderAny>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_position<'life0, 'life1, 'async_trait>(
&'life0 self,
position_id: &'life1 PositionId,
) -> Pin<Box<dyn Future<Output = Result<Option<Position>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_actor( &self, component_id: &ComponentId, ) -> Result<HashMap<String, Bytes>>
fn delete_actor(&self, component_id: &ComponentId) -> Result<()>
fn load_strategy( &self, strategy_id: &StrategyId, ) -> Result<HashMap<String, Bytes>>
fn delete_strategy(&self, component_id: &StrategyId) -> Result<()>
fn add(&self, key: String, value: Bytes) -> Result<()>
fn add_currency(&self, currency: &Currency) -> Result<()>
fn add_instrument(&self, instrument: &InstrumentAny) -> Result<()>
fn add_synthetic(&self, synthetic: &SyntheticInstrument) -> Result<()>
fn add_account(&self, account: &AccountAny) -> Result<()>
fn add_order(&self, order: &OrderAny, client_id: Option<ClientId>) -> Result<()>
fn add_order_snapshot(&self, snapshot: &OrderSnapshot) -> Result<()>
fn add_position(&self, position: &Position) -> Result<()>
fn add_position_snapshot(&self, snapshot: &PositionSnapshot) -> Result<()>
fn add_order_book(&self, order_book: &OrderBook) -> Result<()>
fn add_quote(&self, quote: &QuoteTick) -> Result<()>
fn load_quotes(&self, instrument_id: &InstrumentId) -> Result<Vec<QuoteTick>>
fn add_trade(&self, trade: &TradeTick) -> Result<()>
fn load_trades(&self, instrument_id: &InstrumentId) -> Result<Vec<TradeTick>>
fn add_bar(&self, bar: &Bar) -> Result<()>
fn load_bars(&self, instrument_id: &InstrumentId) -> Result<Vec<Bar>>
fn add_signal(&self, signal: &Signal) -> Result<()>
fn load_signals(&self, name: &str) -> Result<Vec<Signal>>
fn add_custom_data(&self, data: &CustomData) -> Result<()>
fn load_custom_data(&self, data_type: &DataType) -> Result<Vec<CustomData>>
fn load_order_snapshot( &self, client_order_id: &ClientOrderId, ) -> Result<Option<OrderSnapshot>>
fn load_position_snapshot( &self, position_id: &PositionId, ) -> Result<Option<PositionSnapshot>>
fn index_venue_order_id( &self, client_order_id: ClientOrderId, venue_order_id: VenueOrderId, ) -> Result<()>
fn index_order_position( &self, client_order_id: ClientOrderId, position_id: PositionId, ) -> Result<()>
fn update_actor(&self) -> Result<()>
fn update_strategy(&self) -> Result<()>
fn update_account(&self, account: &AccountAny) -> Result<()>
fn update_order(&self, event: &OrderEventAny) -> Result<()>
fn update_position(&self, position: &Position) -> Result<()>
fn snapshot_order_state(&self, order: &OrderAny) -> Result<()>
fn snapshot_position_state(&self, position: &Position) -> Result<()>
fn heartbeat(&self, timestamp: UnixNanos) -> Result<()>
Source§impl Debug for PostgresCacheDatabase
impl Debug for PostgresCacheDatabase
Source§impl IntoPy<Py<PyAny>> for PostgresCacheDatabase
impl IntoPy<Py<PyAny>> for PostgresCacheDatabase
Source§impl<'py> IntoPyObject<'py> for PostgresCacheDatabase
impl<'py> IntoPyObject<'py> for PostgresCacheDatabase
Source§type Target = PostgresCacheDatabase
type Target = PostgresCacheDatabase
The Python output type
Source§type Output = Bound<'py, <PostgresCacheDatabase as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <PostgresCacheDatabase 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 PostgresCacheDatabase
impl PyClass for PostgresCacheDatabase
Source§impl PyClassImpl for PostgresCacheDatabase
impl PyClassImpl for PostgresCacheDatabase
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§type ThreadChecker = SendablePyClass<PostgresCacheDatabase>
type ThreadChecker = SendablePyClass<PostgresCacheDatabase>
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> for &'a PostgresCacheDatabase
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a PostgresCacheDatabase
Source§impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a mut PostgresCacheDatabase
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a mut PostgresCacheDatabase
Source§impl PyMethods<PostgresCacheDatabase> for PyClassImplCollector<PostgresCacheDatabase>
impl PyMethods<PostgresCacheDatabase> for PyClassImplCollector<PostgresCacheDatabase>
fn py_methods(self) -> &'static PyClassItems
Source§impl PyTypeInfo for PostgresCacheDatabase
impl PyTypeInfo for PostgresCacheDatabase
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 type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
👎Deprecated since 0.23.0: renamed to
PyTypeInfo::type_object
Deprecated name for [
PyTypeInfo::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_type_of_bound(object: &Bound<'_, PyAny>) -> bool
fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool
👎Deprecated since 0.23.0: renamed to
PyTypeInfo::is_type_of
Deprecated name for [
PyTypeInfo::is_type_of
].§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.§fn is_exact_type_of_bound(object: &Bound<'_, PyAny>) -> bool
fn is_exact_type_of_bound(object: &Bound<'_, PyAny>) -> bool
👎Deprecated since 0.23.0: renamed to
PyTypeInfo::is_exact_type_of
Deprecated name for [
PyTypeInfo::is_exact_type_of
].impl DerefToPyAny for PostgresCacheDatabase
Auto Trait Implementations§
impl Freeze for PostgresCacheDatabase
impl !RefUnwindSafe for PostgresCacheDatabase
impl Send for PostgresCacheDatabase
impl Sync for PostgresCacheDatabase
impl Unpin for PostgresCacheDatabase
impl !UnwindSafe for PostgresCacheDatabase
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