pub trait RowStreamExtractExt: Sealed {
// Required methods
fn extract<T: ExtractOwned>(self) -> ExtractStream<T>;
fn extract_mut<T: ExtractOwned>(
self: Pin<&mut Self>,
) -> ExtractStreamMut<'_, T>;
}
Expand description
Extension trait for extracting from a RowStream
.
Required Methods§
Sourcefn extract<T: ExtractOwned>(self) -> ExtractStream<T>
fn extract<T: ExtractOwned>(self) -> ExtractStream<T>
Sourcefn extract_mut<T: ExtractOwned>(self: Pin<&mut Self>) -> ExtractStreamMut<'_, T>
fn extract_mut<T: ExtractOwned>(self: Pin<&mut Self>) -> ExtractStreamMut<'_, T>
§Examples
#[derive(Columns, Extract)]
struct User {
id: i32,
name: String,
}
async fn extract_users(i: Pin<&mut RowStream>) -> Result<Vec<User>, Error> {
i.extract_mut().try_collect().await
}
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.