AnyReader

Trait AnyReader 

Source
pub trait AnyReader: Send {
    // Required method
    fn recv_any<'a>(
        &'a mut self,
    ) -> Pin<Box<dyn Future<Output = DbResult<Box<dyn Any + Send>>> + Send + 'a>>;
}
Expand description

Helper trait for type-erased reading

Allows reading values from a buffer without knowing the concrete type at compile time. The value is returned as Box and must be downcast by the caller.

Required Methods§

Source

fn recv_any<'a>( &'a mut self, ) -> Pin<Box<dyn Future<Output = DbResult<Box<dyn Any + Send>>> + Send + 'a>>

Receive a type-erased value from the buffer

Returns Box which must be downcast to the concrete type. Returns an error if the buffer is closed or an I/O error occurs.

Implementors§