pub struct DynamicSqlParser { /* private fields */ }Expand description
动态 SQL 解析器
Implementations§
Source§impl DynamicSqlParser
impl DynamicSqlParser
Sourcepub fn from_xml(xml: &str) -> Result<Self, DynamicSqlError>
pub fn from_xml(xml: &str) -> Result<Self, DynamicSqlError>
从 XML 字符串解析
Sourcepub fn build(
&self,
id: &str,
params: &SqlParams,
) -> Result<String, DynamicSqlError>
pub fn build( &self, id: &str, params: &SqlParams, ) -> Result<String, DynamicSqlError>
构建指定 ID 的 SQL 语句
Sourcepub fn build_with_binds(
&self,
id: &str,
params: &SqlParams,
) -> Result<(String, Vec<ParamValue>), DynamicSqlError>
pub fn build_with_binds( &self, id: &str, params: &SqlParams, ) -> Result<(String, Vec<ParamValue>), DynamicSqlError>
构建并返回 SQL + 绑定参数(按出现顺序)
Sourcepub fn statement_ids(&self) -> Vec<String>
pub fn statement_ids(&self) -> Vec<String>
列出所有已注册的语句 ID
Trait Implementations§
Source§impl Clone for DynamicSqlParser
impl Clone for DynamicSqlParser
Source§fn clone(&self) -> DynamicSqlParser
fn clone(&self) -> DynamicSqlParser
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 DynamicSqlParser
impl Debug for DynamicSqlParser
Auto Trait Implementations§
impl Freeze for DynamicSqlParser
impl RefUnwindSafe for DynamicSqlParser
impl Send for DynamicSqlParser
impl Sync for DynamicSqlParser
impl Unpin for DynamicSqlParser
impl UnsafeUnpin for DynamicSqlParser
impl UnwindSafe for DynamicSqlParser
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more