Struct oracle::Row

source ·
pub struct Row { /* private fields */ }
Expand description

Row in a result set of a select statement

Implementations§

source§

impl Row

source

pub fn get<I, T>(&self, colidx: I) -> Result<T>
where I: ColumnIndex, T: FromSql,

Gets the column value at the specified index.

source

pub fn sql_values(&self) -> &[SqlValue<'_>]

Returns column values as a vector of SqlValue

source

pub fn get_as<T>(&self) -> Result<T>
where T: RowValue,

Gets column values as specified type.

Type inference for the return type doesn’t work. You need to specify it explicitly such as row.get_as::<(i32, String)>(). See RowValue for available return types.

let conn = Connection::connect("scott", "tiger", "")?;
let mut stmt = conn.statement("select empno, ename from emp").build()?;

for result in stmt.query(&[])? {
    let row = result?;
    // Gets a row as `(i32, String)`.
    let (empno, ename) = row.get_as::<(i32, String)>()?;
    println!("{},{}", empno, ename);
}
source

pub fn column_info(&self) -> &[ColumnInfo]

Trait Implementations§

source§

impl Debug for Row

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl RowValue for Row

source§

fn get(row: &Row) -> Result<Row>

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§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.