Expand description
Parsing and rendering helpers for authored registration faces. 注册面创作文件的解析与渲染辅助函数。
The pure source-text transformations live in the kernel authoring
module; this shim keeps the historical
nichlink_run_method::authoring::parse path and re-implements the two
filesystem-bound entry points as thin wrappers.
纯源码文本变换位于 kernel 的 authoring 模块;本 shim 保留
nichlink_run_method::authoring::parse 历史路径,并把两个绑定文件
系统的入口重新实现为薄包装。
Structs§
- Face
Parse Error - Why authored face text was refused. 创作注册面文本被拒绝的原因。
Functions§
- kind_
from_ source_ text - Read the declared
kindout of a registration-face source text. 从注册面源码文本中读取它声明的kind。 - literal_
string_ expr - Extract the string literal of an expression, rejecting anything else. 取出表达式的字符串字面量,其余写法一律拒绝。
- module_
name_ from_ path - The module name implied by a source file path: its file stem, or
modulewhen the stem is not valid UTF-8. 源文件路径隐含的模块名:文件主干名;主干不是合法 UTF-8 时为module。 - module_
source_ from_ node_ path - The source file a
crate::…module path names, in this crate’s<dir>/<name>.rslayout;Nonewhen the path cannot name a file at all.crate::…模块路径在本 crate 的<dir>/<name>.rs布局下指向的源文件;该路径根本无法 命名文件时为None。 - parse_
admission_ expression - Read an admission expression, accepting both the compact and constructor spellings. 读取 admission 表达式,同时接受紧凑写法与构造形式。
- parse_
admission_ owned - Parse a compact admission value into its owned snapshot form. 将紧凑 admission 值解析为快照使用的拥有型形式。
- parse_
flow_ expression - Parse a flow expression back into the editor’s compact form. 将 flow 表达式解析回编辑器使用的紧凑形式。
- parse_
flow_ value - Parse the compact flow value into an owned contract for a reload snapshot. 将紧凑 flow 值解析为热重载快照使用的拥有型合同。
- parse_
optional_ source - Accept or refuse an optional string field’s text, which is the same rule
render_optional_sourceapplies — minus the rendering. 接受或拒绝可选字符串字段的文本,与render_optional_source用的是同一条规则——只是 不做渲染。 - parse_
registration_ rule_ owned - Parse the compact registration-rule value into an owned rule. 将紧凑注册规范值解析为拥有型规则。
- parse_
requirements - Check that every
requiresentry uses thecapability=>providershape. 校验每条requires条目都使用capability=>provider形状。 - parse_
requirements_ owned - Parse
capability=>providerpairs into their owned snapshot form. 将capability=>provider对解析为快照使用的拥有型形式。 - path_
ends_ with - Whether a Rust path expression ends with the given suffix. Rust 路径表达式是否以给定后缀结尾。
- quoted_
list_ field - Read the quoted strings of one bracketed field, e.g.
marker: ["a", "b"]. 读取一个方括号字段里的引号字符串,例如marker: ["a", "b"]。 - render_
admission - Render a compact admission value as the
Admissionconstructor expression. 将紧凑 admission 值渲染成Admission构造表达式。 - render_
expression_ list - Render a runtime-check list back to the expression text the macro takes,
refusing anything
RuntimeCheckSpeccannot parse. 把运行期检查列表渲染回宏接受的表达式文本;RuntimeCheckSpec解析不了的一律拒绝。 - render_
face_ list - Render one comma-separated value as a quoted list field, indented and newline-terminated; an empty value renders as nothing at all. 把一个逗号分隔的取值渲染成带引号的列表字段(缩进且以换行结尾);取值为空时不渲染任何 内容。
- render_
flow_ expression - Render the editor’s
id|version|input|outputform as a Rust expression. 将编辑器中的id|version|input|output形式渲染为 Rust 表达式。 - render_
flow_ provider - Render an explicitly selected flow provider type. 渲染显式选择的数据流合同提供者类型。
- render_
literal_ list - Render a comma-separated value as quoted literals joined by
,, for inlining inside a bracketed list. 把逗号分隔的取值渲染成以,连接的带引号字面量,供内联进方括号列表。 - render_
optional_ source - Render an optional string field: an empty value or
nonebecomesNone, anything else becomesSome("…")with the text escaped. 渲染可选字符串字段:空值或none变成None,其余变成转义后的Some("…")。 - render_
path_ list - Render a comma-separated value as Rust paths joined by
,, keeping the author’s spelling because the compiler resolves it. 把逗号分隔的取值渲染成以,连接的 Rust 路径,保留作者的写法,因为由编译器解析。 - render_
registration_ rule - Render the compact registration-rule syntax as a const Rust expression. 将紧凑注册规范语法渲染成 const Rust 表达式。
- render_
requirements - Render
capability=>providerpairs as a Rustrequires:list. 把capability=>provider对渲染成 Rust 的requires:列表。 - rule_
syntax_ from_ text - Reduce a registry-rule source text to its compact syntax form. 将注册规则源码文本化简为紧凑语法形式。
- split_
csv_ owned - Split a comma-separated list into trimmed, non-empty owned strings. 把逗号分隔的列表切成去空白、去空项的自有字符串。
- trait_
names_ from_ paths - Derive the human-facing trait labels from compiler-checked Rust paths. 从参与编译检查的 Rust 路径派生人类可读的 trait 名称。