[][src]Struct mysql::Row

pub struct Row { /* fields omitted */ }

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]

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]

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]

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]

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]

Unwraps values of a row.

Panics

Panics if any of columns was taken by take method.

Trait Implementations

impl Debug for Row[src]

impl Index<usize> for Row[src]

type Output = Value

The returned type after indexing.

impl<'a> Index<&'a str> for Row[src]

type Output = Value

The returned type after indexing.

impl FromRow for Row[src]

impl PartialEq<Row> for Row[src]

impl Clone for Row[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Send for Row

impl Sync for Row

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T, Ir> FromRow for T where
    Ir: ConvIr<T>,
    T: FromValue<Intermediate = Ir>, 
[src]

impl<T> Same for T

type Output = T

Should always be Self