pub struct DiscoveryError {
pub code: ErrorCode,
pub reason: &'static str,
pub config_path: Option<String>,
}Expand description
携带稳定原因与配置路径的发现错误;秘密材料由 adapter 内部管理。
Fields§
§code: ErrorCode可供调用方分支处理的稳定失败类别。
reason: &'static str可公开展示的固定原因,不携带配置原文。
config_path: Option<String>只包含配置字段与已校验的条目名称,不包含配置值或认证材料。
Implementations§
Source§impl DiscoveryError
impl DiscoveryError
Sourcepub const fn new(code: ErrorCode, reason: &'static str) -> DiscoveryError
pub const fn new(code: ErrorCode, reason: &'static str) -> DiscoveryError
业务作用:构造可安全展示的后端裁决。
参数说明:
code:是稳定类别reason:是不包含凭据的静态原因。
返回:不保留任意 SDK 响应正文的错误。
Sourcepub fn at_config_path(self, prefix: impl AsRef<str>) -> DiscoveryError
pub fn at_config_path(self, prefix: impl AsRef<str>) -> DiscoveryError
业务作用:为配置拒绝补充可定位的字段路径,同时保留稳定原因与错误类别。
参数说明:
prefix:只能包含配置字段或已经校验的条目名称,不得传入配置值。
返回:路径按外层到内层拼接的错误,不保留后端响应正文。
Sourcepub fn revokes_evidence(&self) -> bool
pub fn revokes_evidence(&self) -> bool
业务作用:判断失败是否明确撤销既有发现证据。
参数说明:无。
返回:鉴权撤销、身份冲突、已确认非法候选和生命周期终止不允许使用历史路由;单纯同步不完整不构成立即撤权事实。
Trait Implementations§
Source§impl Clone for DiscoveryError
impl Clone for DiscoveryError
Source§fn clone(&self) -> DiscoveryError
fn clone(&self) -> DiscoveryError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DiscoveryError
impl Debug for DiscoveryError
Source§impl Display for DiscoveryError
impl Display for DiscoveryError
impl Eq for DiscoveryError
Source§impl Error for DiscoveryError
impl Error for DiscoveryError
1.30.0 · 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()
Source§impl PartialEq for DiscoveryError
impl PartialEq for DiscoveryError
impl StructuralPartialEq for DiscoveryError
Auto Trait Implementations§
impl Forget for DiscoveryError
impl Freeze for DiscoveryError
impl Move for DiscoveryError
impl RefUnwindSafe for DiscoveryError
impl Send for DiscoveryError
impl Sync for DiscoveryError
impl Unpin for DiscoveryError
impl UnsafeUnpin for DiscoveryError
impl UnwindSafe for DiscoveryError
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