pub struct CompareAndSwapTransaction { /* private fields */ }Implementations§
Source§impl CompareAndSwapTransaction
impl CompareAndSwapTransaction
Sourcepub fn tx_get<Id: EntryId>(
&self,
id: Id,
) -> Result<Option<Id::Entry>, DatabaseError>
pub fn tx_get<Id: EntryId>( &self, id: Id, ) -> Result<Option<Id::Entry>, DatabaseError>
Gets the latest version of the item in the transaction context, looking it up in the database if its unmodified
§Errors
Errors if DatabaseEntry::db_get() errors
pub fn tx_remove<Id: EntryId>(&mut self, key: Id) -> Result<(), DatabaseError>
pub fn tx_upsert<T: DatabaseEntry>( &mut self, key: T::Id, new: Option<T>, ) -> Result<(), DatabaseError>
pub fn tx_insert<T: DatabaseEntry>( &mut self, item: T, ) -> Result<(), DatabaseError>
pub fn get_or_new_request<T: DatabaseEntry>( &mut self, ) -> &mut TreeCompareAndSwap<T>
pub fn trees(&self) -> Vec<&Tree>
Source§impl CompareAndSwapTransaction
impl CompareAndSwapTransaction
Sourcepub fn relink_track_to_album(
&mut self,
track_id: TrackId,
album: Option<AlbumId>,
) -> Result<bool, DatabaseError>
pub fn relink_track_to_album( &mut self, track_id: TrackId, album: Option<AlbumId>, ) -> Result<bool, DatabaseError>
Applies a two-way relinking operation, relinking to the track to a new (or no) album, and disconnecting the tracks old album, if any
Sourcepub fn album_set_and_relink_artists(
&mut self,
album_id: AlbumId,
artists: &[ArtistId],
) -> Result<bool, DatabaseError>
pub fn album_set_and_relink_artists( &mut self, album_id: AlbumId, artists: &[ArtistId], ) -> Result<bool, DatabaseError>
Applies a two-way relinking operation, relinking artists to the album, and disconnecting references from removed artists
Sourcepub fn album_set_and_relink_tracks(
&mut self,
album_id: AlbumId,
tracks: &[TrackId],
) -> Result<bool, DatabaseError>
pub fn album_set_and_relink_tracks( &mut self, album_id: AlbumId, tracks: &[TrackId], ) -> Result<bool, DatabaseError>
Applies a two-way relinking operation, relinking tracks to the album, and disconnecting references from removed tracks
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CompareAndSwapTransaction
impl !RefUnwindSafe for CompareAndSwapTransaction
impl !Send for CompareAndSwapTransaction
impl !Sync for CompareAndSwapTransaction
impl Unpin for CompareAndSwapTransaction
impl UnsafeUnpin for CompareAndSwapTransaction
impl !UnwindSafe for CompareAndSwapTransaction
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
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