97018031c1
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
21 lines
353 B
Rust
21 lines
353 B
Rust
use crate::common::*;
|
|
|
|
#[derive(Clone, Copy, Debug, PartialEq, IntoStaticStr, EnumString)]
|
|
#[strum(serialize_all = "kebab-case")]
|
|
pub(crate) enum SortOrder {
|
|
Ascending,
|
|
Descending,
|
|
}
|
|
|
|
impl SortOrder {
|
|
pub(crate) fn name(self) -> &'static str {
|
|
self.into()
|
|
}
|
|
}
|
|
|
|
impl Default for SortOrder {
|
|
fn default() -> Self {
|
|
Self::Ascending
|
|
}
|
|
}
|