pub struct OutputRoot { /* private fields */ }Expand description
A caller-granted directory held open across all operations. Relative path resolution cannot follow a symlink outside this capability, even if a pathname checked earlier is concurrently replaced.
Implementations§
Source§impl OutputRoot
impl OutputRoot
Sourcepub fn open(root: &Path) -> Result<OutputRoot, Error>
pub fn open(root: &Path) -> Result<OutputRoot, Error>
Grant access to an existing trusted directory once, before serving callers.
Sourcepub fn read(&self, relative: &Path) -> Result<Vec<u8>, Error>
pub fn read(&self, relative: &Path) -> Result<Vec<u8>, Error>
Read a confined file without reopening the root by pathname.
Sourcepub fn publish(
&self,
files: &[(PathBuf, &[u8])],
overwrite: bool,
) -> Result<PublishReport, PublishError>
pub fn publish( &self, files: &[(PathBuf, &[u8])], overwrite: bool, ) -> Result<PublishReport, PublishError>
Stage and verify every file before committing any. Replacement is atomic per file, not across the set. Existing outputs survive all staging errors.
§Errors
Rejects nonportable paths, escaping symlinks, output symlinks and conflicts. A commit or durability error reports the files already committed. Cleanup failures are returned as warnings on either outcome.
Auto Trait Implementations§
impl Forget for OutputRoot
impl Freeze for OutputRoot
impl Move for OutputRoot
impl RefUnwindSafe for OutputRoot
impl Send for OutputRoot
impl Sync for OutputRoot
impl Unpin for OutputRoot
impl UnsafeUnpin for OutputRoot
impl UnwindSafe for OutputRoot
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