pub struct RegistrationSnapshot {Show 28 fields
pub namespace: String,
pub id: NodeId,
pub parent: NodeId,
pub kind: String,
pub preset: String,
pub parts: String,
pub params: String,
pub handle: String,
pub stable_name: Option<String>,
pub name: OwnedLocalizedText,
pub summary: OwnedLocalizedText,
pub exports: Vec<String>,
pub needs_registry: bool,
pub registry_name: String,
pub getting_from_other_registry: Option<String>,
pub registry_rule_path: String,
pub registry_rule: OwnedRegistrationRule,
pub admission: OwnedAdmission,
pub requires: Vec<OwnedRequirementSpec>,
pub provides: Vec<String>,
pub contract: OwnedObjectContract,
pub flow: OwnedFlowContract,
pub flow_provider: Option<String>,
pub handle_traits: Vec<String>,
pub part_traits: Vec<String>,
pub runtime_checks: Vec<RuntimeCheckSpec>,
pub plugin: Option<PluginManifest>,
pub source: OwnedSourceLocation,
}Expand description
Owned registration metadata used by file-backed authoring and reloads. 文件创作与热刷新使用的拥有所有权注册元数据。
Compile-time declarations keep RegistrationInfo as a small static value.
Runtime-authored values must not borrow from a process-global intern pool,
so this type owns every reloadable field and can be dropped with the
snapshot that produced it.
编译期声明继续使用小型静态 RegistrationInfo;运行时创作值不能借用进程级
intern 池,因此这里拥有所有可重载字段,并随快照一起释放。
Fields§
§namespace: StringPackage namespace that owns this declaration. 拥有本声明的包命名空间。
id: NodeIdStable node id assigned to this declaration. 分配给本声明的稳定节点 id。
parent: NodeIdNode id of the registry owner this declaration is mounted under. 本声明挂载到的注册机拥有者的节点 id。
kind: StringFace kind name the declaration was authored with. 声明书写时使用的注册面种类名。
preset: StringPreset name selected for construction. 构造时所选的 preset 名称。
parts: StringParts type name supplying the construction shape. 提供构造形状的 parts 类型名。
params: StringParams type name carrying this face’s parameters. 承载该注册面参数的 params 类型名。
handle: StringHandle type name owning this face’s runtime state. 拥有该注册面运行期状态的 handle 类型名。
stable_name: Option<String>Optional author-owned identity that survives source moves. 可选的作者逻辑身份,可跨源码文件移动保持不变。
name: OwnedLocalizedTextBilingual display name of the face. 注册面的双语显示名称。
summary: OwnedLocalizedTextBilingual one-line summary of the face. 注册面的双语单行摘要。
exports: Vec<String>Export names this face publishes. 本注册面公开的导出名称。
needs_registry: boolWhether this face owns a registry others may register into. 本注册面是否拥有一个可供他人注册的注册机。
registry_name: StringRegistry slot name this face is registered under, defaulting to the kind. 本注册面所注册到的注册机槽位名,默认为 kind。
getting_from_other_registry: Option<String>Name of the external registry this face takes its dependency from. 本注册面从哪个外部注册机取得依赖的名称。
registry_rule_path: StringSource path of the declaration that supplied the registry rule. 提供注册规范的声明所在源码路径。
registry_rule: OwnedRegistrationRuleRule for faces entering the registry owned by this face. 进入本注册面所拥有的注册机时必须满足的规范。
admission: OwnedAdmissionExternal dependency gate for this face’s registry. 本注册面所属注册机对外部依赖的门禁。
requires: Vec<OwnedRequirementSpec>Capabilities this face requires from its dependencies. 本注册面要求其依赖提供的能力。
provides: Vec<String>Names of the capabilities this face provides. 本注册面所提供能力的名称。
contract: OwnedObjectContractConstruction contract between preset and parts. preset 与 parts 之间的构造合同。
flow: OwnedFlowContractAutomatically comparable input/output contract for grafting. 供嫁接自动比较的输入/输出合同。
flow_provider: Option<String>Type that supplied the compile-time flow contract, when explicit. 显式提供编译期数据流合同的类型路径(如果有)。
handle_traits: Vec<String>Interface names declared by the handle type. handle 类型声明实现的接口名称。
part_traits: Vec<String>Interface names declared by the parts type. parts 类型声明实现的接口名称。
runtime_checks: Vec<RuntimeCheckSpec>Runtime checks the host must run on values from this face. 宿主必须对本注册面产出的取值执行的运行期校验。
plugin: Option<PluginManifest>Optional provenance for a face supplied by an external plugin crate. 外部插件 crate 提供注册面时,可附带插件来源元数据。
source: OwnedSourceLocationDeclaration site captured for diagnostics. 为诊断捕获的声明位置。
Implementations§
Source§impl RegistrationSnapshot
impl RegistrationSnapshot
Sourcepub fn stable_face_id(&self) -> StableFaceId
pub fn stable_face_id(&self) -> StableFaceId
Return the same logical identity used by compiled declarations. 返回与编译期声明一致的逻辑稳定身份。
Sourcepub fn explicit_stable_face_id(&self) -> Option<StableFaceId>
pub fn explicit_stable_face_id(&self) -> Option<StableFaceId>
Return the explicit stable identity, if this snapshot declared one. 返回快照显式声明的稳定身份。
Apply file-authored fields while retaining executable compiled metadata. 应用文件中可编辑的字段,同时保留编译产物中的可执行元数据。
Trait Implementations§
Source§impl Clone for RegistrationSnapshot
impl Clone for RegistrationSnapshot
Source§fn clone(&self) -> RegistrationSnapshot
fn clone(&self) -> RegistrationSnapshot
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more