Struct fdb_rl::raw_record::RawRecordCursor
source · pub struct RawRecordCursor {
primary_key_schema: RawRecordPrimaryKeySchema,
values_limit: usize,
key_value_cursor: KeyValueCursor,
raw_record_state_machine: RawRecordStateMachine,
}
Expand description
A cursor that returns RawRecord
s from the FDB database.
Unlike Java Record Layer KeyValueUnsplitter
, in case of
RawRecordCursor
we do not exceed out-of-band limits.
In the event the underlying KeyValueCursor
we encounters an
out-of-band limit, the cursor state machine will discard any
partially read record, switch to a final state and return the
appropriate continuation.
Warning: This type is not meant to be public. We need to make this type public to support integration tests. Do not use this type in your code.
Fields§
§primary_key_schema: RawRecordPrimaryKeySchema
§values_limit: usize
§key_value_cursor: KeyValueCursor
§raw_record_state_machine: RawRecordStateMachine
Implementations§
source§impl RawRecordCursor
impl RawRecordCursor
sourcefn new(
primary_key_schema: RawRecordPrimaryKeySchema,
values_limit: usize,
key_value_cursor: KeyValueCursor,
raw_record_state_machine: RawRecordStateMachine
) -> RawRecordCursor
fn new( primary_key_schema: RawRecordPrimaryKeySchema, values_limit: usize, key_value_cursor: KeyValueCursor, raw_record_state_machine: RawRecordStateMachine ) -> RawRecordCursor
Create a new RawRecordCursor
Trait Implementations§
source§impl Cursor<RawRecord> for RawRecordCursor
impl Cursor<RawRecord> for RawRecordCursor
source§async fn next(&mut self) -> CursorResult<RawRecord>
async fn next(&mut self) -> CursorResult<RawRecord>
Return the next RawRecord
.
In regular state machines, where transitions are represented
using event [guard] / action
and we directly send the event
to the state machine.
However, in this case, all side effect of reading from the database is managed by the driver loop (below) and we only use the state machine to manage state data.
When we are in a state where we can return data (or error), we
exit the loop and return the data. This is managed by
returning a Some(_: CursorResult<RawRecord>)
value.