pub struct SqliteDatabaseHandle { /* private fields */ }Expand description
由 runtime 管理的单库句柄。 A single database handle managed by the runtime.
Implementations§
Source§impl SqliteDatabaseHandle
impl SqliteDatabaseHandle
Sourcepub fn new(
db_path: String,
options: SqliteOpenOptions,
) -> Result<Self, BoxError>
pub fn new( db_path: String, options: SqliteOpenOptions, ) -> Result<Self, BoxError>
创建单库句柄。 Create a single database handle.
Sourcepub fn options(&self) -> &SqliteOpenOptions
pub fn options(&self) -> &SqliteOpenOptions
获取当前句柄的打开选项。 Get the current handle’s open options.
Sourcepub fn lock_path(&self) -> Option<&Path>
pub fn lock_path(&self) -> Option<&Path>
返回关联的锁文件路径(如果有)。 Return the associated lock-file path, if any.
Sourcepub fn open_connection(&self) -> Result<Connection, BoxError>
pub fn open_connection(&self) -> Result<Connection, BoxError>
打开一个已按运行时规则初始化的 SQLite 连接。 Open a SQLite connection initialized with runtime rules.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SqliteDatabaseHandle
impl RefUnwindSafe for SqliteDatabaseHandle
impl Send for SqliteDatabaseHandle
impl Sync for SqliteDatabaseHandle
impl Unpin for SqliteDatabaseHandle
impl UnsafeUnpin for SqliteDatabaseHandle
impl UnwindSafe for SqliteDatabaseHandle
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request