pub struct TursoDatabase { /* private fields */ }Implementations§
Source§impl TursoDatabase
impl TursoDatabase
Sourcepub fn db_core(&self) -> Result<Arc<Database>, TursoError>
pub fn db_core(&self) -> Result<Arc<Database>, TursoError>
method to get turso_core::Database instance which can be useful for code which integrates with sdk-kit
Sourcepub fn io(&self) -> Result<Arc<dyn IO>, TursoError>
pub fn io(&self) -> Result<Arc<dyn IO>, TursoError>
method to get turso_core::IO instance which can be useful for code which integrates with sdk-kit
Sourcepub fn new(config: TursoDatabaseConfig) -> Arc<Self> ⓘ
pub fn new(config: TursoDatabaseConfig) -> Arc<Self> ⓘ
create database holder struct but do not initialize it yet this can be useful for some environments, where IO operations must be executed in certain fashion (and open do IO under the hood)
Sourcepub fn open(&self) -> Result<IOResult<()>, TursoError>
pub fn open(&self) -> Result<IOResult<()>, TursoError>
Async version of database opening that returns IOResult. Caller must drive the IO loop and pass state between calls. This is useful for environments where IO operations must be executed in a specific fashion.
Sourcepub fn connect(&self) -> Result<Arc<TursoConnection>, TursoError>
pub fn connect(&self) -> Result<Arc<TursoConnection>, TursoError>
creates database connection database must be already opened with Self::open method
Sourcepub fn to_capi(self: Arc<Self>) -> *mut turso_database_t
pub fn to_capi(self: Arc<Self>) -> *mut turso_database_t
helper method to get C raw container with TursoDatabase instance this method is used in the capi wrappers
Sourcepub unsafe fn ref_from_capi<'a>(
value: *const turso_database_t,
) -> Result<&'a Self, TursoError>
pub unsafe fn ref_from_capi<'a>( value: *const turso_database_t, ) -> Result<&'a Self, TursoError>
helper method to restore TursoDatabase ref from C raw container this method is used in the capi wrappers
§Safety
value must be a pointer returned from Self::to_capi method
Sourcepub unsafe fn arc_from_capi(value: *const turso_database_t) -> Arc<Self> ⓘ
pub unsafe fn arc_from_capi(value: *const turso_database_t) -> Arc<Self> ⓘ
helper method to restore TursoDatabase instance from C raw container this method is used in the capi wrappers
§Safety
value must be a pointer returned from Self::to_capi method
Auto Trait Implementations§
impl !Freeze for TursoDatabase
impl !RefUnwindSafe for TursoDatabase
impl !UnwindSafe for TursoDatabase
impl Send for TursoDatabase
impl Sync for TursoDatabase
impl Unpin for TursoDatabase
impl UnsafeUnpin for TursoDatabase
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
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> ⓘ
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> ⓘ
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