Defines the Row trait for database rows, offering typed access, decoding, and error handling.
// Source: https://github.com/transact-rs/sqlx | License: Apache-2.0 | Copyright SQLx Contributors
// Provided via justclaw.it.com; keep this notice with the code.
use crate::column::{Column, ColumnIndex};
use crate::database::Database;
use crate::decode::Decode;
use crate::error::{mismatched_types, Error};
use crate::type_checking::TypeChecking;
use crate::type_info::TypeInfo;
use crate::types::Type;
use crate::value::ValueRef;
/// Represents a single row from the database.
///
/// [`FromRow`]: crate::row::FromRow
/// [`Query::fetch`]: crate::query::Query::fetch
pub trait Row: Unpin + Send + Sync + 'static {
type Database: Database<Row = Self>;
/// Returns `true` if this row has no columns.
#[inline]
fn is_empty(&self) -> bool {
self.len() == 0
}
/// Re
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key