pub enum TrackId {
Local(PathBuf),
Server {
service: MusicService,
item_id: String,
},
}Expand description
Typed track identity — replaces the old Track.path synthetic-string hack.
Local tracks are a filesystem path; server tracks are a service + item id.
The cover reference is a separate Track.cover field, NOT part of identity.
Variants§
Implementations§
Source§impl TrackId
impl TrackId
Sourcepub fn key(&self) -> Cow<'_, str>
pub fn key(&self) -> Cow<'_, str>
The bare key within its source — the file-path string (local) or the
item/video id (server). This is the DB track_key.
Sourcepub fn local_path(&self) -> Option<&Path>
pub fn local_path(&self) -> Option<&Path>
The filesystem path, if this is a local track.
Sourcepub fn service(&self) -> Option<MusicService>
pub fn service(&self) -> Option<MusicService>
The media service, if this is a server track.
Sourcepub fn uid(&self) -> String
pub fn uid(&self) -> String
A stable, source-qualified identity string (no cover): the file path for
local, or "<service-prefix>:<item_id>" for server. For logging /
cross-source string keys.
Sourcepub fn from_legacy_path(s: &str) -> Self
pub fn from_legacy_path(s: &str) -> Self
Parse a legacy Track.path string ("service:id[:cover]" or a real
path). Used ONLY by the migration importer; the 3rd cover segment is
dropped here (the importer sets Track.cover separately).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TrackId
impl<'de> Deserialize<'de> for TrackId
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>,
impl Eq for TrackId
impl StructuralPartialEq for TrackId
Auto Trait Implementations§
impl Freeze for TrackId
impl RefUnwindSafe for TrackId
impl Send for TrackId
impl Sync for TrackId
impl Unpin for TrackId
impl UnsafeUnpin for TrackId
impl UnwindSafe for TrackId
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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
key and return true if they are equal.