pub struct BulkWriter<'c> { /* private fields */ }Expand description
A batch of track writes held in one transaction. Each method delegates to the
shared per-row writer helper (upsert_track_in / replace_tags_in /
set_binary_tags_in / set_structural_blocks_in / upsert_art_in /
set_track_art_in) that also backs the Db<ReadWrite> writers, but runs it
on a single caller-held transaction so a whole batch commits with one fsync.
Implementations§
Source§impl BulkWriter<'_>
impl BulkWriter<'_>
pub fn upsert_track(&mut self, t: &NewTrack) -> Result<i64>
pub fn tracks_by_fingerprint(&self, fp: &str) -> Result<Vec<Track>>
pub fn set_track_checksums( &self, id: i64, fingerprint: Option<&str>, content_hash: Option<&str>, ) -> Result<()>
pub fn retarget_track( &self, id: i64, new_backing_path: &str, backing_size: u64, backing_mtime_ns: i64, backing_ctime_ns: i64, audio_offset: u64, audio_length: u64, fingerprint: Option<&str>, content_hash: Option<&str>, ) -> Result<()>
pub fn get_track_by_path(&self, path: &str) -> Result<Option<Track>>
pub fn set_structural_blocks( &mut self, track_id: i64, blocks: &[StructuralBlock], ) -> Result<()>
pub fn upsert_art(&mut self, a: &NewArt) -> Result<i64>
pub fn set_track_art(&mut self, track_id: i64, items: &[TrackArt]) -> Result<()>
pub fn commit(self) -> Result<()>
Auto Trait Implementations§
impl<'c> !RefUnwindSafe for BulkWriter<'c>
impl<'c> !Send for BulkWriter<'c>
impl<'c> !Sync for BulkWriter<'c>
impl<'c> !UnwindSafe for BulkWriter<'c>
impl<'c> Freeze for BulkWriter<'c>
impl<'c> Unpin for BulkWriter<'c>
impl<'c> UnsafeUnpin for BulkWriter<'c>
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