[−][src]Struct quaint::connector::ResultRowRef
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.
fn index(&self, index: I) -> &ParameterizedValue<'static>
[src]
impl<'_> ValueIndex<ResultRowRef<'_>, ParameterizedValue<'static>> for usize
[src]
fn index_into<'v>(
self,
row: &'v ResultRowRef
) -> &'v ParameterizedValue<'static>
[src]
self,
row: &'v ResultRowRef
) -> &'v ParameterizedValue<'static>
impl<'_, '_> ValueIndex<ResultRowRef<'_>, ParameterizedValue<'static>> for &'_ str
[src]
fn index_into<'v>(
self,
row: &'v ResultRowRef
) -> &'v ParameterizedValue<'static>
[src]
self,
row: &'v ResultRowRef
) -> &'v ParameterizedValue<'static>
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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]
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<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,