pub struct MontyFileHandle {
pub path: String,
pub mode: FileMode,
pub position: u64,
}Expand description
An open file object (the result of open()).
This is the boundary representation of Monty’s heap OpenFile
wrapper. It carries everything needed to service a file operation from a
host that holds no live OS handle: the virtual path, the mode, and
the byte position for seek-aware reads.
The host produces a FileHandle as the result of an
OsFunctionCall::Open call; the
interpreter then builds its heap file wrapper from it. Conversely, a heap file
object passed as an argument to a read/write OS call is converted
back to a FileHandle so the host receives this state.
Fields§
§path: StringThe virtual (sandbox) path of the file. Never a host path.
mode: FileModeThe parsed open() mode.
position: u64Position for sized/line/seek operations: char index in text mode,
byte index in binary mode. 0 for a freshly opened file.
Trait Implementations§
Source§impl Clone for MontyFileHandle
impl Clone for MontyFileHandle
Source§fn clone(&self) -> MontyFileHandle
fn clone(&self) -> MontyFileHandle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more