pub struct PlaybackSource {
pub size: u64,
pub mtime: u64,
pub mtime_ns: Option<u32>,
}Expand description
File evidence captured when selecting a resumable source.
This is a size/timestamp identity guard, not a checksum. No relocation is inferred: the accompanying track reference must still name the same path.
Fields§
§size: u64Original encoded-file size in bytes.
mtime: u64Modification timestamp, whole Unix seconds.
mtime_ns: Option<u32>Nanosecond fraction, when the source/catalog supplies precise evidence.
Implementations§
Source§impl PlaybackSource
impl PlaybackSource
Sourcepub fn from_catalog(catalog: &Catalog, file: &AudioFile) -> Self
pub fn from_catalog(catalog: &Catalog, file: &AudioFile) -> Self
Capture catalog evidence without reading or changing an audio file.
Sourcepub fn from_metadata(metadata: &Metadata) -> Result<Self, StoreError>
pub fn from_metadata(metadata: &Metadata) -> Result<Self, StoreError>
Capture precise evidence from an already opened source descriptor.
Unavailable or pre-epoch timestamps are refused rather than turned into an ambiguous zero identity. The caller must open/validate the source.
Sourcepub fn matches_catalog(&self, catalog: &Catalog, file: &AudioFile) -> bool
pub fn matches_catalog(&self, catalog: &Catalog, file: &AudioFile) -> bool
Whether the same current catalog row still carries matching evidence.
Sourcepub fn matches_metadata(&self, metadata: &Metadata) -> bool
pub fn matches_metadata(&self, metadata: &Metadata) -> bool
Recheck the already opened file before starting a resumed decode.
Trait Implementations§
Source§impl Clone for PlaybackSource
impl Clone for PlaybackSource
Source§fn clone(&self) -> PlaybackSource
fn clone(&self) -> PlaybackSource
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more