pub struct DataDirectory { /* private fields */ }Expand description
A pinned capability for VSH’s durable data directory.
Runtime-owned files are opened relative to this handle, so replacing an ambient ancestor with a symlink cannot redirect later blob or state-store I/O.
Implementations§
Source§impl DataDirectory
impl DataDirectory
Sourcepub fn open_trusted(path: impl AsRef<Path>) -> Result<Self, DataDirectoryError>
pub fn open_trusted(path: impl AsRef<Path>) -> Result<Self, DataDirectoryError>
Open a caller-selected, trusted data directory with ambient authority.
The final component must be a real directory rather than a symbolic link.
Runtime callers should keep this directory disjoint from the untrusted
workspace; Self::open_workspace is the safe constructor for the default
workspace-local location.
§Errors
Returns an error if the directory cannot be created, pinned, or verified.
Sourcepub fn open_workspace(
workspace_root: impl AsRef<Path>,
) -> Result<Self, DataDirectoryError>
pub fn open_workspace( workspace_root: impl AsRef<Path>, ) -> Result<Self, DataDirectoryError>
Open the protected .vsh-runtime/data directory below a workspace handle.
Every child is created and verified relative to a pinned workspace capability. Pre-existing symlinks and directory-swap races therefore fail closed without writing outside the workspace root.
§Errors
Returns an error if the workspace cannot be opened or either protected component is not a stable real directory.
Sourcepub fn open_runtime_data(
runtime: &Dir,
workspace_root: impl AsRef<Path>,
) -> Result<Self, DataDirectoryError>
pub fn open_runtime_data( runtime: &Dir, workspace_root: impl AsRef<Path>, ) -> Result<Self, DataDirectoryError>
Open .vsh-runtime/data relative to an already pinned runtime directory.
This constructor lets the trusted committer and durable stores share one runtime-directory identity instead of reopening an ambient path.
§Errors
Returns an error if data cannot be created, pinned, or synchronized.
Trait Implementations§
Source§impl Clone for DataDirectory
impl Clone for DataDirectory
Source§fn clone(&self) -> DataDirectory
fn clone(&self) -> DataDirectory
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more