pub struct ExecResponse {
pub values: Rows,
pub next_cursor: Option<Value>,
pub prev_cursor: Option<Value>,
}Expand description
The result of a database operation.
Every database operation produces an ExecResponse containing Rows,
which may be a row count, a single value, or a stream of result rows.
Paginated queries may also include cursors for fetching subsequent pages.
§Examples
use toasty_core::driver::ExecResponse;
// Create a count response (e.g., from a DELETE that affected 3 rows)
let resp = ExecResponse::count(3);
assert_eq!(resp.values.into_count(), 3);Fields§
§values: RowsThe result values (rows, count, or stream).
next_cursor: Option<Value>Cursor to the next page (if paginated and more data exists).
prev_cursor: Option<Value>Cursor to the previous page (if backward pagination is supported).
Implementations§
Source§impl ExecResponse
impl ExecResponse
Sourcepub fn value_stream(values: impl Into<ValueStream>) -> Self
pub fn value_stream(values: impl Into<ValueStream>) -> Self
Creates a response wrapping a stream of values.
Sourcepub fn empty_value_stream() -> Self
pub fn empty_value_stream() -> Self
Creates a response with an empty value stream (no rows).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ExecResponse
impl !RefUnwindSafe for ExecResponse
impl Send for ExecResponse
impl !Sync for ExecResponse
impl Unpin for ExecResponse
impl !UnwindSafe for ExecResponse
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