pub struct SqliteParamsBuf { /* private fields */ }Expand description
Reusable SQLite parameter buffer for hot prepared-statement loops.
Callers can allocate once, mutate values in place with the set_* methods, and pass the
buffer to SqlitePreparedStatement::*_params methods without rebuilding driver values from
RowValues on every iteration.
Implementations§
Source§impl SqliteParamsBuf
impl SqliteParamsBuf
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create an empty buffer with room for capacity parameters.
Sourcepub fn set_int(&mut self, index: usize, value: i64)
pub fn set_int(&mut self, index: usize, value: i64)
Set an integer parameter at zero-based index.
Sourcepub fn set_float(&mut self, index: usize, value: f64)
pub fn set_float(&mut self, index: usize, value: f64)
Set a floating-point parameter at zero-based index.
Sourcepub fn set_text(&mut self, index: usize, value: impl Into<String>)
pub fn set_text(&mut self, index: usize, value: impl Into<String>)
Set a text parameter at zero-based index.
Sourcepub fn set_bool(&mut self, index: usize, value: bool)
pub fn set_bool(&mut self, index: usize, value: bool)
Set a boolean parameter at zero-based index.
Sourcepub fn set_timestamp(&mut self, index: usize, value: NaiveDateTime)
pub fn set_timestamp(&mut self, index: usize, value: NaiveDateTime)
Set a timestamp parameter at zero-based index.
Sourcepub fn set_json(&mut self, index: usize, value: Value)
pub fn set_json(&mut self, index: usize, value: Value)
Set a JSON parameter at zero-based index.
Trait Implementations§
Source§impl Clone for SqliteParamsBuf
impl Clone for SqliteParamsBuf
Source§fn clone(&self) -> SqliteParamsBuf
fn clone(&self) -> SqliteParamsBuf
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SqliteParamsBuf
impl Debug for SqliteParamsBuf
Source§impl Default for SqliteParamsBuf
impl Default for SqliteParamsBuf
Source§fn default() -> SqliteParamsBuf
fn default() -> SqliteParamsBuf
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SqliteParamsBuf
impl RefUnwindSafe for SqliteParamsBuf
impl Send for SqliteParamsBuf
impl Sync for SqliteParamsBuf
impl Unpin for SqliteParamsBuf
impl UnsafeUnpin for SqliteParamsBuf
impl UnwindSafe for SqliteParamsBuf
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more