[][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.

Implementations

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<[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 Clone for Row[src]

impl Debug for Row[src]

impl FromRow for Row[src]

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

type Output = Value

The returned type after indexing.

impl Index<usize> for Row[src]

type Output = Value

The returned type after indexing.

impl PartialEq<Row> for Row[src]

impl StructuralPartialEq for Row[src]

Auto Trait Implementations

impl RefUnwindSafe for Row

impl Send for Row

impl Sync for Row

impl Unpin for Row

impl UnwindSafe for Row

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,