pub struct Database { /* private fields */ }Implementations§
Source§impl Database
impl Database
pub fn new(path: &str) -> Result<Self>
pub fn insert_sighting(&self, sighting: &Sighting) -> Result<i64>
Sourcepub fn insert_sightings_batch(&self, sightings: &[Sighting]) -> Result<usize>
pub fn insert_sightings_batch(&self, sightings: &[Sighting]) -> Result<usize>
Batch insert sightings for better performance
pub fn get_all_sightings(&self) -> Result<Vec<Sighting>>
pub fn insert_species_status(&self, status: &SpeciesStatus) -> Result<i64>
pub fn get_species_status( &self, scientific_name: &str, ) -> Result<Option<SpeciesStatus>>
Sourcepub fn connection(&self) -> MutexGuard<'_, Connection>
pub fn connection(&self) -> MutexGuard<'_, Connection>
Get a reference to the underlying connection for auth/annotation modules
Auto Trait Implementations§
impl !Freeze for Database
impl RefUnwindSafe for Database
impl Send for Database
impl Sync for Database
impl Unpin for Database
impl UnsafeUnpin for Database
impl UnwindSafe for Database
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> DeserializeOwnedAlias for T
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