[][src]Struct tiberius::ExecuteResult

pub struct ExecuteResult { /* fields omitted */ }

A result from a query execution, listing the number of affected rows.

If executing multiple queries, the resulting counts will be come separately, marking the rows affected for each query.

Example

let result = client
    .execute(
        "INSERT INTO #Test (id) VALUES (@P1); INSERT INTO #Test (id) VALUES (@P2, @P3)",
        &[&1i32, &2i32, &3i32],
    )
    .await?;

assert_eq!(&[1, 2], result.rows_affected());

Implementations

impl<'a> ExecuteResult[src]

pub fn rows_affected(&self) -> &[u64][src]

A slice of numbers of rows affected in the same order as the given queries.

pub fn total(self) -> u64[src]

Aggregates all resulting row counts into a sum.

Example

let rows_affected = client
    .execute(
        "INSERT INTO #Test (id) VALUES (@P1); INSERT INTO #Test (id) VALUES (@P2, @P3)",
        &[&1i32, &2i32, &3i32],
    )
    .await?;

assert_eq!(3, rows_affected.total());

Trait Implementations

impl Debug for ExecuteResult[src]

impl IntoIterator for ExecuteResult[src]

type Item = u64

The type of the elements being iterated over.

type IntoIter = IntoIter<Self::Item>

Which kind of iterator are we turning this into?

Auto Trait Implementations

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> Instrument for T[src]

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

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