Struct rusqlite::Batch[][src]

pub struct Batch<'conn, 'sql> { /* fields omitted */ }

Batch iterator

use rusqlite::{Batch, Connection, Result};

fn main() -> Result<()> {
    let conn = Connection::open_in_memory()?;
    let sql = r"
    CREATE TABLE tbl1 (col);
    CREATE TABLE tbl2 (col);
    ";
    let mut batch = Batch::new(&conn, sql);
    while let Some(mut stmt) = batch.next()? {
        stmt.execute([])?;
    }
    Ok(())
}

Implementations

impl<'conn, 'sql> Batch<'conn, 'sql>[src]

pub fn new(conn: &'conn Connection, sql: &'sql str) -> Batch<'conn, 'sql>

Notable traits for Batch<'conn, '_>

impl<'conn> Iterator for Batch<'conn, '_> type Item = Result<Statement<'conn>>;
[src]

Constructor

pub fn next(&mut self) -> Result<Option<Statement<'conn>>>[src]

Iterates on each batch statements.

Returns Ok(None) when batch is completed.

Trait Implementations

impl<'conn, 'sql> Debug for Batch<'conn, 'sql>[src]

impl<'conn> Iterator for Batch<'conn, '_>[src]

type Item = Result<Statement<'conn>>

The type of the elements being iterated over.

Auto Trait Implementations

impl<'conn, 'sql> !RefUnwindSafe for Batch<'conn, 'sql>

impl<'conn, 'sql> !Send for Batch<'conn, 'sql>

impl<'conn, 'sql> !Sync for Batch<'conn, 'sql>

impl<'conn, 'sql> Unpin for Batch<'conn, 'sql>

impl<'conn, 'sql> !UnwindSafe for Batch<'conn, 'sql>

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.