Struct fdb_rl::raw_record::RawRecordCursorBuilder
source · pub(crate) struct RawRecordCursorBuilder {
primary_key_schema: Option<RawRecordPrimaryKeySchema>,
subspace: Option<Subspace>,
scan_limiter: Option<ScanLimiter>,
streaming_mode: Option<StreamingMode>,
limit: Option<usize>,
reverse: Option<bool>,
continuation: Option<Bytes>,
}
Expand description
A builder for RawRecordCursor
. A value of RawRecordCursor
can be built as shown below.
let raw_record_cursor = {
let primary_key_schema = RawRecordPrimaryKeySchema::try_from({
let mut tuple_schema = TupleSchema::new();
tuple_schema.push_front(TupleSchemaElement::String);
tuple_schema
})?;
let mut raw_record_cursor_builder = RawRecordCursorBuilder::new();
raw_record_cursor_builder
.subspace(Subspace::new(Bytes::new()).subspace(&{
let tup: (&str, &str, &str) = ("prefix", "subspace", "record");
let mut t = Tuple::new();
t.push_back::<String>(tup.0.to_string());
t.push_back::<String>(tup.1.to_string());
t.push_back::<String>(tup.2.to_string());
t
}))
.primary_key_schema(primary_key_schema)
.continuation(continuation_bytes);
raw_record_cursor_builder.build(&tr)
};
Fields§
§primary_key_schema: Option<RawRecordPrimaryKeySchema>
§subspace: Option<Subspace>
§scan_limiter: Option<ScanLimiter>
§streaming_mode: Option<StreamingMode>
§limit: Option<usize>
§reverse: Option<bool>
§continuation: Option<Bytes>
Implementations§
source§impl RawRecordCursorBuilder
impl RawRecordCursorBuilder
sourcepub(crate) fn new() -> RawRecordCursorBuilder
pub(crate) fn new() -> RawRecordCursorBuilder
Return a new builder.
sourcepub(crate) fn primary_key_schema(
&mut self,
primary_key_schema: RawRecordPrimaryKeySchema
) -> &mut RawRecordCursorBuilder
pub(crate) fn primary_key_schema( &mut self, primary_key_schema: RawRecordPrimaryKeySchema ) -> &mut RawRecordCursorBuilder
Sets the RawRecordPrimaryKeySchema
.
Note: If you intend to set a continuation, then you must
use the same RawRecordPrimaryKeySchema
used to build the
RawRecordCursor
that returned the continuation.
sourcepub(crate) fn subspace(
&mut self,
subspace: Subspace
) -> &mut RawRecordCursorBuilder
pub(crate) fn subspace( &mut self, subspace: Subspace ) -> &mut RawRecordCursorBuilder
Sets the Subspace
Note: If you intend to set a continuation, then you must
use the same Subspace
used to build the
RawRecordCursor
that returned the continuation.
sourcepub(crate) fn scan_limiter(
&mut self,
scan_limiter: ScanLimiter
) -> &mut RawRecordCursorBuilder
pub(crate) fn scan_limiter( &mut self, scan_limiter: ScanLimiter ) -> &mut RawRecordCursorBuilder
Sets the ScanLimiter
sourcepub(crate) fn streaming_mode(
&mut self,
streaming_mode: StreamingMode
) -> &mut RawRecordCursorBuilder
pub(crate) fn streaming_mode( &mut self, streaming_mode: StreamingMode ) -> &mut RawRecordCursorBuilder
Sets the StreamingMode
Note: If you intend to set a continuation, then you must
use the same StreamingMode
used to build the
RawRecordCursor
that returned the continuation.
sourcepub(crate) fn limit(&mut self, limit: usize) -> &mut RawRecordCursorBuilder
pub(crate) fn limit(&mut self, limit: usize) -> &mut RawRecordCursorBuilder
sourcepub(crate) fn reverse(&mut self, reverse: bool) -> &mut RawRecordCursorBuilder
pub(crate) fn reverse(&mut self, reverse: bool) -> &mut RawRecordCursorBuilder
Sets read order (lexicographic or non-lexicographic) of the primary key.
Note: If you intend to set a continuation, then you must
use the same value of reverse
used to build the
RawRecordCursor
that returned the continuation.
sourcepub(crate) fn continuation(
&mut self,
continuation: Bytes
) -> &mut RawRecordCursorBuilder
pub(crate) fn continuation( &mut self, continuation: Bytes ) -> &mut RawRecordCursorBuilder
Sets the continuation bytes that was previously returned.
sourcepub(crate) fn build<Tr>(
self,
read_transaction: &Tr
) -> FdbResult<RawRecordCursor>where
Tr: ReadTransaction,
pub(crate) fn build<Tr>( self, read_transaction: &Tr ) -> FdbResult<RawRecordCursor>where Tr: ReadTransaction,
Creates the configured RawRecordCursor
.