pub struct Output {
pub rust: String,
pub views: bool,
pub warnings: Vec<String>,
/* private fields */
}Expand description
What generating one library produced: a schema library, or the family of a plugin that declares no schema.
The declarations are the contract: a registry built from them answers what
a registry built from upstream’s own schema data answers. They reach a
consumer as the SCHEMAS table in rust, and this crate’s
own callers through with_family.
Fields§
§rust: StringThe generated file: this library’s tokens and schema data, and its views unless they were left out.
views: boolWhether rust carries the views: Views::Skip was
asked for, or the schema declared skipCodeGeneration.
warnings: Vec<String>What a schema author should know, though the output is still correct.
Implementations§
Source§impl Output
impl Output
Sourcepub fn library_name(&self) -> &str
pub fn library_name(&self) -> &str
The library’s name: the libraryName its schema declared, or the name
of the plugin a declaration family was generated from.
Sourcepub fn layers(&self) -> &[PathBuf]
pub fn layers(&self) -> &[PathBuf]
Where every layer the schema resolved to was found, which is what a
build script watches. A layer reached through a
search_path is here by the location it was
found at, not the bare relative path the schema asked for.
Sourcepub fn with_family<R>(&self, f: impl FnOnce(&SchemaFamily<'_>) -> R) -> R
pub fn with_family<R>(&self, f: impl FnOnce(&SchemaFamily<'_>) -> R) -> R
Calls f with this library’s schemas as a declared family — the schema
data itself, and the same declarations the generated table carries.
A usd::SchemaFamily is a view over its parts, so it arrives through
a closure rather than as a value: what it borrows lives for the call.
usd::SchemaRegistryBuilder::register takes it, and
usd::SchemaFamily::to_data turns it into the class prims a
generatedSchema.usda would carry.
let output = openusd_build::configure()
.build_library("schemas/usdGeom/schema.usda", openusd_build::Views::Generate)?;
let data = output.with_family(|family| family.to_data());