pub struct QueryContext { /* private fields */ }Expand description
与查询上下文相关的结构体
Implementations§
Source§impl QueryContext
impl QueryContext
Sourcepub fn add_argument(&mut self, arg: impl ToString)
pub fn add_argument(&mut self, arg: impl ToString)
添加参数到 argumentsVec<String>
Sourcepub fn append_arguments(&mut self, arguments: &mut Vec<String>)
pub fn append_arguments(&mut self, arguments: &mut Vec<String>)
追加查询参数
Sourcepub fn set_last_insert_id(&mut self, id: i64)
pub fn set_last_insert_id(&mut self, id: i64)
设置最后的插入ID
Sourcepub fn set_query_result(&mut self, rows_affected: Option<u64>, success: bool)
pub fn set_query_result(&mut self, rows_affected: Option<u64>, success: bool)
设置查询结果
Sourcepub fn get_start_time(&self) -> Instant
pub fn get_start_time(&self) -> Instant
返回开始时间
Sourcepub fn get_query_id(&self) -> Uuid
pub fn get_query_id(&self) -> Uuid
返回查询ID
pub fn get_query(&self) -> &str
pub fn get_arguments(&self) -> &[String]
pub fn get_last_insert_id(&self) -> Option<i64>
pub fn get_rows_affected(&self) -> Option<u64>
pub fn is_success(&self) -> bool
Sourcepub fn format_arguments(&self) -> String
pub fn format_arguments(&self) -> String
格式化参数. 将所有的参数通过 , 组合成字符串
Trait Implementations§
Source§impl Clone for QueryContext
impl Clone for QueryContext
Source§fn clone(&self) -> QueryContext
fn clone(&self) -> QueryContext
Returns a duplicate of the value. Read more
1.0.0 · 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 QueryContext
impl Debug for QueryContext
Auto Trait Implementations§
impl Freeze for QueryContext
impl RefUnwindSafe for QueryContext
impl Send for QueryContext
impl Sync for QueryContext
impl Unpin for QueryContext
impl UnwindSafe for QueryContext
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