pub struct LocalFs { /* private fields */ }Expand description
Local filesystem backed by std::fs with FsPolicy enforcement.
Implementations§
Trait Implementations§
Source§impl FsPort for LocalFs
impl FsPort for LocalFs
Source§fn workspace_root(&self) -> &Path
fn workspace_root(&self) -> &Path
The workspace root directory.
Source§fn resolve(&self, path: &Path) -> PraxisResult<PathBuf>
fn resolve(&self, path: &Path) -> PraxisResult<PathBuf>
Resolve an existing path within the workspace.
Source§fn resolve_for_write(&self, path: &Path) -> PraxisResult<PathBuf>
fn resolve_for_write(&self, path: &Path) -> PraxisResult<PathBuf>
Resolve a path for writing (file may not exist yet).
Source§fn read_to_string(&self, path: &Path) -> PraxisResult<String>
fn read_to_string(&self, path: &Path) -> PraxisResult<String>
Read a file as UTF-8 text.
Source§fn read_bytes(&self, path: &Path) -> PraxisResult<Vec<u8>>
fn read_bytes(&self, path: &Path) -> PraxisResult<Vec<u8>>
Read a file as raw bytes.
Source§fn write(&self, path: &Path, content: &[u8]) -> PraxisResult<()>
fn write(&self, path: &Path, content: &[u8]) -> PraxisResult<()>
Write content to a file. Creates parent directories as needed.
Source§fn metadata(&self, path: &Path) -> PraxisResult<FsMetadata>
fn metadata(&self, path: &Path) -> PraxisResult<FsMetadata>
Get metadata for a path.
Source§fn read_dir(&self, path: &Path) -> PraxisResult<Vec<FsDirEntry>>
fn read_dir(&self, path: &Path) -> PraxisResult<Vec<FsDirEntry>>
List entries in a directory.
Source§fn create_dir_all(&self, path: &Path) -> PraxisResult<()>
fn create_dir_all(&self, path: &Path) -> PraxisResult<()>
Create a directory and all parent directories.
Auto Trait Implementations§
impl Freeze for LocalFs
impl RefUnwindSafe for LocalFs
impl Send for LocalFs
impl Sync for LocalFs
impl Unpin for LocalFs
impl UnsafeUnpin for LocalFs
impl UnwindSafe for LocalFs
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more