pub struct RelevancyDb { /* private fields */ }
Expand description
A thread-safe wrapper around an SQLite connection to the Relevancy database
Implementations§
source§impl RelevancyDb
impl RelevancyDb
pub fn new(path: impl AsRef<Path>) -> Self
pub fn close(&self)
pub fn interrupt(&self)
sourcepub fn read<T>(
&self,
op: impl FnOnce(&RelevancyDao<'_>) -> Result<T>,
) -> Result<T>
pub fn read<T>( &self, op: impl FnOnce(&RelevancyDao<'_>) -> Result<T>, ) -> Result<T>
Accesses the Suggest database in a transaction for reading.
sourcepub fn read_write<T>(
&self,
op: impl FnOnce(&mut RelevancyDao<'_>) -> Result<T>,
) -> Result<T>
pub fn read_write<T>( &self, op: impl FnOnce(&mut RelevancyDao<'_>) -> Result<T>, ) -> Result<T>
Accesses the Suggest database in a transaction for reading and writing.
Auto Trait Implementations§
impl !Freeze for RelevancyDb
impl !RefUnwindSafe for RelevancyDb
impl Send for RelevancyDb
impl Sync for RelevancyDb
impl Unpin for RelevancyDb
impl !UnwindSafe for RelevancyDb
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<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
Create a new handle for an Arc value Read more
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
Clone a handle Read more
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Consume a handle, getting back the initial
Arc<>
Read more