pub trait Segment:
Send
+ Sync
+ 'static {
// Required methods
fn compact(
&self,
out_file: &impl FileExt,
id: Uuid,
) -> impl Future<Output = Result<Vec<u8>>> + Send;
fn start_frame_no(&self) -> u64;
fn last_committed(&self) -> u64;
fn index(&self) -> &Map<Arc<[u8]>>;
fn read_page(
&self,
page_no: u32,
max_frame_no: u64,
buf: &mut [u8],
) -> Result<bool>;
fn is_checkpointable(&self) -> bool;
fn size_after(&self) -> u32;
async fn read_frame_offset_async<B>(
&self,
offset: u32,
buf: B,
) -> (B, Result<()>)
where B: IoBufMut + Send + 'static;
fn timestamp(&self) -> DateTime<Utc>;
fn destroy<IO: Io>(&self, io: &IO) -> impl Future<Output = ()>;
}Required Methods§
fn compact( &self, out_file: &impl FileExt, id: Uuid, ) -> impl Future<Output = Result<Vec<u8>>> + Send
fn start_frame_no(&self) -> u64
fn last_committed(&self) -> u64
fn index(&self) -> &Map<Arc<[u8]>>
fn read_page( &self, page_no: u32, max_frame_no: u64, buf: &mut [u8], ) -> Result<bool>
Sourcefn is_checkpointable(&self) -> bool
fn is_checkpointable(&self) -> bool
returns the number of readers currently holding a reference to this log. The read count must monotonically decrease.
Sourcefn size_after(&self) -> u32
fn size_after(&self) -> u32
The size of the database after applying this segment.
async fn read_frame_offset_async<B>( &self, offset: u32, buf: B, ) -> (B, Result<()>)
fn timestamp(&self) -> DateTime<Utc>
fn destroy<IO: Io>(&self, io: &IO) -> impl Future<Output = ()>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.