Skip to main content

RegistrationSnapshot

Struct RegistrationSnapshot 

Source
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: String

Package namespace that owns this declaration.

§id: NodeId

Stable node id assigned to this declaration. 分配给本声明的稳定节点 id。

§parent: NodeId

Node id of the registry owner this declaration is mounted under. 本声明挂载到的注册机拥有者的节点 id。

§kind: String

Face kind name the declaration was authored with. 声明书写时使用的注册面种类名。

§preset: String

Preset name selected for construction. 构造时所选的 preset 名称。

§parts: String

Parts type name supplying the construction shape. 提供构造形状的 parts 类型名。

§params: String

Params type name carrying this face’s parameters. 承载该注册面参数的 params 类型名。

§handle: String

Handle type name owning this face’s runtime state. 拥有该注册面运行期状态的 handle 类型名。

§stable_name: Option<String>

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

§name: OwnedLocalizedText

Bilingual display name of the face. 注册面的双语显示名称。

§summary: OwnedLocalizedText

Bilingual one-line summary of the face. 注册面的双语单行摘要。

§exports: Vec<String>

Export names this face publishes. 本注册面公开的导出名称。

§needs_registry: bool

Whether this face owns a registry others may register into. 本注册面是否拥有一个可供他人注册的注册机。

§registry_name: String

Registry 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: String

Source path of the declaration that supplied the registry rule. 提供注册规范的声明所在源码路径。

§registry_rule: OwnedRegistrationRule

Rule for faces entering the registry owned by this face. 进入本注册面所拥有的注册机时必须满足的规范。

§admission: OwnedAdmission

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

Construction contract between preset and parts. preset 与 parts 之间的构造合同。

§flow: OwnedFlowContract

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

Declaration site captured for diagnostics. 为诊断捕获的声明位置。

Implementations§

Source§

impl RegistrationSnapshot

Source

pub fn stable_face_id(&self) -> StableFaceId

Return the same logical identity used by compiled declarations. 返回与编译期声明一致的逻辑稳定身份。

Source

pub fn explicit_stable_face_id(&self) -> Option<StableFaceId>

Return the explicit stable identity, if this snapshot declared one. 返回快照显式声明的稳定身份。

Source

pub fn merge_authored( self, authored: RegistrationSnapshot, ) -> RegistrationSnapshot

Apply file-authored fields while retaining executable compiled metadata. 应用文件中可编辑的字段,同时保留编译产物中的可执行元数据。

Trait Implementations§

Source§

impl Clone for RegistrationSnapshot

Source§

fn clone(&self) -> RegistrationSnapshot

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 Debug for RegistrationSnapshot

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for RegistrationSnapshot

Source§

impl PartialEq for RegistrationSnapshot

Source§

fn eq(&self, other: &RegistrationSnapshot) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for RegistrationSnapshot

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.