pub struct RegistryError { /* private fields */ }Expand description
One structured registration failure, with the evidence that produced it. 一条结构化注册失败,以及产生它的证据。
The fields are private so the construction contract is the only way in:
RegistryError::new starts an error with its four essential facts, and
the with_*/*_mut methods attach the optional chains afterwards.
字段私有,构造契约是唯一的入口:RegistryError::new 用四项必要事实开启一条错误,
可选链条随后由 with_*/*_mut 方法挂上。
Implementations§
Source§impl RegistryError
impl RegistryError
Sourcepub fn new(
node: NodeId,
path: impl Into<String>,
source: impl Into<DiagnosticSource>,
message: impl Into<String>,
) -> RegistryError
pub fn new( node: NodeId, path: impl Into<String>, source: impl Into<DiagnosticSource>, message: impl Into<String>, ) -> RegistryError
Start an error from the four facts every failure carries. 用每条失败都携带的四项事实开启一条错误。
The optional chains (source_chain, call_path, registration_chain,
children) start empty and are attached by the builder methods.
可选链条(source_chain、call_path、registration_chain、children)起始为空,
由 builder 方法挂上。
Sourcepub fn node(&self) -> NodeId
pub fn node(&self) -> NodeId
The identity of the registration face this failure is about. 该失败所针对的注册面身份。
Sourcepub fn source(&self) -> &DiagnosticSource
pub fn source(&self) -> &DiagnosticSource
The declaration source this failure points back to. 该失败指回的声明源码位置。
Sourcepub fn children(&self) -> &[RegistryError]
pub fn children(&self) -> &[RegistryError]
The aggregated child failures, one per failed sub-check. 聚合的子失败,每个失败的子检查一条。
Sourcepub fn with_children(self, children: Vec<RegistryError>) -> RegistryError
pub fn with_children(self, children: Vec<RegistryError>) -> RegistryError
Attach the aggregated child failures. 挂上聚合的子失败。
Sourcepub fn children_mut(&mut self) -> &mut Vec<RegistryError>
pub fn children_mut(&mut self) -> &mut Vec<RegistryError>
Replace the aggregated child failures in place. 就地替换聚合的子失败。
Sourcepub fn message_mut(&mut self) -> &mut String
pub fn message_mut(&mut self) -> &mut String
Replace the failure message in place. 就地替换失败消息。
Sourcepub fn source_chain_mut(&mut self) -> &mut Vec<ProvenanceStep>
pub fn source_chain_mut(&mut self) -> &mut Vec<ProvenanceStep>
Replace the source chain in place. 就地替换来源链。
Sourcepub fn call_path_mut(&mut self) -> &mut Vec<CallSite>
pub fn call_path_mut(&mut self) -> &mut Vec<CallSite>
Replace the observed call path in place. 就地替换已观测调用路径。
Sourcepub fn registration_chain_mut(&mut self) -> &mut Vec<RegistrationState>
pub fn registration_chain_mut(&mut self) -> &mut Vec<RegistrationState>
Replace the registration chain in place. 就地替换注册链。
Trait Implementations§
Source§impl Clone for RegistryError
impl Clone for RegistryError
Source§fn clone(&self) -> RegistryError
fn clone(&self) -> RegistryError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RegistryError
impl Debug for RegistryError
Source§impl Display for RegistryError
impl Display for RegistryError
Source§impl Error for RegistryError
impl Error for RegistryError
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()