1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use crate::{handles::Statement, CursorImpl, Error, Parameters};
pub struct Prepared<'open_connection> {
statement: Statement<'open_connection>,
}
impl<'o> Prepared<'o> {
pub(crate) fn new(statement: Statement<'o>) -> Self {
Self { statement }
}
pub fn execute(
&mut self,
params: impl Parameters,
) -> Result<CursorImpl<'o, &mut Statement<'o>>, Error> {
unsafe {
self.statement.reset_parameters()?;
params.bind_input_parameters(&mut self.statement)?;
self.statement.execute()?;
}
Ok(CursorImpl::new(&mut self.statement))
}
}