pub trait SegmentSink: Send + Sync {
// Required method
fn write<'life0, 'async_trait>(
&'life0 self,
sequence_id: SequenceId,
buffers: Vec<ByteBuffer>,
) -> Pin<Box<dyn Future<Output = VortexResult<SegmentId>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Required Methods§
Sourcefn write<'life0, 'async_trait>(
&'life0 self,
sequence_id: SequenceId,
buffers: Vec<ByteBuffer>,
) -> Pin<Box<dyn Future<Output = VortexResult<SegmentId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn write<'life0, 'async_trait>(
&'life0 self,
sequence_id: SequenceId,
buffers: Vec<ByteBuffer>,
) -> Pin<Box<dyn Future<Output = VortexResult<SegmentId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Write the given data into a segment, ordered based on the provided sequence identifier.
Implementations of this trait should call SequenceId::collapse on the provided
sequence_id if they need to ensure that the segment IDs are monotonically increasing.
While they hold onto the returned SequenceId, they can be sure that no other subsequent
calls to SequenceId::collapse will complete.
If they do not require ordered segment IDs, for example if segments are stored in random-access key/values storage, then the sequence ID can be dropped and the segment written immediately.