Struct ResultSet
#[non_exhaustive]pub struct ResultSet {
pub command: String,
pub row_count: Option<u64>,
pub fields: Vec<FieldDescription>,
pub rows: Vec<Value>,
}Expand description
The result of one statement.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.command: StringThe SQL command tag: SELECT, INSERT, …
row_count: Option<u64>Rows affected, when the command reports it.
fields: Vec<FieldDescription>The column descriptions.
rows: Vec<Value>The rows, each a JSON object keyed by column name.
Held as serde_json::Value rather than a typed row because the adapter
issues several differently-shaped statements against one decoder, and
because every scalar needs an OID-directed conversion anyway.
Implementations§
§impl ResultSet
impl ResultSet
pub fn cell(&self, row: usize, column: &str) -> Option<&Value>
pub fn cell(&self, row: usize, column: &str) -> Option<&Value>
One column of one row, as the endpoint rendered it.
None covers three cases the callers all treat alike: there is no such
row, there is no such column, or the value is SQL NULL. Each decoder
that cares about the difference asks a second question rather than having
three variants threaded through every call site.
Trait Implementations§
§impl<'de> Deserialize<'de> for ResultSet
impl<'de> Deserialize<'de> for ResultSet
§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ResultSet
impl RefUnwindSafe for ResultSet
impl Send for ResultSet
impl Sync for ResultSet
impl Unpin for ResultSet
impl UnsafeUnpin for ResultSet
impl UnwindSafe for ResultSet
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