pub enum GraftError {
InvalidCommand(String),
UnknownTarget(NodeId),
UnknownReplacement(NodeId),
AmbiguousReplacement {
selector: String,
matches: usize,
},
ContractUndeclared,
ContractMismatch {
expected: OwnedFlowContract,
received: OwnedFlowContract,
},
FrameworkMismatch(FrameworkId),
DuplicateCut(String),
InvalidRange(String),
}Expand description
Reasons a graft was rejected before the live tree was touched. 嫁接在修改线上树之前被拒绝的原因。
Variants§
InvalidCommand(String)
Command text did not parse; the payload is the parser’s reason. 命令文本未能解析;载荷是解析器给出的原因。
UnknownTarget(NodeId)
The cut path names no registered face. 切口路径没有指向任何已注册的面。
UnknownReplacement(NodeId)
The replacement identity is not registered. 替换件身份没有注册。
AmbiguousReplacement
A string selector matched more than one registered face. 字符串选择器匹配到不止一个已注册的面。
Fields
ContractUndeclared
A graft requires both sides to declare a flow contract. 嫁接要求两侧都声明数据流合同。
ContractMismatch
The two sides declare data-flow contracts that are not compatible. 两侧声明的数据流合同互不兼容。
Fields
expected: OwnedFlowContractContract declared by the cut target. 切口目标声明的合同。
received: OwnedFlowContractContract declared by the replacement. 替换件声明的合同。
FrameworkMismatch(FrameworkId)
The plugin does not target the plan’s framework. 插件针对的框架不是本计划的框架。
DuplicateCut(String)
The same cut path appears more than once in one plan. 同一个切口路径在同一计划中出现多次。
InvalidRange(String)
The two endpoints of a range are unusable together: they do not share a parent, or the range is written backwards. 区间的两个端点无法配合使用:不同属一个父级,或区间被写反了。
The payload is a complete reason sentence and Display prints it
verbatim. Two different range problems need two different remedies
(“share one parent” versus “write it the other way round”), so the
sentence has to come from the site that knows which one applies; a fixed
template around a bare selector left no room for the second.
载荷是一句完整的原因,Display 原样打印。两种区间问题需要两种不同的补救
(“同属一个父级”与“反过来写”),因此这句话必须由知道该用哪一种的调用点给出;
用一个固定模板套一个裸选择器,第二种情况就无处表达。
Trait Implementations§
Source§impl Clone for GraftError
impl Clone for GraftError
Source§fn clone(&self) -> GraftError
fn clone(&self) -> GraftError
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 GraftError
impl Debug for GraftError
Source§impl Display for GraftError
impl Display for GraftError
impl Eq for GraftError
Source§impl Error for GraftError
impl Error for GraftError
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()