pub struct DatabaseService { /* private fields */ }Expand description
Turso 数据库服务
Implementations§
Source§impl DatabaseService
impl DatabaseService
Sourcepub async fn new(config: &DatabaseConfig) -> DatabaseResult<Self>
pub async fn new(config: &DatabaseConfig) -> DatabaseResult<Self>
从配置创建数据库服务
Sourcepub async fn in_memory() -> DatabaseResult<Self>
pub async fn in_memory() -> DatabaseResult<Self>
创建内存数据库
Sourcepub async fn file<P: Into<PathBuf>>(path: P) -> DatabaseResult<Self>
pub async fn file<P: Into<PathBuf>>(path: P) -> DatabaseResult<Self>
创建文件数据库
Sourcepub fn connect(&self) -> DatabaseResult<TursoConnection>
pub fn connect(&self) -> DatabaseResult<TursoConnection>
获取连接
Auto Trait Implementations§
impl Freeze for DatabaseService
impl !RefUnwindSafe for DatabaseService
impl Send for DatabaseService
impl Sync for DatabaseService
impl Unpin for DatabaseService
impl UnsafeUnpin for DatabaseService
impl !UnwindSafe for DatabaseService
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