pub trait VertexCursor: Send + Debug {
// Required method
fn next_batch(
&mut self,
batch_size: usize,
) -> Result<Vec<Vertex>, StorageError>;
// Provided methods
fn next_flat_batch(
&mut self,
batch_size: usize,
) -> Result<Vec<FlatVertexRecord>, StorageError> { ... }
fn next_column_batch(
&mut self,
prop_names: &[Arc<str>],
batch_size: usize,
) -> Result<VertexColumnBatch, StorageError> { ... }
}Expand description
A cursor that yields vertices in batches.
Required Methods§
Sourcefn next_batch(&mut self, batch_size: usize) -> Result<Vec<Vertex>, StorageError>
fn next_batch(&mut self, batch_size: usize) -> Result<Vec<Vertex>, StorageError>
Read the next batch of vertices (at most batch_size rows).
Returns an empty Vec when the scan is exhausted.
Provided Methods§
Sourcefn next_flat_batch(
&mut self,
batch_size: usize,
) -> Result<Vec<FlatVertexRecord>, StorageError>
fn next_flat_batch( &mut self, batch_size: usize, ) -> Result<Vec<FlatVertexRecord>, StorageError>
Read the next batch as flat vertex records (at most batch_size
rows), skipping Vertex construction and HashMap boxing.
The default implementation materialises vertices via Self::next_batch
and converts them. Storage engines should override this when they can
produce records directly from the column store.
Returns an empty Vec when the scan is exhausted.
Sourcefn next_column_batch(
&mut self,
prop_names: &[Arc<str>],
batch_size: usize,
) -> Result<VertexColumnBatch, StorageError>
fn next_column_batch( &mut self, prop_names: &[Arc<str>], batch_size: usize, ) -> Result<VertexColumnBatch, StorageError>
Read the next batch as column-major data (at most batch_size rows),
skipping per-row VertexRecord / HashMap / Value materialization.
prop_names lists the properties to decode; an empty list means decode
every column of the scanned table(s). The returned batch carries one
PropertyColumn per requested property (or per table column when
prop_names is empty).
The default implementation falls back to Self::next_flat_batch and
transposes the rows into columns. Storage engines override this when
they can decode straight from the column store.
Returns an empty batch when the scan is exhausted.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".