pub struct ConnectionManager { /* private fields */ }Expand description
连接管理器
Implementations§
Source§impl ConnectionManager
impl ConnectionManager
Sourcepub fn new(config: ConnectionConfig) -> Result<Self>
pub fn new(config: ConnectionConfig) -> Result<Self>
创建新的连接管理器
Sourcepub fn connection_string(&self) -> &str
pub fn connection_string(&self) -> &str
获取连接字符串
Sourcepub fn get_connection_string(&self) -> Result<String>
pub fn get_connection_string(&self) -> Result<String>
获取连接字符串(返回所有权)
Sourcepub fn database_type(&self) -> &DatabaseType
pub fn database_type(&self) -> &DatabaseType
获取数据库类型
Sourcepub fn config(&self) -> &ConnectionConfig
pub fn config(&self) -> &ConnectionConfig
获取配置
Sourcepub fn test_connection(&self) -> Result<()>
pub fn test_connection(&self) -> Result<()>
测试连接
Auto Trait Implementations§
impl Freeze for ConnectionManager
impl RefUnwindSafe for ConnectionManager
impl Send for ConnectionManager
impl Sync for ConnectionManager
impl Unpin for ConnectionManager
impl UnwindSafe for ConnectionManager
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> 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