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§
Sourcefn extract_ref<T: Extract<'a>>(self) -> ExtractIterRef<'a, T, Self> ⓘ
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.