pub struct QueryResult<'a> { /* private fields */ }Expand description
Result of a query or statement execution.
Implementations§
Source§impl<'a> QueryResult<'a>
impl<'a> QueryResult<'a>
Sourcepub async fn fetch_all(self) -> Result<Block<Complex>>
pub async fn fetch_all(self) -> Result<Block<Complex>>
Fetch data from table. It returns a block that contains all rows.
Sourcepub fn stream_blocks(self) -> BoxStream<'a, Result<Block>>
pub fn stream_blocks(self) -> BoxStream<'a, Result<Block>>
Method that produces a stream of blocks containing rows
example:
let mut c = pool.get_handle().await?;
let mut result = c.query(sql_query)
.stream_blocks()
.try_for_each(|block| {
println!("{:?}\nblock counts: {} rows", block, block.row_count());
future::ready(Ok(()))
}).await?;Auto Trait Implementations§
impl<'a> !RefUnwindSafe for QueryResult<'a>
impl<'a> !UnwindSafe for QueryResult<'a>
impl<'a> Forget for QueryResult<'a>
impl<'a> Freeze for QueryResult<'a>where
&'a mut ClientHandle: Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<(String, Value)>: Freeze,
impl<'a> Move for QueryResult<'a>
impl<'a> Send for QueryResult<'a>where
I32NotAllOnes: Send,
Atomic<usize>: Send,
Registration: Send,
BoxRaw<dyn State<ClientConnectionData>>: Send,
RawVecInner: Send,
&'static str: Send,
Arc<dyn Error + Sync + Send>: Send,
&'static Tls12CipherSuite: Send,
&'static Tls13CipherSuite: Send,
BoxRaw<dyn MessageEncrypter>: Send,
BoxRaw<dyn MessageDecrypter>: Send,
&'static [u8]: Send,
&'static dyn Algorithm: Send,
Repr: Send,
Arc<Mutex<State>>: Send,
Arc<Vec<u8>>: Send,
NonZero<i32>: Send,
TzOffset: Send,
&'static SqlType: Send,
BoxRaw<Value>: Send,
Arc<Vec<Value>>: Send,
Arc<HashMap<Value, Value>>: Send,
Arc<Vec<(String, Value)>>: Send,
Arc<dyn ColumnData + Sync + Send>: Send,
BoxRaw<Cmd>: Send,
RawTable<((usize, Scanned), Scan)>: Send,
Arc<TransportStatus>: Send,
Arc<Inner>: Send,
impl<'a> Sync for QueryResult<'a>where
I32NotAllOnes: Sync,
Atomic<usize>: Sync,
Registration: Sync,
BoxRaw<dyn State<ClientConnectionData>>: Sync,
RawVecInner: Sync,
Arc<dyn Error + Sync + Send>: Sync,
BoxRaw<dyn MessageEncrypter>: Sync,
BoxRaw<dyn MessageDecrypter>: Sync,
Repr: Sync,
Arc<Mutex<State>>: Sync,
Arc<Vec<u8>>: Sync,
NonZero<i32>: Sync,
TzOffset: Sync,
BoxRaw<Value>: Sync,
Arc<Vec<Value>>: Sync,
Arc<HashMap<Value, Value>>: Sync,
Arc<Vec<(String, Value)>>: Sync,
Arc<dyn ColumnData + Sync + Send>: Sync,
BoxRaw<Cmd>: Sync,
RawTable<((usize, Scanned), Scan)>: Sync,
Arc<TransportStatus>: Sync,
Arc<Inner>: Sync,
impl<'a> Unpin for QueryResult<'a>
impl<'a> UnsafeUnpin for QueryResult<'a>where
&'a mut ClientHandle: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<(String, Value)>: UnsafeUnpin,
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
Mutably borrows from an owned value. Read more
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> ⓘ
Converts
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> ⓘ
Converts
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