Trait generic_db_observer::observer::EventSubject
source · pub trait EventSubject: Sized + Send + Sync {
type Config: Send + Sync;
type Connection;
type Error: Error + 'static;
// Required methods
fn connect(
config: &Self::Config
) -> impl Future<Output = Result<Self, Self::Error>> + Send;
fn on_init<ML: MsgListener>(
&mut self,
msg_broker: &mut ML
) -> impl Future<Output = Result<(), Self::Error>> + Send;
fn on_notify<ML: MsgListener>(
&mut self,
msg_broker: &mut ML
) -> impl Future<Output = Result<(), Self::Error>> + Send;
}Expand description
Describes structures that can act as an Event Subject, such as an IRC Chat Monitor or any system that needs real-time monitoring and dynamic state alignment based on external conditions.
Required Associated Types§
sourcetype Connection
type Connection
Connection interface for the event subject.
Required Methods§
sourcefn connect(
config: &Self::Config
) -> impl Future<Output = Result<Self, Self::Error>> + Send
fn connect( config: &Self::Config ) -> impl Future<Output = Result<Self, Self::Error>> + Send
Establishes connection to the event subject using specific configuration. This should enable further operations without additional preparations.
Object Safety§
This trait is not object safe.