[][src]Struct concatsql::Row

pub struct Row { /* fields omitted */ }

A single result row of a query.

Implementations

impl Row[src]

pub fn get<T: Get>(&self, key: T) -> Option<&str>[src]

Get the value of a column of the result row.

Examples

for row in conn.rows("SELECT 1").unwrap() {
    assert_eq!(row.get(0).unwrap(),   "1");
    assert_eq!(row.get("1").unwrap(), "1");
}

pub fn get_into<T: Get, U: FromSql>(&self, key: T) -> Result<U, Error>[src]

Transforms and gets the columns of the result row.
⚠️ If column is NULL then execute U::from_str("").

Examples

for row in conn.rows("SELECT 1").unwrap() {
    assert_eq!(row.get_into::<_, i32>(0).unwrap(),   1);
    assert_eq!(row.get_into::<_, i32>("1").unwrap(), 1);

    assert_eq!(row.get_into::<_, String>(0).unwrap(),   "1");
    assert_eq!(row.get_into::<_, String>("1").unwrap(), "1");

    let one: u8 = row.get_into(0).unwrap();
    assert_eq!(one, 1u8);
}

pub fn column_count(&self) -> usize[src]

Return the number of columns.

pub fn is_empty(&self) -> bool[src]

Determines if there are any values in the row.

pub fn column_names(&self) -> Vec<&str>[src]

Get all the column names.

Trait Implementations

impl Debug for Row[src]

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