Skip to main content

ConfError

Enum ConfError 

Source
pub enum ConfError {
Show 18 variants Io { path: PathBuf, source: Error, }, EmptyDocument, TooManyPools(usize), EmptyPoolName, UnknownKey { name: String, }, MissingRequired(&'static str), BadAddr { field: &'static str, value: String, reason: String, }, BadToken { value: String, reason: String, }, BadConsistency { field: &'static str, value: String, }, BadSecure(String), BadDataStore(i64), BadNoxuConfig(&'static str), BadHash(String), BadDistribution(String), OutOfRange { field: &'static str, value: i64, reason: &'static str, }, BadServer { field: &'static str, value: String, reason: String, }, BadHashTag(String), Yaml { message: String, },
}
Expand description

Errors that can occur while loading or validating a Config.

§Examples

use dynomite::conf::{Config, ConfError};
let err = Config::parse_str("").unwrap_err();
assert!(matches!(err, ConfError::Yaml { .. } | ConfError::EmptyDocument));

Variants§

§

Io

I/O error while reading a configuration file.

Fields

§path: PathBuf

The path that triggered the failure.

§source: Error

The underlying I/O error.

§

EmptyDocument

The YAML document was empty or missing the top-level pool.

§

TooManyPools(usize)

The top-level mapping had more than one pool.

§

EmptyPoolName

The top-level pool name was the empty string.

§

UnknownKey

A directive name in the YAML is not recognized.

Fields

§name: String

The unrecognized YAML key.

§

MissingRequired(&'static str)

A required directive is absent from the configuration.

§

BadAddr

listen / dyn_listen / stats_listen address could not be parsed.

Fields

§field: &'static str

The directive whose value failed to parse.

§value: String

The string that failed to parse.

§reason: String

Human-readable parse failure reason.

§

BadToken

A token list could not be parsed as comma-separated big-ints.

Fields

§value: String

The token-list string.

§reason: String

Human-readable parse failure reason.

§

BadConsistency

read_consistency / write_consistency value is not a known level.

Fields

§field: &'static str

The directive: read_consistency or write_consistency.

§value: String

The unrecognized value.

§

BadSecure(String)

secure_server_option value is not a known mode.

§

BadDataStore(i64)

data_store value is not 0 (Redis), 1 (Memcache), or 2 (Noxu). The string forms redis, memcache, and noxu are also accepted on the YAML side and are translated to these integers before validation.

§

BadNoxuConfig(&'static str)

data_store: noxu was selected but noxu_path was not supplied or dynomited was built without --features riak.

§

BadHash(String)

hash value is not a recognized hash algorithm name.

§

BadDistribution(String)

distribution value is not a recognized distribution algorithm name.

§

OutOfRange

A numeric directive is out of its allowed range.

Fields

§field: &'static str

The directive name.

§value: i64

The offending value.

§reason: &'static str

What range was expected.

§

BadServer

A server / dyn_seeds entry is malformed.

Fields

§field: &'static str

The directive (servers or dyn_seeds).

§value: String

The malformed entry.

§reason: String

Human-readable failure reason.

§

BadHashTag(String)

hash_tag must be exactly two characters, per the C parser.

§

Yaml

The YAML failed to parse at the document level.

Fields

§message: String

The YAML error message (with location, if available).

Trait Implementations§

Source§

impl Debug for ConfError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for ConfError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for ConfError

Source§

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

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<ConfError> for EmbedError

Source§

fn from(source: ConfError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,