Skip to main content

MySQLRow

Struct MySQLRow 

Source
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>

Source

pub const fn new(inner: &'row R) -> Self

Wraps a driver row without copying it.

Source

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§

Source§

impl<'row, R: Clone + ?Sized> Clone for MySQLRow<'row, R>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'row, R: Copy + ?Sized> Copy for MySQLRow<'row, R>

Source§

impl<'row, R: Debug + ?Sized> Debug for MySQLRow<'row, R>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for i8

Source§

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>

Reads this type from row, starting at column offset. Read more
Source§

fn from_row(row: &Row) -> Result<Self, DrizzleError>

Reads this type from row, starting at column 0. Read more
Source§

impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for i16

Source§

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>

Reads this type from row, starting at column offset. Read more
Source§

fn from_row(row: &Row) -> Result<Self, DrizzleError>

Reads this type from row, starting at column 0. Read more
Source§

impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for i32

Source§

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>

Reads this type from row, starting at column offset. Read more
Source§

fn from_row(row: &Row) -> Result<Self, DrizzleError>

Reads this type from row, starting at column 0. Read more
Source§

impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for i64

Source§

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>

Reads this type from row, starting at column offset. Read more
Source§

fn from_row(row: &Row) -> Result<Self, DrizzleError>

Reads this type from row, starting at column 0. Read more
Source§

impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for isize

Source§

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>

Reads this type from row, starting at column offset. Read more
Source§

fn from_row(row: &Row) -> Result<Self, DrizzleError>

Reads this type from row, starting at column 0. Read more
Source§

impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for u8

Source§

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>

Reads this type from row, starting at column offset. Read more
Source§

fn from_row(row: &Row) -> Result<Self, DrizzleError>

Reads this type from row, starting at column 0. Read more
Source§

impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for u16

Source§

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>

Reads this type from row, starting at column offset. Read more
Source§

fn from_row(row: &Row) -> Result<Self, DrizzleError>

Reads this type from row, starting at column 0. Read more
Source§

impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for u32

Source§

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>

Reads this type from row, starting at column offset. Read more
Source§

fn from_row(row: &Row) -> Result<Self, DrizzleError>

Reads this type from row, starting at column 0. Read more
Source§

impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for u64

Source§

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>

Reads this type from row, starting at column offset. Read more
Source§

fn from_row(row: &Row) -> Result<Self, DrizzleError>

Reads this type from row, starting at column 0. Read more
Source§

impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for usize

Source§

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>

Reads this type from row, starting at column offset. Read more
Source§

fn from_row(row: &Row) -> Result<Self, DrizzleError>

Reads this type from row, starting at column 0. Read more
Source§

impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for f32

Source§

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>

Reads this type from row, starting at column offset. Read more
Source§

fn from_row(row: &Row) -> Result<Self, DrizzleError>

Reads this type from row, starting at column 0. Read more
Source§

impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for f64

Source§

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>

Reads this type from row, starting at column offset. Read more
Source§

fn from_row(row: &Row) -> Result<Self, DrizzleError>

Reads this type from row, starting at column 0. Read more
Source§

impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for bool

Source§

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>

Reads this type from row, starting at column offset. Read more
Source§

fn from_row(row: &Row) -> Result<Self, DrizzleError>

Reads this type from row, starting at column 0. Read more
Source§

impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for char

Source§

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>

Reads this type from row, starting at column offset. Read more
Source§

fn from_row(row: &Row) -> Result<Self, DrizzleError>

Reads this type from row, starting at column 0. Read more
Source§

impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for String

Source§

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>

Reads this type from row, starting at column offset. Read more
Source§

fn from_row(row: &Row) -> Result<Self, DrizzleError>

Reads this type from row, starting at column 0. Read more
Source§

impl<'row, R: MySQLRowAccess + ?Sized> FromDrizzleRow<MySQLRow<'row, R>> for Vec<u8>

Source§

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>

Reads this type from row, starting at column offset. Read more
Source§

fn from_row(row: &Row) -> Result<Self, DrizzleError>

Reads this type from row, starting at column 0. Read more
Source§

impl<'row, R: MySQLRowAccess + ?Sized, const N: usize> FromDrizzleRow<MySQLRow<'row, R>> for [u8; N]

Source§

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>

Reads this type from row, starting at column offset. Read more
Source§

fn from_row(row: &Row) -> Result<Self, DrizzleError>

Reads this type from row, starting at column 0. Read more
Source§

impl<'row, R: MySQLRowAccess + ?Sized, const N: usize> FromDrizzleRow<MySQLRow<'row, R>> for [char; N]

Source§

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>

Reads this type from row, starting at column offset. Read more
Source§

fn from_row(row: &Row) -> Result<Self, DrizzleError>

Reads this type from row, starting at column 0. Read more
Source§

impl<'row, R, T> FromDrizzleRow<MySQLRow<'row, R>> for Option<T>
where R: MySQLRowAccess + ?Sized, T: FromDrizzleRow<MySQLRow<'row, R>>,

Source§

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

Number of columns this type reads from the row.
Source§

fn from_row(row: &Row) -> Result<Self, DrizzleError>

Reads this type from row, starting at column 0. Read more

Auto Trait Implementations§

§

impl<'row, R> Freeze for MySQLRow<'row, R>
where &'row R: Freeze, R: ?Sized,

§

impl<'row, R> RefUnwindSafe for MySQLRow<'row, R>

§

impl<'row, R> Send for MySQLRow<'row, R>
where &'row R: Send, R: ?Sized,

§

impl<'row, R> Sync for MySQLRow<'row, R>
where &'row R: Sync, R: ?Sized,

§

impl<'row, R> Unpin for MySQLRow<'row, R>
where &'row R: Unpin, R: ?Sized,

§

impl<'row, R> UnsafeUnpin for MySQLRow<'row, R>

§

impl<'row, R> UnwindSafe for MySQLRow<'row, R>
where &'row R: UnwindSafe, R: ?Sized,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<Joined, From> JoinKey<From, JoinReverse> for Joined
where From: Joinable<Joined> + ?Sized,

Source§

fn pairs() -> &'static [(&'static str, &'static str)]

(joined_column, from_column) pairs the ON condition matches, in key order, read through Self::pair.
Source§

fn pair(pair: &(&'static str, &'static str)) -> (&'static str, &'static str)

The (joined_column, from_column) names of pair.
Source§

impl<List> ListIncludes<Nil, ()> for List

Source§

impl<Mk> MarkerAggValidFor<()> for Mk

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> TypeEq<T> for T