Skip to main content

to_wire

Function to_wire 

Source
pub fn to_wire(
    model: &WireContractModel,
    project_root: &Path,
    text: &str,
    types: &HashMap<String, Arc<TypeDecl>>,
    index: &ProjectIndex,
    snapshots: &HashMap<PathBuf, String>,
    search_order: &[String],
) -> WcModel
Expand description

Lower a WireContractModel to its wire shape.

text is the handler’s own file’s committed snapshot (the request document) — model.handler_span and each HTTP response’s Constructed span both index into it. types is the owning unit’s combined type table (ContextBoundaryInfo::types), needed to resolve each generic instantiation’s type-argument shapes (see wc_inst). index + snapshots + search_order resolve each boundary type’s own declaring file (see the module doc’s “Cross-file type locations” section) — a deliberate widening of the plan’s sketched to_wire(model, project_root, snapshots) signature, which had no way to know which file a uses- imported boundary type’s span belongs to.