pub struct DatabaseQueries;
Implementations§
Source§impl DatabaseQueries
impl DatabaseQueries
pub fn serialize_payload<T: Serialize>( encoding: SerializationEncoding, payload: &T, ) -> Result<Vec<u8>>
pub fn deserialize_payload<T: DeserializeOwned>( encoding: SerializationEncoding, payload: &[u8], ) -> Result<T>
pub async fn scan_keys( con: &mut ConnectionManager, pattern: String, ) -> Result<Vec<String>>
pub async fn read( con: &ConnectionManager, trader_key: &str, key: &str, ) -> Result<Vec<Bytes>>
pub async fn load_all( con: &ConnectionManager, encoding: SerializationEncoding, trader_key: &str, ) -> Result<CacheMap>
pub async fn load_currencies( con: &ConnectionManager, trader_key: &str, encoding: SerializationEncoding, ) -> Result<HashMap<Ustr, Currency>>
pub async fn load_instruments( con: &ConnectionManager, trader_key: &str, encoding: SerializationEncoding, ) -> Result<HashMap<InstrumentId, InstrumentAny>>
pub async fn load_synthetics( con: &ConnectionManager, trader_key: &str, encoding: SerializationEncoding, ) -> Result<HashMap<InstrumentId, SyntheticInstrument>>
pub async fn load_accounts( con: &ConnectionManager, trader_key: &str, encoding: SerializationEncoding, ) -> Result<HashMap<AccountId, AccountAny>>
pub async fn load_orders( con: &ConnectionManager, trader_key: &str, encoding: SerializationEncoding, ) -> Result<HashMap<ClientOrderId, OrderAny>>
pub async fn load_positions( con: &ConnectionManager, trader_key: &str, encoding: SerializationEncoding, ) -> Result<HashMap<PositionId, Position>>
pub async fn load_currency( con: &ConnectionManager, trader_key: &str, code: &Ustr, encoding: SerializationEncoding, ) -> Result<Option<Currency>>
pub async fn load_instrument( con: &ConnectionManager, trader_key: &str, instrument_id: &InstrumentId, encoding: SerializationEncoding, ) -> Result<Option<InstrumentAny>>
pub async fn load_synthetic( con: &ConnectionManager, trader_key: &str, instrument_id: &InstrumentId, encoding: SerializationEncoding, ) -> Result<Option<SyntheticInstrument>>
pub async fn load_account( con: &ConnectionManager, trader_key: &str, account_id: &AccountId, encoding: SerializationEncoding, ) -> Result<Option<AccountAny>>
pub async fn load_order( con: &ConnectionManager, trader_key: &str, client_order_id: &ClientOrderId, encoding: SerializationEncoding, ) -> Result<Option<OrderAny>>
pub async fn load_position( con: &ConnectionManager, trader_key: &str, position_id: &PositionId, encoding: SerializationEncoding, ) -> Result<Option<Position>>
Auto Trait Implementations§
impl Freeze for DatabaseQueries
impl RefUnwindSafe for DatabaseQueries
impl Send for DatabaseQueries
impl Sync for DatabaseQueries
impl Unpin for DatabaseQueries
impl UnwindSafe for DatabaseQueries
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