pub struct TorrentSavePathContext {
pub primary_tracker_host: Option<String>,
pub added_at_utc_secs: i64,
pub content_type: SimpleContentType,
}Expand description
Per-torrent context used to expand {tracker} / {yyyy} / {mm} /
{content_type} tokens.
Built GUI-side (or by any future caller) from the torrent’s tracker list, the add-time UTC timestamp, and the GUI’s coarse content-type classifier. Construction stays plain-data so unit tests can build fixtures without touching the session actor.
Fields§
§primary_tracker_host: Option<String>Lowercased hostname of the torrent’s primary tracker. None when
the torrent has no tracker yet (DHT-only or unresolved magnet) —
the {tracker} token then expands to the empty string unknown
to keep the resulting path well-formed. The fallback lives in
Self::primary_tracker_host.
added_at_utc_secs: i64UTC seconds-since-epoch when the torrent was added to the session.
Mirrors TorrentSummary::added_time / TorrentStats::added_time.
content_type: SimpleContentTypeGUI-side coarse content-type classification.
Implementations§
Source§impl TorrentSavePathContext
impl TorrentSavePathContext
Sourcepub fn new(added_at_utc_secs: i64) -> Self
pub fn new(added_at_utc_secs: i64) -> Self
Build a context with sensible defaults — useful for tests.
Sourcepub fn primary_tracker_host(&self) -> &str
pub fn primary_tracker_host(&self) -> &str
Resolve the {tracker} replacement.
Returns the lowercased hostname when set, or the literal string
unknown when no tracker has resolved yet. Never an empty
component — empty path segments would create // in the output.
Sourcepub fn classified_content_type(&self) -> &'static str
pub fn classified_content_type(&self) -> &'static str
Resolve the {content_type} replacement.
Trait Implementations§
Source§impl Clone for TorrentSavePathContext
impl Clone for TorrentSavePathContext
Source§fn clone(&self) -> TorrentSavePathContext
fn clone(&self) -> TorrentSavePathContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more