Skip to main content

GraftError

Enum GraftError 

Source
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

§selector: String

Selector that matched more than one face. 匹配到不止一个面的选择器。

§matches: usize

How many registered faces it matched. 它匹配到的已注册面数量。

§

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: OwnedFlowContract

Contract declared by the cut target. 切口目标声明的合同。

§received: OwnedFlowContract

Contract 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

Source§

fn clone(&self) -> GraftError

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GraftError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Display for GraftError

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Eq for GraftError

Source§

impl Error for GraftError

1.30.0 · Source§

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

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl PartialEq for GraftError

Source§

fn eq(&self, other: &GraftError) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for GraftError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.