MCPcopy Create free account
hub / github.com/VivekPanyam/lunchbox / create

Method create

src/types.rs:212–222  ·  view source on GitHub ↗

Equivalent to ``` async fn create(&self, path: impl PathType) -> Result where Self::FileType: WritableFile; ``` Opens a file in write-only mode. This function will create a file if it does not exist, and will truncate it if it does. See [`OpenOptions`] for more details.

(&self, path: impl PathType)

Source from the content-addressed store, hash-verified

210 ///
211 /// See [`OpenOptions`] for more details.
212 async fn create(&self, path: impl PathType) -> Result<Self::FileType>
213 where
214 Self::FileType: WritableFile,
215 {
216 OpenOptions::new()
217 .write(true)
218 .create(true)
219 .truncate(true)
220 .open(self, path)
221 .await
222 }
223
224 /// Equivalent to
225 /// ```

Callers

nothing calls this directly

Implementers 2

chroot.rssrc/chroot.rs
localfs.rssrc/localfs.rs

Calls 4

truncateMethod · 0.80
openMethod · 0.45
createMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected