selene-core 0.3.1

selene-core is the backend for Selene, a local-first music player
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::str::FromStr;

use crate::container::ContainerFormat;

impl FromStr for ContainerFormat {
    type Err = String;

    fn from_str(s: &str) -> Result<Self, Self::Err> {
        match s {
            "flac" => Ok(Self::Flac),
            "mp3" => Ok(Self::Mp3),
            "ogg" | "opus" => Ok(Self::Ogg),
            "wav" => Ok(Self::Wav),
            _ => Err(format!("Invalid or unknown/unrecognized container: {s}"))?,
        }
    }
}