Struct termusiclib::sqlite::DataBase
source · pub struct DataBase { /* private fields */ }Implementations§
source§impl DataBase
impl DataBase
sourcepub fn new(config: &Settings) -> Self
pub fn new(config: &Settings) -> Self
§Panics
- if app config path creation fails
- if any required database operation fails
pub fn sync_database(&mut self, path: &Path)
sourcepub fn get_all_records(&mut self) -> Result<Vec<TrackForDB>>
pub fn get_all_records(&mut self) -> Result<Vec<TrackForDB>>
§Panics
if the connection is unavailable
sourcepub fn get_record_by_criteria(
&mut self,
str: &str,
cri: &SearchCriteria
) -> Result<Vec<TrackForDB>>
pub fn get_record_by_criteria( &mut self, str: &str, cri: &SearchCriteria ) -> Result<Vec<TrackForDB>>
§Panics
if the connection is unavailable
sourcepub fn get_criterias(&mut self, cri: &SearchCriteria) -> Result<Vec<String>>
pub fn get_criterias(&mut self, cri: &SearchCriteria) -> Result<Vec<String>>
§Panics
if the connection is unavailable
sourcepub fn get_last_position(&mut self, track: &Track) -> Result<Duration>
pub fn get_last_position(&mut self, track: &Track) -> Result<Duration>
§Panics
if the connection is unavailable
sourcepub fn set_last_position(&mut self, track: &Track, last_position: Duration)
pub fn set_last_position(&mut self, track: &Track, last_position: Duration)
§Panics
if the connection is unavailable
sourcepub fn get_record_by_path(&mut self, str: &str) -> Result<TrackForDB>
pub fn get_record_by_path(&mut self, str: &str) -> Result<TrackForDB>
§Panics
if the connection is unavailable
Auto Trait Implementations§
impl Freeze for DataBase
impl !RefUnwindSafe for DataBase
impl Send for DataBase
impl Sync for DataBase
impl Unpin 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