Skip to main content

RegistrationInfo

Struct RegistrationInfo 

Source
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 str

Package namespace that owns this declaration. 拥有本声明的包命名空间。

§id: NodeId

Stable node identity assigned to this face. 分配给本注册面的稳定节点身份。

§parent: NodeId

Node identity of the face this one is registered under. 本注册面所挂载到的父节点身份。

§kind: &'static str

Face kind name, for example Button. 注册面种类名,例如 Button。

§preset: &'static str

Preset type path that constructs this face. 构造本注册面的 preset 类型路径。

§parts: &'static str

Parts type path that supplies this face’s construction parts. 提供本注册面构造 parts 的 parts 类型路径。

§params: &'static str

Parameter type path this face declares for its construction input. 本注册面为其构造输入声明的参数类型路径。

§handle: &'static str

Handle type path that exposes this face to its owner. 向其拥有者暴露本注册面的 handle 类型路径。

§stable_name: Option<&'static str>

Optional author-owned identity that survives source moves. 可选的作者逻辑身份,可跨源码文件移动保持不变。

§name: LocalizedText

Localized display name shown to authors. 向作者显示的本地化名称。

§summary: LocalizedText

Localized one-line description shown alongside the name. 与名称一同显示的本地化单行描述。

§exports: &'static [&'static str]

Export names this face declares. 本注册面声明的导出名称。

§needs_registry: bool

Whether this face owns a child Registry. 本注册面是否拥有一个子注册机。

§registry_name: &'static str

Name 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 str

Source path that produced the registry rule, kept for diagnostics. 产出注册规范的源码路径,用于诊断。

§registry_rule: RegistrationRule

Rule for faces entering the Registry owned by this face. 该注册面拥有的 Registry 所使用的注册规范。

§admission: Admission

External 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: ObjectContract

Construction contract comparing required and supplied parts. 比较所需 parts 与实际提供 parts 的构造合同。

§flow: FlowContract

Automatically 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: SourceLocation

Declaration site this metadata was captured from. 捕获这份元数据时所在的声明位置。

Implementations§

Source§

impl RegistrationInfo

Source

pub const fn stable_face_id(self) -> StableFaceId

Return the opt-in logical identity for this face. 返回该注册面的可选逻辑稳定身份。

Source

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。只有显式名称才需要做全局冲突检查。

Source

pub fn into_snapshot(self) -> RegistrationSnapshot

Copy a compiled declaration into an independently owned snapshot. 将编译期声明复制为独立拥有所有权的快照。

Trait Implementations§

Source§

impl Clone for RegistrationInfo

Source§

fn clone(&self) -> RegistrationInfo

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 RegistrationInfo

Source§

impl Debug for RegistrationInfo

Source§

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

Formats the value using the given formatter. Read more

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.