MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / build

Method build

tests/common/mod.rs:103–121  ·  view source on GitHub ↗
(env_lock: tokio::sync::MutexGuard<'static, ()>)

Source from the content-addressed store, hash-verified

101
102impl IsolatedEnv {
103 fn build(env_lock: tokio::sync::MutexGuard<'static, ()>) -> (Self, PathBuf) {
104 let dir = tempdir_or_panic();
105 let storage = TraceDecayStorageEnvGuard::for_tempdir(&dir);
106 let project = dir.path().join("project");
107 fs::create_dir_all(&project).unwrap_or_else(|err| {
108 panic!(
109 "failed to create isolated project directory '{}': {err}",
110 project.display()
111 )
112 });
113 (
114 Self {
115 storage,
116 _dir: dir,
117 _env_lock: env_lock,
118 },
119 project,
120 )
121 }
122
123 pub async fn acquire() -> (Self, PathBuf) {
124 Self::build(ISOLATED_ENV_LOCK.lock().await)

Callers 15

async_mainFunction · 0.80
agent_with_timeoutFunction · 0.80
fetch_asset_urlFunction · 0.80
download_and_extractFunction · 0.80
open_localMethod · 0.80
open_read_onlyFunction · 0.80
test_connFunction · 0.80
mem_connFunction · 0.80
in_memory_connFunction · 0.80

Calls 1

tempdir_or_panicFunction · 0.85

Tested by 15

test_connFunction · 0.64
mem_connFunction · 0.64
test_connFunction · 0.64
write_sqlite_placeholderFunction · 0.64
open_test_db_connectionFunction · 0.64
dropMethod · 0.64
set_user_versionFunction · 0.64
drop_memory_factsFunction · 0.64