[][src]Struct quaint::connector::ResultRowRef

pub struct ResultRowRef<'a> { /* fields omitted */ }

A reference to a Row in a ResultSet. The columns can be accessed either through their position or using the column name.

let names = vec!["id".to_string(), "name".to_string()];
let rows = vec![vec!["1234".into(), "Musti".into()]];

let result_set = ResultSet::new(names, rows);
let row = result_set.first().unwrap();

assert_eq!(row[0], row["id"]);
assert_eq!(row[1], row["name"]);

Methods

impl<'a> ResultRowRef<'a>[src]

pub fn at(&self, i: usize) -> Option<&ParameterizedValue<'static>>[src]

Take a value from a certain position in the row, if having a value in that position.

assert_eq!(Some(&row[0]), row.at(0));

pub fn get(&self, name: &str) -> Option<&ParameterizedValue<'static>>[src]

Take a value with the given column name from the row.

assert_eq!(Some(&row["id"]), row.get("id"));

Trait Implementations

impl<'a> Debug for ResultRowRef<'a>[src]

impl<'a, I: ValueIndex<ResultRowRef<'a>, ParameterizedValue<'static>> + 'static> Index<I> for ResultRowRef<'a>[src]

type Output = ParameterizedValue<'static>

The returned type after indexing.

impl<'_> ValueIndex<ResultRowRef<'_>, ParameterizedValue<'static>> for usize[src]

impl<'_, '_> ValueIndex<ResultRowRef<'_>, ParameterizedValue<'static>> for &'_ str[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for ResultRowRef<'a>

impl<'a> Send for ResultRowRef<'a>

impl<'a> Sync for ResultRowRef<'a>

impl<'a> Unpin for ResultRowRef<'a>

impl<'a> UnwindSafe for ResultRowRef<'a>

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