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
impl CutTarget
Sourcepub const fn id(self) -> Option<NodeId>
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 通过该访问器断言生成的
静态计划携带类型化切口;因此尽管工作区内没有库代码使用它,它也不是零调用者。