pub struct HttpConfigError {
pub path: String,
pub message: String,
pub kind: HttpConfigErrorKind,
}Expand description
Error type for HTTP configuration conversion failures.
Carries the failing configuration path and a human-readable message so that callers can report exactly which key caused the problem.
Fields§
§path: StringThe configuration path that triggered the error, e.g. http.proxy.port.
message: StringHuman-readable description of the problem.
kind: HttpConfigErrorKindError category.
Implementations§
Source§impl HttpConfigError
impl HttpConfigError
Sourcepub fn new(
kind: HttpConfigErrorKind,
path: impl Into<String>,
message: impl Into<String>,
) -> Self
pub fn new( kind: HttpConfigErrorKind, path: impl Into<String>, message: impl Into<String>, ) -> Self
Builds a configuration error with the given classification and message.
§Parameters
kind: Error category.path: Configuration key path (e.g.http.proxy.port).message: Human-readable explanation.
§Returns
New HttpConfigError.
Sourcepub fn missing(path: impl Into<String>, message: impl Into<String>) -> Self
pub fn missing(path: impl Into<String>, message: impl Into<String>) -> Self
Shorthand for HttpConfigErrorKind::MissingField.
§Parameters
path: Configuration path of the missing field.message: Explanation of what is missing.
§Returns
New HttpConfigError.
Sourcepub fn type_error(path: impl Into<String>, message: impl Into<String>) -> Self
pub fn type_error(path: impl Into<String>, message: impl Into<String>) -> Self
Shorthand for HttpConfigErrorKind::TypeError.
§Parameters
path: Configuration path where the type mismatch occurred.message: Details of the expected vs actual type.
§Returns
New HttpConfigError.
Sourcepub fn invalid_value(
path: impl Into<String>,
message: impl Into<String>,
) -> Self
pub fn invalid_value( path: impl Into<String>, message: impl Into<String>, ) -> Self
Shorthand for HttpConfigErrorKind::InvalidValue.
§Parameters
path: Configuration path of the invalid value.message: Why the value is not acceptable.
§Returns
New HttpConfigError.
Sourcepub fn invalid_header(
path: impl Into<String>,
message: impl Into<String>,
) -> Self
pub fn invalid_header( path: impl Into<String>, message: impl Into<String>, ) -> Self
Shorthand for HttpConfigErrorKind::InvalidHeader.
§Parameters
path: Configuration path related to the header map entry.message: Header name/value problem description.
§Returns
New HttpConfigError.
Sourcepub fn config_error(path: impl Into<String>, message: impl Into<String>) -> Self
pub fn config_error(path: impl Into<String>, message: impl Into<String>) -> Self
Shorthand for HttpConfigErrorKind::ConfigError (underlying qubit-config failure).
§Parameters
path: Configuration path if known; may be empty when not applicable.message: Error text from the config layer.
§Returns
New HttpConfigError.
Trait Implementations§
Source§impl Clone for HttpConfigError
impl Clone for HttpConfigError
Source§fn clone(&self) -> HttpConfigError
fn clone(&self) -> HttpConfigError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HttpConfigError
impl Debug for HttpConfigError
Source§impl Display for HttpConfigError
impl Display for HttpConfigError
Source§impl Error for HttpConfigError
impl Error for HttpConfigError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<ConfigError> for HttpConfigError
impl From<ConfigError> for HttpConfigError
Source§fn from(e: ConfigError) -> Self
fn from(e: ConfigError) -> Self
Converts a qubit_config::ConfigError, mapping typed failures to
HttpConfigErrorKind::TypeError when the source carries a property key.
§Parameters
e: Source configuration error.
§Returns
Equivalent HttpConfigError.
Source§impl PartialEq for HttpConfigError
impl PartialEq for HttpConfigError
impl Eq for HttpConfigError
impl StructuralPartialEq for HttpConfigError
Auto Trait Implementations§
impl Freeze for HttpConfigError
impl RefUnwindSafe for HttpConfigError
impl Send for HttpConfigError
impl Sync for HttpConfigError
impl Unpin for HttpConfigError
impl UnsafeUnpin for HttpConfigError
impl UnwindSafe for HttpConfigError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.