pub trait LogReader:
Send
+ Sized
+ 'static {
// Required methods
fn init(&mut self) -> impl Future<Output = LogStoreResult<()>> + Send + '_;
fn next_item(
&mut self,
) -> impl Future<Output = LogStoreResult<(u64, LogStoreReadItem)>> + Send + '_;
fn truncate(&mut self, offset: TruncateOffset) -> LogStoreResult<()>;
fn rewind(
&mut self,
) -> impl Future<Output = LogStoreResult<(bool, Option<Bitmap>)>> + Send + '_;
}
Required Methods§
sourcefn init(&mut self) -> impl Future<Output = LogStoreResult<()>> + Send + '_
fn init(&mut self) -> impl Future<Output = LogStoreResult<()>> + Send + '_
Initialize the log reader. Usually function as waiting for log writer to be initialized.
sourcefn next_item(
&mut self,
) -> impl Future<Output = LogStoreResult<(u64, LogStoreReadItem)>> + Send + '_
fn next_item( &mut self, ) -> impl Future<Output = LogStoreResult<(u64, LogStoreReadItem)>> + Send + '_
Emit the next item.
The implementation should ensure that the future is cancellation safe.
sourcefn truncate(&mut self, offset: TruncateOffset) -> LogStoreResult<()>
fn truncate(&mut self, offset: TruncateOffset) -> LogStoreResult<()>
Mark that all items emitted so far have been consumed and it is safe to truncate the log from the current offset.
Object Safety§
This trait is not object safe.