pub enum RouterConfigError {
NoConfigDir,
Read {
path: PathBuf,
source: Error,
},
Parse {
path: PathBuf,
source: Error,
},
BadSourceName {
name: String,
reason: String,
},
DuplicateSource {
name: String,
},
UndefinedDefaultSource {
name: String,
},
UndefinedFallbackSource {
name: String,
},
UndefinedRouteSource {
prefix: String,
name: String,
},
UndefinedSecretSource {
path: String,
name: String,
},
BadRoutePrefix {
prefix: String,
},
DuplicateRoutePrefix {
prefix: String,
},
BadSecretPath {
path: String,
source: PathError,
},
}Expand description
Failure modes when loading or validating a RouterConfig.
Variants§
NoConfigDir
dirs::config_dir() returned None — extremely unusual on
supported platforms but worth a typed variant rather than a
panic.
Read
I/O error reading the config file.
Parse
TOML deserialization error.
BadSourceName
Source name failed the identifier regex (kebab-case allowed).
DuplicateSource
Two [[source]] blocks share a name.
UndefinedDefaultSource
[default].source references an undefined source.
UndefinedFallbackSource
[default].fallback references an undefined source.
UndefinedRouteSource
[[route]].source references an undefined source.
UndefinedSecretSource
[secret."<path>"].source references an undefined source.
BadRoutePrefix
[[route]].prefix does not end with /.
DuplicateRoutePrefix
Two [[route]] blocks share a prefix.
BadSecretPath
[secret."<path>"] key is not a valid ADR-020 path.
Trait Implementations§
Source§impl Debug for RouterConfigError
impl Debug for RouterConfigError
Source§impl Display for RouterConfigError
impl Display for RouterConfigError
Source§impl Error for RouterConfigError
impl Error for RouterConfigError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for RouterConfigError
impl !UnwindSafe for RouterConfigError
impl Freeze for RouterConfigError
impl Send for RouterConfigError
impl Sync for RouterConfigError
impl Unpin for RouterConfigError
impl UnsafeUnpin for RouterConfigError
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