Enum rocket::config::ConfigError [−][src]
pub enum ConfigError { NotFound, IoError, Io(Error, &'static str), BadFilePath(PathBuf, &'static str), BadEnv(String), BadEntry(String, PathBuf), BadType(String, &'static str, &'static str, Option<PathBuf>), ParseError(String, PathBuf, String, Option<(usize, usize)>), BadEnvVal(String, String, String), UnknownKey(String), Missing(String), }
Expand description
The type of a configuration error.
Variants
The configuration file was not found.
There was an I/O error while reading the configuration file.
There was an I/O error while setting a configuration parameter.
Parameters: (io_error, config_param_name)
The path at which the configuration file was found was invalid.
Parameters: (path, reason)
BadEnv(String)
An environment specified in ROCKET_ENV
is invalid.
Parameters: (environment_name)
An environment specified as a table [environment]
is invalid.
Parameters: (environment_name, filename)
A config key was specified with a value of the wrong type.
Parameters: (entry_name, expected_type, actual_type, filename)
There was a TOML parsing error.
Parameters: (toml_source_string, filename, error_description, line/col)
There was a TOML parsing error in a config environment variable.
Parameters: (env_key, env_value, error)
UnknownKey(String)
The entry (key) is unknown.
Parameters: (key)
Missing(String)
The entry (key) was expected but was missing.
Parameters: (key)
Implementations
impl ConfigError
[src]
impl ConfigError
[src]pub fn pretty_print(&self)
[src]
pub fn pretty_print(&self)
[src]Prints this configuration error with Rocket formatting.
pub fn is_not_found(&self) -> bool
[src]
pub fn is_not_found(&self) -> bool
[src]Returns true
if self
is of NotFound
variant.
Example
use rocket::config::ConfigError; let error = ConfigError::NotFound; assert!(error.is_not_found());
Trait Implementations
impl Debug for ConfigError
[src]
impl Debug for ConfigError
[src]impl Display for ConfigError
[src]
impl Display for ConfigError
[src]impl Error for ConfigError
[src]
impl Error for ConfigError
[src]fn description(&self) -> &str
[src]
fn description(&self) -> &str
[src]use the Display impl or to_string()
fn source(&self) -> Option<&(dyn Error + 'static)>
1.30.0[src]
fn source(&self) -> Option<&(dyn Error + 'static)>
1.30.0[src]The lower-level source of this error, if any. Read more
impl PartialEq<ConfigError> for ConfigError
[src]
impl PartialEq<ConfigError> for ConfigError
[src]Auto Trait Implementations
impl !RefUnwindSafe for ConfigError
impl Send for ConfigError
impl Sync for ConfigError
impl Unpin for ConfigError
impl !UnwindSafe for ConfigError
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> IntoCollection<T> for T
impl<T> IntoCollection<T> for T
pub fn into_collection<A>(self) -> SmallVec<A> where
A: Array<Item = T>,
pub fn into_collection<A>(self) -> SmallVec<A> where
A: Array<Item = T>,
Converts self
into a collection.
pub fn mapped<U, F, A>(self, f: F) -> SmallVec<A> where
F: FnMut(T) -> U,
A: Array<Item = U>,
F: FnMut(T) -> U,
A: Array<Item = U>,
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,