flatten_with_options
Stable function · Flatten
Tier: stable · Kind: function · Topic: Flatten
| Julia | TypeScript | Python | Rust | Go |
|---|---|---|---|---|
| not exported | not exported | not exported | flatten_with_options | FlattenWithOptions |
Julia
Julia does not export this function.
TypeScript
TypeScript does not export this function.
Python
Python does not export this function.
Rust
pub fn flatten_with_options(file: &EsmFile, options: &CouplingImportOptions<'_>) -> Result<FlattenedSystem, FlattenError>
Flatten with explicit CouplingImportOptions
controlling how
coupling_import refs resolve (esm-spec §10.10.3). When the file carries
no coupling_import entry this is identical to flatten
; otherwise the
import entries are expanded into concrete edges — spliced in position — as a
§4.7.5 sub-step before the coupling-rule step, and flattening proceeds over
the expanded coupling sequence. The coupling_import source entry is not
mutated on the caller’s file; the expansion operates on an internal clone.
Errors
Returns FlattenError::CouplingImport (carrying a stable §10.11
diagnostic code) if any coupling_import fails to resolve or expand;
otherwise the FlattenError
taxonomy of flatten
.
Go
func FlattenWithOptions(file *ESMFile, opts CouplingImportOptions) (*FlattenedSystem, error)
FlattenWithOptions is Flatten with control over how coupling_import refs are resolved (esm-spec §10.10). Only needed when the file uses coupling_import; a file with no such entries flattens identically under the zero-value options.