pub enum ContentLayout {
Original,
Subfolder,
NoSubfolder,
}Expand description
How a torrent’s file tree is materialized under the download directory (M252/ER5; mirrors qBittorrent’s “Content layout”).
Transforms operate on InfoDict::files() output, whose canonical shape
is [name] for single-file torrents and [name, …components] for
multi-file torrents (root always first).
Variants§
Original
Keep the torrent’s own structure exactly as the metainfo describes it.
Subfolder
Always create a subfolder named after the torrent — wraps single-file
torrents in name/; multi-file torrents already have one (no-op).
NoSubfolder
Never create a subfolder — strips the root component from multi-file torrents; single-file torrents are already flat (no-op).
Implementations§
Source§impl ContentLayout
impl ContentLayout
Sourcepub fn apply_to_files(self, files: Vec<FileInfo>) -> Vec<FileInfo>
pub fn apply_to_files(self, files: Vec<FileInfo>) -> Vec<FileInfo>
Apply this layout to canonical InfoDict::files() output.
Never produces an empty path: stripping requires len >= 2,
wrapping only ever prepends.
Trait Implementations§
Source§impl Clone for ContentLayout
impl Clone for ContentLayout
Source§fn clone(&self) -> ContentLayout
fn clone(&self) -> ContentLayout
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ContentLayout
Source§impl Debug for ContentLayout
impl Debug for ContentLayout
Source§impl Default for ContentLayout
impl Default for ContentLayout
Source§fn default() -> ContentLayout
fn default() -> ContentLayout
Source§impl<'de> Deserialize<'de> for ContentLayout
impl<'de> Deserialize<'de> for ContentLayout
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 ContentLayout
Source§impl PartialEq for ContentLayout
impl PartialEq for ContentLayout
Source§fn eq(&self, other: &ContentLayout) -> bool
fn eq(&self, other: &ContentLayout) -> bool
self and other values to be equal, and is used by ==.