pub struct SQLResult {
pub columns: Vec<String>,
pub column_types: Vec<Option<ColumnType>>,
pub rows: Vec<ResultRow>,
pub affected_rows: u64,
/* private fields */
}Fields§
§columns: Vec<String>Column order as the SELECT clause specified.
column_types: Vec<Option<ColumnType>>Statically bound SQL type for each output position. A missing entry represents a type that has not yet been resolved, never a type inferred from the first runtime value.
rows: Vec<ResultRow>One row per result document, with the named columns in
columns. Extra columns from _score etc. are included here
too.
affected_rows: u64Number of rows touched by an INSERT / UPDATE / DELETE.
Implementations§
Source§impl SQLResult
impl SQLResult
pub fn empty() -> Self
pub fn from_rows(columns: Vec<String>, rows: Vec<ResultRow>) -> Self
pub fn from_rows_with_positions( columns: Vec<String>, rows: Vec<ResultRow>, positional_rows: Option<Vec<Vec<Value>>>, ) -> Self
pub fn from_typed_rows_with_positions( columns: Vec<String>, column_types: Vec<Option<ColumnType>>, rows: Vec<ResultRow>, positional_rows: Option<Vec<Vec<Value>>>, ) -> Self
Sourcepub fn value_at(&self, row: usize, column: usize) -> Option<&Value>
pub fn value_at(&self, row: usize, column: usize) -> Option<&Value>
Return a result value by row and output-column position.
Positional access is the canonical way to distinguish repeated output labels. Named rows remain available for compatibility with existing callers.
pub fn from_affected(affected: u64) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SQLResult
impl RefUnwindSafe for SQLResult
impl Send for SQLResult
impl Sync for SQLResult
impl Unpin for SQLResult
impl UnsafeUnpin for SQLResult
impl UnwindSafe for SQLResult
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
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