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

source

pub(crate) fn new() -> RawRecordCursorBuilder

Return a new builder.

source

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.

source

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.

source

pub(crate) fn scan_limiter( &mut self, scan_limiter: ScanLimiter ) -> &mut RawRecordCursorBuilder

Sets the ScanLimiter

source

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.

source

pub(crate) fn limit(&mut self, limit: usize) -> &mut RawRecordCursorBuilder

Sets the limit for the number of RawRecords to return.

Note

You cannot set the the limit to 0. If you intend to set a continuation, then you must adjust the limit parameter based on already returned number of RawRecords.

source

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.

source

pub(crate) fn continuation( &mut self, continuation: Bytes ) -> &mut RawRecordCursorBuilder

Sets the continuation bytes that was previously returned.

source

pub(crate) fn build<Tr>( self, read_transaction: &Tr ) -> FdbResult<RawRecordCursor>where Tr: ReadTransaction,

Creates the configured RawRecordCursor.

Trait Implementations§

source§

impl From<(Option<RawRecordPrimaryKeySchema>, Option<Subspace>, Option<ScanLimiter>, Option<StreamingMode>, Option<usize>, Option<bool>, Option<Bytes>)> for RawRecordCursorBuilder

source§

fn from( (primary_key_schema, subspace, scan_limiter, streaming_mode, limit, reverse, continuation): (Option<RawRecordPrimaryKeySchema>, Option<Subspace>, Option<ScanLimiter>, Option<StreamingMode>, Option<usize>, Option<bool>, Option<Bytes>) ) -> RawRecordCursorBuilder

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.