pub struct Track { /* private fields */ }Expand description
Track root. Defines file info, container info, metadata info
Implementations§
Source§impl Track
impl Track
pub fn id(&self) -> TrackId
pub fn container(&self) -> &MediaContainer
pub fn loudnorm_analysis(&self) -> Option<&LoudnormAnalysis>
pub fn is_single(&self) -> bool
pub fn metadata(&self) -> &TrackMeta
pub fn metadata_mut(&mut self) -> &mut TrackMeta
pub fn album( &self, db: &LibraryDb, ) -> Result<Option<TrackAlbumInfo>, DatabaseError>
Source§impl Track
impl Track
pub fn db_find_by_title( name: impl AsRef<str>, ) -> Result<Vec<Self>, DatabaseError>
pub fn db_find_by_path( path: impl AsRef<Path>, ) -> Result<Option<Self>, DatabaseError>
Trait Implementations§
Source§impl Cacheable for Track
impl Cacheable for Track
fn cache() -> &'static Mutex<DbCache<Self>>
fn cache_get( id: Self::Id, db: &Self::Db, ) -> Result<Option<Arc<Self>>, TransactionError>
fn cache_get_batch<I>(
ids: I,
db: &Self::Db,
) -> Result<Vec<Arc<Self>>, TransactionError>where
I: IntoIterator<Item = Self::Id>,
fn cache_get_all_from(db: &Self::Db) -> Result<Vec<Arc<Self>>, TransactionError>
Source§impl DatabaseEntry for Track
impl DatabaseEntry for Track
Source§const VERSION_NUMBER: u32 = 1
const VERSION_NUMBER: u32 = 1
The current version number of the struct, used for updating
type Id = TrackId
type Db = LibraryDb
Source§fn db_check(id: Self::Id, db: &Self::Db) -> Result<bool, TransactionError>
fn db_check(id: Self::Id, db: &Self::Db) -> Result<bool, TransactionError>
Checks if an item exists in the database as lightly as possible Read more
Source§fn db_get_all(db: &Self::Db) -> Result<Vec<Self>, TransactionError>
fn db_get_all(db: &Self::Db) -> Result<Vec<Self>, TransactionError>
Source§fn db_get_batch<I>(ids: I, db: &Self::Db) -> Result<Vec<Self>, TransactionError>where
I: IntoIterator<Item = Self::Id>,
fn db_get_batch<I>(ids: I, db: &Self::Db) -> Result<Vec<Self>, TransactionError>where
I: IntoIterator<Item = Self::Id>,
Source§fn pre_upsert(
&mut self,
_cas_tx: &CompareAndSwapTransaction<Self::Db>,
) -> Result<(), TransactionError>
fn pre_upsert( &mut self, _cas_tx: &CompareAndSwapTransaction<Self::Db>, ) -> Result<(), TransactionError>
This function is called before a value is upserted, allowing you to make last moment changes before its upserted into the database, like field sorting
Source§impl<'de> Deserialize<'de> for Track
impl<'de> Deserialize<'de> for Track
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Resolveable for Track
impl Resolveable for Track
impl Eq for Track
Auto Trait Implementations§
impl Freeze for Track
impl RefUnwindSafe for Track
impl Send for Track
impl Sync for Track
impl Unpin for Track
impl UnsafeUnpin for Track
impl UnwindSafe for Track
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> EntryExtensions for Twhere
T: DatabaseEntry,
impl<T> EntryExtensions for Twhere
T: DatabaseEntry,
Source§fn db_upsert(self, db: DbHandle<Self::Db>) -> Result<(), TransactionError>
fn db_upsert(self, db: DbHandle<Self::Db>) -> Result<(), TransactionError>
Upserts an entry from the database Read more
Source§fn db_insert(self, db: DbHandle<Self::Db>) -> Result<(), TransactionError>
fn db_insert(self, db: DbHandle<Self::Db>) -> Result<(), TransactionError>
Inserts an entry from the database Read more
fn db_merge(
self,
from: Self,
db: DbHandle<Self::Db>,
) -> Result<Self, TransactionError>where
Self: Mergeable,
Source§fn db_patch(self, db: DbHandle<Self::Db>) -> Result<Self, TransactionError>where
Self: Mergeable,
fn db_patch(self, db: DbHandle<Self::Db>) -> Result<Self, TransactionError>where
Self: Mergeable,
Attempts to merge the input entry into the existing entry. Upserts if the entry is not found Read more
fn db_merge_batch(
self,
from: impl IntoIterator<Item = Self> + Clone,
db: DbHandle<Self::Db>,
) -> Result<Self, TransactionError>where
Self: Mergeable,
fn db_delete(
&mut self,
item: Self,
db: DbHandle<Self::Db>,
) -> Result<(), TransactionError>where
Self: Deleteable,
fn db_delete_id<Id>(
id: Self::Id,
db: DbHandle<Self::Db>,
) -> Result<(), TransactionError>where
Self: Deleteable,
fn db_create(
args: Self::CreateArgs,
db: DbHandle<Self::Db>,
) -> Result<Self, CustomTransactionError<Self::Err>>where
Self: Createable,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
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