[][src]Struct tiberius::ExecuteResult

pub struct ExecuteResult { /* fields omitted */ }

A Stream of counts of affected rows resulting from an INSERT, UPDATE or DELETE query. The ExecuteResult needs to be polled empty before sending another query to the Client, failing to do so causes a flush before the next query, slowing it down in an undeterministic way.

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


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

let result: Vec<u64> = stream.into_iter().collect();
assert_eq!(vec![1, 2], result);

Implementations

impl<'a> ExecuteResult[src]

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

Aggregates all resulting row counts into a sum.


let rows_affected = conn
    .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, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

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