Skip to main content

ErasedMemory

Trait ErasedMemory 

Source
pub trait ErasedMemory: Send + Sync {
    // Required methods
    fn add_message_erased<'a>(
        &'a self,
        message: &'a Message,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>;
    fn get_messages_erased<'a>(
        &'a self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Message>>> + Send + 'a>>;
    fn clear_erased<'a>(
        &'a self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>;
}
Expand description

Object-safe wrapper for the Memory trait, enabling dynamic dispatch via Arc<dyn ErasedMemory>.

Required Methods§

Source

fn add_message_erased<'a>( &'a self, message: &'a Message, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>

Source

fn get_messages_erased<'a>( &'a self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Message>>> + Send + 'a>>

Source

fn clear_erased<'a>( &'a self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§