pub struct StaticPlan { /* private fields */ }Expand description
A zero-allocation view of the built-in registration tree. 内置注册树的零分配视图。
Implementations§
Source§impl StaticPlan
impl StaticPlan
Sourcepub const fn with_grafts(
faces: &'static [StaticFace],
grafts: &'static [StaticGraftCut],
) -> StaticPlan
pub const fn with_grafts( faces: &'static [StaticFace], grafts: &'static [StaticGraftCut], ) -> StaticPlan
Build a release plan whose graft selectors are stored in read-only data. 构造把 graft selector 直接保存在只读数据中的发布计划。
Sourcepub const fn faces(self) -> &'static [StaticFace]
pub const fn faces(self) -> &'static [StaticFace]
The built-in faces in registry-tree order, so a parent precedes its children. 按注册树顺序排列的内置注册面,父级先于子级。
Sourcepub const fn grafts(self) -> &'static [StaticGraftCut]
pub const fn grafts(self) -> &'static [StaticGraftCut]
Host-declared grafts captured by the build step without allocation. 构建阶段捕获、无需分配即可读取的宿主 graft 声明。
Sourcepub fn find(self, id: NodeId) -> Option<&'static StaticFace>
pub fn find(self, id: NodeId) -> Option<&'static StaticFace>
Find a face by identity. 按身份查找注册面。
The generated table is emitted in registry-tree traversal order, because
registrations() and everything that registers from it rely on parents
coming first. It is therefore not sorted by identity, and a binary
search over it silently missed faces — two of the three faces in the
example plan. The scan is linear, and the table stays in the order its
other consumers need.
生成的表按注册树遍历顺序发射,因为 registrations() 以及所有据此注册的代码都
依赖父级先出现。它因此不是按身份排序的,对它做二分会让注册面被静默漏掉——
示例计划里三个面漏了两个。这里改为线性扫描,表则保持其他消费方需要的顺序。
Sourcepub fn children_of(
self,
parent: NodeId,
) -> impl Iterator<Item = &'static StaticFace>
pub fn children_of( self, parent: NodeId, ) -> impl Iterator<Item = &'static StaticFace>
The faces whose parent is parent, in table order.
父级为 parent 的注册面,按表顺序。
The table is emitted in traversal order, not identity order, so this is a linear filter rather than a range lookup. 该表按遍历顺序而非身份顺序发射,因此这里用线性过滤而不是区间查找。
Trait Implementations§
Source§impl Clone for StaticPlan
impl Clone for StaticPlan
Source§fn clone(&self) -> StaticPlan
fn clone(&self) -> StaticPlan
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more