Skip to main content

wire_contract_at

Function wire_contract_at 

Source
pub fn wire_contract_at(
    unit: &str,
    text: &str,
    offset: usize,
    info: &ContextBoundaryInfo,
    expr_types: &[(Span, TyId)],
    tys: &Types,
    context_count: usize,
) -> Option<WireContractModel>
Expand description

Locate the Handler enclosing offset in text and build its wire contract. Mirrors sequence_request::sequence_model_at’s re-parse convention. info is the owning unit’s retained boundary table (Phase 3); expr_types is that same file’s checked expression types (empty for a file with errors — the Ok-overload disambiguation then falls back to the declared return type, see ResponseWalk::is_http_result_expr below).

context_count is how many real contexts/adapters the project has — build it with real_context_count, not a bare boundary_info.len() (see that function’s doc for why the difference matters).

Scoped to service handlers (see the module doc); an agent handler at offset answers None.