MCPcopy Create free account
hub / github.com/TheRedDeveloper/ply-engine / remove

Method remove

src/storage.rs:119–136  ·  view source on GitHub ↗
(&self, path: &str)

Source from the content-addressed store, hash-verified

117 }
118
119 pub async fn remove(&self, path: &str) -> Result<(), String> {
120 #[cfg(not(target_arch = "wasm32"))]
121 {
122 let full_path = self.resolve_path(path)?;
123 std::fs::remove_file(full_path).map_err(|e| e.to_string())?;
124 Ok(())
125 }
126
127 #[cfg(target_arch = "wasm32")]
128 {
129 let normalized_path = normalize_relative_path(path, "storage remove path")?;
130 let op_id = unsafe {
131 ply_storage_remove(self.root_id, JsObject::string(&normalized_path))
132 };
133 let result = wait_for_response(op_id).await?;
134 ensure_success(&result)
135 }
136 }
137
138 pub async fn export(&self, path: &str) -> Result<(), String> {
139 #[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))]

Callers 9

ply_storage_exportFunction · 0.80
gFunction · 0.80
ply_bundle.jsFile · 0.80
poll_completionsFunction · 0.80
set_sourceMethod · 0.80
push_undoMethod · 0.80
cancelMethod · 0.80
closeMethod · 0.80

Calls 5

normalize_relative_pathFunction · 0.85
ply_storage_removeFunction · 0.85
wait_for_responseFunction · 0.85
ensure_successFunction · 0.85
resolve_pathMethod · 0.80

Tested by

no test coverage detected