pub struct MySQLRow<'row, R: ?Sized> { /* private fields */ }Expand description
A borrowed row that FromDrizzleRow types decode from.
§Examples
use drizzle_core::FromDrizzleRow;
use drizzle_mysql::MySQLRow;
use drizzle_mysql::values::OwnedMySQLValue;
let cells = vec![
OwnedMySQLValue::Int(7),
OwnedMySQLValue::Bytes(b"Alice".to_vec()),
OwnedMySQLValue::Null,
];
let row = MySQLRow::new(&cells);
assert_eq!(i64::from_row_at(&row, 0)?, 7);
assert_eq!(String::from_row_at(&row, 1)?, "Alice");
assert_eq!(Option::<String>::from_row_at(&row, 2)?, None);
assert!(row.is_null_at(3).is_err());Implementations§
Source§impl<'row, R: MySQLRowAccess + ?Sized> MySQLRow<'row, R>
impl<'row, R: MySQLRowAccess + ?Sized> MySQLRow<'row, R>
Sourcepub fn is_null_at(&self, offset: usize) -> Result<bool, DrizzleError>
pub fn is_null_at(&self, offset: usize) -> Result<bool, DrizzleError>
Returns whether the cell at offset is SQL NULL.
§Errors
Returns an error when the row has no cell at offset or the driver
cannot read the row.
Trait Implementations§
impl<'row, R: Copy + ?Sized> Copy for MySQLRow<'row, R>
Source§impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for i8
impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for i8
Source§const COLUMN_COUNT: usize = 1
const COLUMN_COUNT: usize = 1
Number of columns this type reads from the row.
Source§fn from_row_at(
row: &MySQLRow<'row, R>,
offset: usize,
) -> Result<Self, DrizzleError>
fn from_row_at( row: &MySQLRow<'row, R>, offset: usize, ) -> Result<Self, DrizzleError>
Source§impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for i16
impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for i16
Source§const COLUMN_COUNT: usize = 1
const COLUMN_COUNT: usize = 1
Number of columns this type reads from the row.
Source§fn from_row_at(
row: &MySQLRow<'row, R>,
offset: usize,
) -> Result<Self, DrizzleError>
fn from_row_at( row: &MySQLRow<'row, R>, offset: usize, ) -> Result<Self, DrizzleError>
Source§impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for i32
impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for i32
Source§const COLUMN_COUNT: usize = 1
const COLUMN_COUNT: usize = 1
Number of columns this type reads from the row.
Source§fn from_row_at(
row: &MySQLRow<'row, R>,
offset: usize,
) -> Result<Self, DrizzleError>
fn from_row_at( row: &MySQLRow<'row, R>, offset: usize, ) -> Result<Self, DrizzleError>
Source§impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for i64
impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for i64
Source§const COLUMN_COUNT: usize = 1
const COLUMN_COUNT: usize = 1
Number of columns this type reads from the row.
Source§fn from_row_at(
row: &MySQLRow<'row, R>,
offset: usize,
) -> Result<Self, DrizzleError>
fn from_row_at( row: &MySQLRow<'row, R>, offset: usize, ) -> Result<Self, DrizzleError>
Source§impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for isize
impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for isize
Source§const COLUMN_COUNT: usize = 1
const COLUMN_COUNT: usize = 1
Number of columns this type reads from the row.
Source§fn from_row_at(
row: &MySQLRow<'row, R>,
offset: usize,
) -> Result<Self, DrizzleError>
fn from_row_at( row: &MySQLRow<'row, R>, offset: usize, ) -> Result<Self, DrizzleError>
Source§impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for u8
impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for u8
Source§const COLUMN_COUNT: usize = 1
const COLUMN_COUNT: usize = 1
Number of columns this type reads from the row.
Source§fn from_row_at(
row: &MySQLRow<'row, R>,
offset: usize,
) -> Result<Self, DrizzleError>
fn from_row_at( row: &MySQLRow<'row, R>, offset: usize, ) -> Result<Self, DrizzleError>
Source§impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for u16
impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for u16
Source§const COLUMN_COUNT: usize = 1
const COLUMN_COUNT: usize = 1
Number of columns this type reads from the row.
Source§fn from_row_at(
row: &MySQLRow<'row, R>,
offset: usize,
) -> Result<Self, DrizzleError>
fn from_row_at( row: &MySQLRow<'row, R>, offset: usize, ) -> Result<Self, DrizzleError>
Source§impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for u32
impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for u32
Source§const COLUMN_COUNT: usize = 1
const COLUMN_COUNT: usize = 1
Number of columns this type reads from the row.
Source§fn from_row_at(
row: &MySQLRow<'row, R>,
offset: usize,
) -> Result<Self, DrizzleError>
fn from_row_at( row: &MySQLRow<'row, R>, offset: usize, ) -> Result<Self, DrizzleError>
Source§impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for u64
impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for u64
Source§const COLUMN_COUNT: usize = 1
const COLUMN_COUNT: usize = 1
Number of columns this type reads from the row.
Source§fn from_row_at(
row: &MySQLRow<'row, R>,
offset: usize,
) -> Result<Self, DrizzleError>
fn from_row_at( row: &MySQLRow<'row, R>, offset: usize, ) -> Result<Self, DrizzleError>
Source§impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for usize
impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for usize
Source§const COLUMN_COUNT: usize = 1
const COLUMN_COUNT: usize = 1
Number of columns this type reads from the row.
Source§fn from_row_at(
row: &MySQLRow<'row, R>,
offset: usize,
) -> Result<Self, DrizzleError>
fn from_row_at( row: &MySQLRow<'row, R>, offset: usize, ) -> Result<Self, DrizzleError>
Source§impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for f32
impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for f32
Source§const COLUMN_COUNT: usize = 1
const COLUMN_COUNT: usize = 1
Number of columns this type reads from the row.
Source§fn from_row_at(
row: &MySQLRow<'row, R>,
offset: usize,
) -> Result<Self, DrizzleError>
fn from_row_at( row: &MySQLRow<'row, R>, offset: usize, ) -> Result<Self, DrizzleError>
Source§impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for f64
impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for f64
Source§const COLUMN_COUNT: usize = 1
const COLUMN_COUNT: usize = 1
Number of columns this type reads from the row.
Source§fn from_row_at(
row: &MySQLRow<'row, R>,
offset: usize,
) -> Result<Self, DrizzleError>
fn from_row_at( row: &MySQLRow<'row, R>, offset: usize, ) -> Result<Self, DrizzleError>
Source§impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for bool
impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for bool
Source§const COLUMN_COUNT: usize = 1
const COLUMN_COUNT: usize = 1
Number of columns this type reads from the row.
Source§fn from_row_at(
row: &MySQLRow<'row, R>,
offset: usize,
) -> Result<Self, DrizzleError>
fn from_row_at( row: &MySQLRow<'row, R>, offset: usize, ) -> Result<Self, DrizzleError>
Source§impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for char
impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for char
Source§const COLUMN_COUNT: usize = 1
const COLUMN_COUNT: usize = 1
Number of columns this type reads from the row.
Source§fn from_row_at(
row: &MySQLRow<'row, R>,
offset: usize,
) -> Result<Self, DrizzleError>
fn from_row_at( row: &MySQLRow<'row, R>, offset: usize, ) -> Result<Self, DrizzleError>
Source§impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for String
impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for String
Source§const COLUMN_COUNT: usize = 1
const COLUMN_COUNT: usize = 1
Number of columns this type reads from the row.
Source§fn from_row_at(
row: &MySQLRow<'row, R>,
offset: usize,
) -> Result<Self, DrizzleError>
fn from_row_at( row: &MySQLRow<'row, R>, offset: usize, ) -> Result<Self, DrizzleError>
Source§impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for Vec<u8>
impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for Vec<u8>
Source§const COLUMN_COUNT: usize = 1
const COLUMN_COUNT: usize = 1
Number of columns this type reads from the row.
Source§fn from_row_at(
row: &MySQLRow<'row, R>,
offset: usize,
) -> Result<Self, DrizzleError>
fn from_row_at( row: &MySQLRow<'row, R>, offset: usize, ) -> Result<Self, DrizzleError>
Source§impl<'row, R: MySQLRowAccess + ?Sized, const N: usize> FromDrizzleRow<MySQLRow<'row, R>> for [u8; N]
impl<'row, R: MySQLRowAccess + ?Sized, const N: usize> FromDrizzleRow<MySQLRow<'row, R>> for [u8; N]
Source§const COLUMN_COUNT: usize = 1
const COLUMN_COUNT: usize = 1
Number of columns this type reads from the row.
Source§fn from_row_at(
row: &MySQLRow<'row, R>,
offset: usize,
) -> Result<Self, DrizzleError>
fn from_row_at( row: &MySQLRow<'row, R>, offset: usize, ) -> Result<Self, DrizzleError>
Source§impl<'row, R: MySQLRowAccess + ?Sized, const N: usize> FromDrizzleRow<MySQLRow<'row, R>> for [char; N]
impl<'row, R: MySQLRowAccess + ?Sized, const N: usize> FromDrizzleRow<MySQLRow<'row, R>> for [char; N]
Source§const COLUMN_COUNT: usize = 1
const COLUMN_COUNT: usize = 1
Number of columns this type reads from the row.
Source§fn from_row_at(
row: &MySQLRow<'row, R>,
offset: usize,
) -> Result<Self, DrizzleError>
fn from_row_at( row: &MySQLRow<'row, R>, offset: usize, ) -> Result<Self, DrizzleError>
Source§impl<'row, R, T> FromDrizzleRow<MySQLRow<'row, R>> for Option<T>
impl<'row, R, T> FromDrizzleRow<MySQLRow<'row, R>> for Option<T>
Source§fn from_row_at(
row: &MySQLRow<'row, R>,
offset: usize,
) -> Result<Self, DrizzleError>
fn from_row_at( row: &MySQLRow<'row, R>, offset: usize, ) -> Result<Self, DrizzleError>
A multi-column T (a select model in a LEFT JOIN) is absent only
when every one of its columns is NULL.
Source§const COLUMN_COUNT: usize = T::COLUMN_COUNT
const COLUMN_COUNT: usize = T::COLUMN_COUNT
Number of columns this type reads from the row.
Auto Trait Implementations§
impl<'row, R> Freeze for MySQLRow<'row, R>
impl<'row, R> RefUnwindSafe for MySQLRow<'row, R>
impl<'row, R> Send for MySQLRow<'row, R>
impl<'row, R> Sync for MySQLRow<'row, R>
impl<'row, R> Unpin for MySQLRow<'row, R>
impl<'row, R> UnsafeUnpin for MySQLRow<'row, R>
impl<'row, R> UnwindSafe for MySQLRow<'row, R>
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