pub trait SqlRead {
// Required methods
fn query_row<T, P, F>(
&self,
sql: &str,
params: P,
map: F,
) -> Result<T, Error>
where P: Params,
F: FnOnce(&Row<'_>) -> Result<T, Error>;
fn query<T, P, F>(
&self,
sql: &str,
params: P,
map: F,
) -> Result<Vec<T>, Error>
where P: Params,
F: FnMut(&Row<'_>) -> Result<T, Error>;
}Expand description
Ordinary SQL reads through a read context or a write’s, so code that reads the same way inside a write and outside one is written once. Inside a write it sees the write’s own changes.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".