[−][src]Struct mysql_async::Row
Client side representation of a MySql row.
It allows you to move column values out of a row with Row::take
method but note that it
makes row incomplete. Calls to from_row_opt
on incomplete row will return
Error::FromRowError
and also numerical indexing on taken columns will panic.
Methods
impl Row
[src]
pub fn len(&self) -> usize
[src]
Returns length of a row.
pub fn columns_ref(&self) -> &[Column]
[src]
Returns columns of this row.
pub fn columns(&self) -> Arc<Vec<Column>>
[src]
Returns columns of this row.
pub fn as_ref(&self, index: usize) -> Option<&Value>
[src]
Returns reference to the value of a column with index index
if it exists and wasn't taken
by Row::take
method.
Non panicking version of row[usize]
.
pub fn get<T, I>(&self, index: I) -> Option<T> where
I: ColumnIndex,
T: FromValue,
[src]
I: ColumnIndex,
T: FromValue,
Will copy value at index index
if it was not taken by Row::take
earlier,
then will convert it to T
.
pub fn get_opt<T, I>(&self, index: I) -> Option<Result<T, FromValueError>> where
I: ColumnIndex,
T: FromValue,
[src]
I: ColumnIndex,
T: FromValue,
Will copy value at index index
if it was not taken by Row::take
or Row::take_opt
earlier, then will attempt convert it to T
. Unlike Row::get
, Row::get_opt
will
allow you to directly handle errors if the value could not be converted to T
.
pub fn take<T, I>(&mut self, index: I) -> Option<T> where
I: ColumnIndex,
T: FromValue,
[src]
I: ColumnIndex,
T: FromValue,
Will take value of a column with index index
if it exists and wasn't taken earlier then
will converts it to T
.
pub fn take_opt<T, I>(&mut self, index: I) -> Option<Result<T, FromValueError>> where
I: ColumnIndex,
T: FromValue,
[src]
I: ColumnIndex,
T: FromValue,
Will take value of a column with index index
if it exists and wasn't taken earlier then
will attempt to convert it to T
. Unlike Row::take
, Row::take_opt
will allow you to
directly handle errors if the value could not be converted to T
.
pub fn unwrap(self) -> Vec<Value>
[src]
Trait Implementations
impl FromRow for Row
[src]
fn from_row(row: Row) -> Row
[src]
fn from_row_opt(row: Row) -> Result<Row, FromRowError> where
Row: Sized,
[src]
Row: Sized,
impl Clone for Row
[src]
fn clone(&self) -> Row
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq<Row> for Row
[src]
impl<'a> Index<&'a str> for Row
[src]
type Output = Value
The returned type after indexing.
fn index(&'r self, index: &'a str) -> &'r Value
[src]
impl Index<usize> for Row
[src]
type Output = Value
The returned type after indexing.
fn index(&'a self, index: usize) -> &'a Value
[src]
impl Debug for Row
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T, Ir> FromRow for T where
Ir: ConvIr<T>,
T: FromValue<Intermediate = Ir>,
[src]
Ir: ConvIr<T>,
T: FromValue<Intermediate = Ir>,
fn from_row(row: Row) -> T
[src]
fn from_row_opt(row: Row) -> Result<T, FromRowError>
[src]
impl<T> Same<T> for T
type Output = T
Should always be Self