Skip to main content

presolve_compiler/
opaque.rs

1//! Compiler-owned resolution products for opaque terminal Actions.
2
3use crate::{SemanticId, SemanticPackageKind, SemanticPackageOpaqueTerminal, SourceProvenance};
4
5/// A valid opaque Action declaration's attempt to select one exact package
6/// terminal. This is still a semantic resolution product: no package bytes are
7/// loaded and no Action runtime behavior is implied by it.
8#[derive(Debug, Clone, PartialEq, Eq)]
9pub struct OpaqueActionResolution {
10    pub activation: SemanticId,
11    pub owner_component: SemanticId,
12    pub method: SemanticId,
13    pub method_name: String,
14    pub package_specifier: String,
15    pub export_name: String,
16    pub outcome: OpaqueActionResolutionOutcome,
17    pub provenance: SourceProvenance,
18}
19
20#[derive(Debug, Clone, PartialEq, Eq)]
21pub enum OpaqueActionResolutionOutcome {
22    UnboundImport {
23        package: String,
24        export: String,
25    },
26    NonOpaqueBinding {
27        package: String,
28        export: String,
29        kind: SemanticPackageKind,
30    },
31    Resolved(OpaqueTerminalBinding),
32}
33
34/// The exact integrity-bound package export selected for an opaque terminal
35/// Action. The package implementation remains opaque to the compiler.
36#[derive(Debug, Clone, PartialEq, Eq)]
37pub struct OpaqueTerminalBinding {
38    pub local_name: String,
39    pub package: String,
40    pub version: String,
41    pub integrity: String,
42    pub export: String,
43    pub type_signature: String,
44    pub runtime_module: String,
45    pub resume_policy: String,
46    pub terminal: SemanticPackageOpaqueTerminal,
47}