Struct scylla::transport::iterator::QueryPager
source · pub struct QueryPager { /* private fields */ }
Expand description
An intermediate object that allows to construct a stream over a query that is asynchronously paged in the background.
Before the results can be processed in a convenient way, the QueryPager
needs to be cast into a typed stream. This is done by use of rows_stream()
method.
As the method is generic over the target type, the turbofish syntax
can come in handy there, e.g. query_pager.rows_stream::<(i32, String, Uuid)>()
.
A pre-0.15.0 interface is also available, although deprecated:
into_legacy()
method converts QueryPager to LegacyRowIterator,
enabling Stream’ed operation on rows being eagerly deserialized
to the middle-man Row type. This is inefficient, especially if
Row is not the intended target type.
Implementations§
source§impl QueryPager
impl QueryPager
sourcepub fn type_check<'frame, 'metadata, RowT: DeserializeRow<'frame, 'metadata>>(
&self,
) -> Result<(), TypeCheckError>
pub fn type_check<'frame, 'metadata, RowT: DeserializeRow<'frame, 'metadata>>( &self, ) -> Result<(), TypeCheckError>
Type-checks the iterator against given type.
This is automatically called upon transforming QueryPager into TypedRowStream.
Can be used with next()
for manual deserialization. See next()
for an example.
sourcepub fn rows_stream<RowT: 'static + for<'frame, 'metadata> DeserializeRow<'frame, 'metadata>>(
self,
) -> Result<TypedRowStream<RowT>, TypeCheckError>
pub fn rows_stream<RowT: 'static + for<'frame, 'metadata> DeserializeRow<'frame, 'metadata>>( self, ) -> Result<TypedRowStream<RowT>, TypeCheckError>
sourcepub fn into_legacy(self) -> LegacyRowIterator
👎Deprecated since 0.15.0: Legacy deserialization API is inefficient and is going to be removed soon
pub fn into_legacy(self) -> LegacyRowIterator
Converts this iterator into an iterator over rows parsed as given type, using the legacy deserialization framework. This is inefficient, because all rows are being eagerly deserialized to a middle-man Row type.
sourcepub fn tracing_ids(&self) -> &[Uuid]
pub fn tracing_ids(&self) -> &[Uuid]
If tracing was enabled returns tracing ids of all finished page queries
sourcepub fn column_specs(&self) -> ColumnSpecs<'_>
pub fn column_specs(&self) -> ColumnSpecs<'_>
Returns specification of row columns
Auto Trait Implementations§
impl !Freeze for QueryPager
impl RefUnwindSafe for QueryPager
impl Send for QueryPager
impl Sync for QueryPager
impl Unpin for QueryPager
impl UnwindSafe for QueryPager
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more