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

Function resolve_layout

src/storage.rs:241–256  ·  view source on GitHub ↗
(project_root: &Path, profile_root: &Path)

Source from the content-addressed store, hash-verified

239}
240
241pub fn resolve_layout(project_root: &Path, profile_root: &Path) -> Result<StoreLayout> {
242 match read_enrollment_marker(project_root)? {
243 Some(marker) if marker.storage_mode == StorageMode::ProfileSharded => {
244 profile_sharded_layout(project_root, profile_root, &marker)
245 }
246 Some(marker) => Err(TraceDecayError::Config {
247 message: format!(
248 "unsupported storage_mode={:?} in enrollment marker for '{}'; \
249 run TraceDecay migration to move this project into the user profile store",
250 marker.storage_mode,
251 project_root.display()
252 ),
253 }),
254 None => default_profile_sharded_layout(project_root, profile_root),
255 }
256}
257
258pub fn default_profile_root() -> Result<PathBuf> {
259 config::user_data_dir().ok_or_else(|| TraceDecayError::Config {

Calls 3

read_enrollment_markerFunction · 0.85
profile_sharded_layoutFunction · 0.85