pub struct RegistrationInfo {Show 28 fields
pub namespace: &'static str,
pub id: NodeId,
pub parent: NodeId,
pub kind: &'static str,
pub preset: &'static str,
pub parts: &'static str,
pub params: &'static str,
pub handle: &'static str,
pub stable_name: Option<&'static str>,
pub name: LocalizedText,
pub summary: LocalizedText,
pub exports: &'static [&'static str],
pub needs_registry: bool,
pub registry_name: &'static str,
pub getting_from_other_registry: Option<&'static str>,
pub registry_rule_path: &'static str,
pub registry_rule: RegistrationRule,
pub admission: Admission,
pub requires: &'static [RequirementSpec],
pub provides: &'static [&'static str],
pub contract: ObjectContract,
pub flow: FlowContract,
pub flow_provider: Option<&'static str>,
pub handle_traits: &'static [&'static str],
pub part_traits: &'static [&'static str],
pub runtime_checks: &'static [RuntimeCheckSpec],
pub plugin: Option<PluginManifest>,
pub source: SourceLocation,
}Expand description
Declarative information for an ordinary object or a registry owner. 普通 object 或注册机拥有者的声明式注册信息。
Fields§
§namespace: &'static strPackage namespace that owns this declaration. 拥有本声明的包命名空间。
id: NodeIdStable node identity assigned to this face. 分配给本注册面的稳定节点身份。
parent: NodeIdNode identity of the face this one is registered under. 本注册面所挂载到的父节点身份。
kind: &'static strFace kind name, for example Button.
注册面种类名,例如 Button。
preset: &'static strPreset type path that constructs this face. 构造本注册面的 preset 类型路径。
parts: &'static strParts type path that supplies this face’s construction parts. 提供本注册面构造 parts 的 parts 类型路径。
params: &'static strParameter type path this face declares for its construction input. 本注册面为其构造输入声明的参数类型路径。
handle: &'static strHandle type path that exposes this face to its owner. 向其拥有者暴露本注册面的 handle 类型路径。
stable_name: Option<&'static str>Optional author-owned identity that survives source moves. 可选的作者逻辑身份,可跨源码文件移动保持不变。
name: LocalizedTextLocalized display name shown to authors. 向作者显示的本地化名称。
summary: LocalizedTextLocalized one-line description shown alongside the name. 与名称一同显示的本地化单行描述。
exports: &'static [&'static str]Export names this face declares. 本注册面声明的导出名称。
needs_registry: boolWhether this face owns a child Registry. 本注册面是否拥有一个子注册机。
registry_name: &'static strName of that child Registry, used to build its path; ignored otherwise. 子注册机的名称,用于生成其路径;不需要子注册机时忽略。
getting_from_other_registry: Option<&'static str>Name of an external registry this face is provisioned from, if any. 本注册面从其获取内容的外部注册机名(如果有)。
registry_rule_path: &'static strSource path that produced the registry rule, kept for diagnostics. 产出注册规范的源码路径,用于诊断。
registry_rule: RegistrationRuleRule for faces entering the Registry owned by this face. 该注册面拥有的 Registry 所使用的注册规范。
admission: AdmissionExternal dependency gate for this face’s registry. 该注册面所属注册机对外部依赖的门禁。
requires: &'static [RequirementSpec]Capability requirements this face declares. 本注册面声明的能力需求。
provides: &'static [&'static str]Capability names this face makes available to other faces. 本注册面向其他注册面提供的能力名称。
contract: ObjectContractConstruction contract comparing required and supplied parts. 比较所需 parts 与实际提供 parts 的构造合同。
flow: FlowContractAutomatically comparable input/output contract for grafting. 供嫁接自动比较的输入/输出合同。
flow_provider: Option<&'static str>Type that supplied the compile-time flow contract, when explicit. 显式提供编译期数据流合同的类型路径(如果有)。
handle_traits: &'static [&'static str]Interface names declared by the handle type on this registration face. 此注册面的 handle 类型声明实现的接口名称。
part_traits: &'static [&'static str]Interface names declared by the parts type on this registration face. 此注册面的 parts 类型声明实现的接口名称。
runtime_checks: &'static [RuntimeCheckSpec]Runtime value checks the host applies to this face; empty accepts any value. 宿主对本注册面取值执行的运行期校验;为空时接受任何取值。
plugin: Option<PluginManifest>Optional provenance for a face supplied by an external plugin crate. 外部插件 crate 提供注册面时,可附带插件来源元数据。
source: SourceLocationDeclaration site this metadata was captured from. 捕获这份元数据时所在的声明位置。
Implementations§
Source§impl RegistrationInfo
impl RegistrationInfo
Sourcepub const fn stable_face_id(self) -> StableFaceId
pub const fn stable_face_id(self) -> StableFaceId
Return the opt-in logical identity for this face. 返回该注册面的可选逻辑稳定身份。
Sourcepub const fn explicit_stable_face_id(self) -> Option<StableFaceId>
pub const fn explicit_stable_face_id(self) -> Option<StableFaceId>
Return the stable identity only when the declaration opted into one. 只有声明显式选择稳定名称时才返回稳定身份。
The fallback used by stable_face_id is useful for diagnostics, but it
is not a uniqueness promise: several independent faces may all be
named Button. Only an explicit name can be checked globally.
stable_face_id 的回退值适合诊断,但不代表全局唯一;多个独立注册面
可以同名为 Button。只有显式名称才需要做全局冲突检查。
Sourcepub fn into_snapshot(self) -> RegistrationSnapshot
pub fn into_snapshot(self) -> RegistrationSnapshot
Copy a compiled declaration into an independently owned snapshot. 将编译期声明复制为独立拥有所有权的快照。
Trait Implementations§
Source§impl Clone for RegistrationInfo
impl Clone for RegistrationInfo
Source§fn clone(&self) -> RegistrationInfo
fn clone(&self) -> RegistrationInfo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more