Trait IterExtractExt

Source
pub trait IterExtractExt:
    Iterator<Item = Row>
    + Sized
    + Sealed2 {
    // Required method
    fn extract<T: ExtractOwned>(self) -> ExtractIter<T, Self> ;
}
Expand description

Extension trait for extracting from an iterator over Row.

Required Methods§

Source

fn extract<T: ExtractOwned>(self) -> ExtractIter<T, Self>

Turns the iterator into an iterator over T.

§Examples
#[derive(Columns, Extract)]
struct User {
    id: i32,
    name: String,
}

fn extract_users(i: impl Iterator<Item = Row>) -> Vec<User> {
    i.extract().collect()
}

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<I> IterExtractExt for I
where I: Iterator<Item = Row>,