Skip to main content

CutTarget

Enum CutTarget 

Source
pub enum CutTarget {
    Path(&'static str),
    Id(NodeId),
}
Expand description

How a release-time graft selector addresses a face. 发布态 graft 选择器如何寻址一个注册面。

Path is the human-written single-node selector (root/control/button) parsed from the host entry; a range keeps its far endpoint in StaticGraftCut’s separate cut_end field, so a path never encodes a range. Id is a compile-time node identity, so a host can write the target as a Rust path (crate::control::object::button::NODE_ID) and let the compiler and editor resolve it instead of spelling a string. Path 是从宿主入口解析出的手写单节点选择器(root/control/button);区间的 远端端点保存在 StaticGraftCut 独立的 cut_end 字段里,因此路径永远不编码 区间。Id 是编译期节点身份,宿主因此可以把目标写成 Rust 路径 (crate::control::object::button::NODE_ID),由编译器和编辑器解析,而不必 手写字符串。

Variants§

§

Path(&'static str)

A human-written single-node path selector from the host entry. 来自宿主入口的手写单节点路径选择器。

§

Id(NodeId)

A compile-time node identity, so tools can resolve the target as a path. 编译期节点身份,工具因此可把目标解析为 Rust 路径。

Implementations§

Source§

impl CutTarget

Source

pub const fn id(self) -> Option<NodeId>

The compile-time identity this selector addresses, when it is an Id. 该选择器寻址的编译期身份——当它是 Id 时。

Kept by B3a: examples/control-button/tests/registry.rs asserts the generated static plan carries typed cuts through this accessor, so it is not zero-caller even though no in-workspace library code uses it. B3a 保留:examples/control-button/tests/registry.rs 通过该访问器断言生成的 静态计划携带类型化切口;因此尽管工作区内没有库代码使用它,它也不是零调用者。

Source

pub fn describe(self) -> String

Render the selector for diagnostics; an identity prints as its hex form. 渲染选择器用于诊断;身份打印为十六进制形式。

Trait Implementations§

Source§

impl Clone for CutTarget

Source§

fn clone(&self) -> CutTarget

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 Copy for CutTarget

Source§

impl Debug for CutTarget

Source§

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

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

impl Eq for CutTarget

Source§

impl PartialEq for CutTarget

Source§

fn eq(&self, other: &CutTarget) -> 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 CutTarget

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, 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.