pub enum DialectKind {
MySQL,
PostgreSQL,
SQLite,
Oracle,
MSSQL,
}Expand description
方言种类枚举(用于 match 分发替代 Box
当 perf-enum-dispatch feature 启用时,可通过 DialectKind 直接 match 分发
到具体方言实现,避免动态分发的 vtable 间接寻址开销。
Variants§
Implementations§
Source§impl DialectKind
impl DialectKind
Sourcepub fn from_db_type(db_type: DbType) -> Option<Self>
pub fn from_db_type(db_type: DbType) -> Option<Self>
从 DbType 创建 DialectKind(不支持返回 None)
Sourcepub fn escape_string(&self, s: &str) -> String
pub fn escape_string(&self, s: &str) -> String
转义字符串字面量(match 分发)
Sourcepub fn to_dialect(&self) -> Box<dyn Dialect>
pub fn to_dialect(&self) -> Box<dyn Dialect>
转为 Box<dyn Dialect>
Trait Implementations§
Source§impl Clone for DialectKind
impl Clone for DialectKind
Source§fn clone(&self) -> DialectKind
fn clone(&self) -> DialectKind
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 moreimpl Copy for DialectKind
Source§impl Debug for DialectKind
impl Debug for DialectKind
impl Eq for DialectKind
Source§impl PartialEq for DialectKind
impl PartialEq for DialectKind
impl StructuralPartialEq for DialectKind
Auto Trait Implementations§
impl Freeze for DialectKind
impl RefUnwindSafe for DialectKind
impl Send for DialectKind
impl Sync for DialectKind
impl Unpin for DialectKind
impl UnsafeUnpin for DialectKind
impl UnwindSafe for DialectKind
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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