pub struct BindError { /* private fields */ }Expand description
A binding error that does not retain raw parameter values.
§Examples
use qubit_validator::{BindError, BindErrorKind};
let error = BindError::new(BindErrorKind::MissingParameter).with_parameter("minimum");
assert_eq!(error.parameter(), Some("minimum"));
assert!(!error.to_string().contains("secret value"));Implementations§
Source§impl BindError
impl BindError
Sourcepub fn new(kind: BindErrorKind) -> Self
pub fn new(kind: BindErrorKind) -> Self
Sourcepub const fn kind(&self) -> BindErrorKind
pub const fn kind(&self) -> BindErrorKind
Sourcepub const fn rule_id(&self) -> Option<ValidatorId>
pub const fn rule_id(&self) -> Option<ValidatorId>
Returns the resolved rule identifier attached to this error, if any.
A registry lookup that fails with MissingRule has no resolved
ValidatorId, so this returns None. The caller retains the
requested ID text when it needs to report which lookup failed.
§Returns
The resolved identifier for a selected rule, or None when no rule
was selected.
Sourcepub fn parameter(&self) -> Option<&str>
pub fn parameter(&self) -> Option<&str>
Returns the associated parameter name, if any.
The error never retains the corresponding raw parameter value.
§Returns
Returns Some when a parameter has been attached, or None otherwise.
Sourcepub fn dependency(&self) -> Option<&str>
pub fn dependency(&self) -> Option<&str>
Returns the associated dependency name, if any.
The error never retains the corresponding raw dependency value.
§Returns
Returns Some when a dependency has been attached, or None otherwise.
Sourcepub const fn with_rule(self, rule_id: ValidatorId) -> Self
pub const fn with_rule(self, rule_id: ValidatorId) -> Self
Sourcepub fn with_parameter(self, parameter: impl Into<String>) -> Self
pub fn with_parameter(self, parameter: impl Into<String>) -> Self
Trait Implementations§
Source§impl Error for BindError
impl Error for BindError
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()