pub struct PrivateFile { /* private fields */ }Expand description
A scratch file inside a directory only this user can enter, removed when this value is dropped along with the directory holding it.
Used for the two serve commands that exchange configuration through a
file. The file itself may not exist: serve get-config refuses a path that
is already taken, so the reserved form hands over a name and lets the client
create it.
Implementations§
Source§impl PrivateFile
impl PrivateFile
Sourcepub fn reserved(name: &str) -> Result<Self, ExecError>
pub fn reserved(name: &str) -> Result<Self, ExecError>
A name inside a new private directory, with nothing at it yet.
Sourcepub fn written(name: &str, contents: &[u8]) -> Result<Self, ExecError>
pub fn written(name: &str, contents: &[u8]) -> Result<Self, ExecError>
The same, with contents already written to it.
pub fn path(&self) -> &Path
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PrivateFile
impl RefUnwindSafe for PrivateFile
impl Send for PrivateFile
impl Sync for PrivateFile
impl Unpin for PrivateFile
impl UnsafeUnpin for PrivateFile
impl UnwindSafe for PrivateFile
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