intermodal/src/sort_key.rs
Casey Rodarmor 97018031c1
Introduce "sort specs" to allow fine-grained sorting of files in torrents
Sort specs are of the form `KEY:ORDER`, and allow sorting files in a
torrent by multiple criteria. Multiple sort specs can be passed with
`--sort-by` upon torrent creation.

type: added
2020-04-07 19:01:33 -07:00

15 lines
257 B
Rust

use crate::common::*;
#[derive(Clone, Copy, Debug, PartialEq, IntoStaticStr, EnumString)]
#[strum(serialize_all = "kebab-case")]
pub(crate) enum SortKey {
Path,
Size,
}
impl SortKey {
pub(crate) fn name(self) -> &'static str {
self.into()
}
}