MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / compile

Method compile

crates/testing/src/modules.rs:185–199  ·  view source on GitHub ↗
(name: &str, mode: CompilationMode)

Source from the content-addressed store, hash-verified

183
184impl CompiledModule {
185 pub fn compile(name: &str, mode: CompilationMode) -> Self {
186 let (path, host_type) = spacetimedb_cli::build(
187 &module_path(name),
188 Some(PathBuf::from("src")).as_deref(),
189 mode == CompilationMode::Debug,
190 None,
191 )
192 .expect("Module compilation failed");
193 Self {
194 name: name.to_owned(),
195 path,
196 host_type: host_type.parse().unwrap(),
197 program_bytes: OnceLock::new(),
198 }
199 }
200
201 pub fn path(&self) -> &Path {
202 &self.path

Callers

nothing calls this directly

Calls 6

buildFunction · 0.85
module_pathFunction · 0.85
newFunction · 0.50
to_ownedMethod · 0.45
unwrapMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected