pub trait MessageReader: Send + Sync {
type Request: Send;
type Output: Send;
// Required method
fn read(
&self,
request: Self::Request,
) -> impl Future<Output = Result<Self::Output, StoreError>> + Send;
}Expand description
Message read capability with implementation-owned request and output values.
A consumer generic over this capability cannot access lifecycle or administration operations that were not injected:
ⓘ
use rocketmq_store_api::MessageReader;
fn read_only<R: MessageReader>(reader: &mut R) {
reader.execute_admin(());
}Required Associated Types§
Required Methods§
Sourcefn read(
&self,
request: Self::Request,
) -> impl Future<Output = Result<Self::Output, StoreError>> + Send
fn read( &self, request: Self::Request, ) -> impl Future<Output = Result<Self::Output, StoreError>> + Send
Reads a bounded message window.
§Errors
Returns StoreError with crate::StoreOperation::Read when the
requested data cannot be read safely.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".