Trait IterExtractRefExt

Source
pub trait IterExtractRefExt<'a>:
    Iterator<Item = &'a Row>
    + Sized
    + Sealed1 {
    // Required method
    fn extract_ref<T: Extract<'a>>(self) -> ExtractIterRef<'a, T, Self> ;
}
Expand description

Extension trait for extracting from an iterator over &Row.

Required Methods§

Source

fn extract_ref<T: Extract<'a>>(self) -> ExtractIterRef<'a, T, Self>

Turns the iterator into an iterator over T.

§Examples
#[derive(Columns, Extract)]
struct User<'a> {
    id: i32,
    name: &'a str,
}

fn extract_users<'a>(i: impl Iterator<Item = &'a Row>) -> Vec<User<'a>> {
    i.extract_ref().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<'a, I> IterExtractRefExt<'a> for I
where I: Iterator<Item = &'a Row>,