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§
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)
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.