pub struct CommonConfig {
pub loudnorm_config: LoudnormConfig,
pub track_name_config: TrackNameConfig,
/* private fields */
}Fields§
§loudnorm_config: LoudnormConfig§track_name_config: TrackNameConfigImplementations§
Source§impl CommonConfig
impl CommonConfig
Sourcepub fn get_source_files(&self) -> Vec<PathBuf>
pub fn get_source_files(&self) -> Vec<PathBuf>
Returns all supported audio files from the configured source directories
Source§impl CommonConfig
impl CommonConfig
Sourcepub fn set_library_directory(
&mut self,
path: impl Into<PathBuf>,
) -> Result<&mut Self>
pub fn set_library_directory( &mut self, path: impl Into<PathBuf>, ) -> Result<&mut Self>
Sets your library directory to the input path after validation
The directory is invalid if:
- The library directory starts with a source
- Any source starts with the library directory
- The library directory is equal to any source
- The path is relative
§Errors
Errors when sources or the library fail to canonicalize via std::path::Path::canonicalize()
Paths that do not exist on the file system are not canonicalized
Sourcepub fn set_library_sources(&mut self, paths: &[PathBuf]) -> Result<&mut Self>
pub fn set_library_sources(&mut self, paths: &[PathBuf]) -> Result<&mut Self>
Sets your sources to the input sources after validation
Sources are invalid if:
- The library directory starts with the source
- The source starts with the library directory
- The library directory and source are equal
- The source is a relative path
§Errors
Errors when sources or the library fail to canonicalize via std::path::Path::canonicalize()
Paths that do not exist on the file system are not canonicalized
Source§impl CommonConfig
impl CommonConfig
Trait Implementations§
Source§impl Config for CommonConfig
impl Config for CommonConfig
Source§const CONFIG_FILE_NAME: &'static str = "common"
const CONFIG_FILE_NAME: &'static str = "common"
The name of the config file, excluding its extension
Source§fn load() -> Result<Self, ConfigError>
fn load() -> Result<Self, ConfigError>
Loads
Self from the system config directory using Self::CONFIG_FILE_NAME, creating a default config if one does not already existSource§impl Debug for CommonConfig
impl Debug for CommonConfig
Source§impl Default for CommonConfig
impl Default for CommonConfig
Source§fn default() -> CommonConfig
fn default() -> CommonConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for CommonConfig
impl<'de> Deserialize<'de> for CommonConfig
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CommonConfig
impl RefUnwindSafe for CommonConfig
impl Send for CommonConfig
impl Sync for CommonConfig
impl Unpin for CommonConfig
impl UnsafeUnpin for CommonConfig
impl UnwindSafe for CommonConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more