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)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

impl MessageBusDatabaseAdapter for RedisMessageBusDatabase