nautilus_common::msgbus::database

Trait MessageBusDatabaseAdapter

source
pub trait MessageBusDatabaseAdapter {
    type DatabaseType;

    // Required methods
    fn new(
        trader_id: TraderId,
        instance_id: UUID4,
        config: MessageBusConfig,
    ) -> Result<Self::DatabaseType>;
    fn is_closed(&self) -> bool;
    fn publish(&self, topic: String, payload: Bytes);
    fn close(&mut self);
}
Expand description

A generic message bus database facade.

The main operations take a consistent key and payload which should provide enough information to implement the message bus database in many different technologies.

Delete operations may need a payload to target specific values.

Required Associated Types§

Required Methods§

source

fn new( trader_id: TraderId, instance_id: UUID4, config: MessageBusConfig, ) -> Result<Self::DatabaseType>

source

fn is_closed(&self) -> bool

source

fn publish(&self, topic: String, payload: Bytes)

source

fn close(&mut self)

Object Safety§

This trait is not object safe.

Implementors§