[−][src]Trait smolapps::tftp::Context
The context over which the Server
will operate.
The context allows the Server
to open and close Handle
s to files.
It does not impose any restriction on the context hierarchy: it could be a flat
structure or implement a directory tree. It is up to the implementors to define,
if required, the concepts of path separators and nesting levels.
Associated Types
Loading content...Required methods
fn open(&mut self, filename: &str, write_mode: bool) -> Result<Self::Handle, ()>
Attempts to open a file in read-only mode if write_mode
is false
,
otherwise in read-write mode.
The filename
contained in the request packet is provided as-is: no modifications
are applied besides stripping the NULL terminator.
fn close(&mut self, handle: Self::Handle)
Closes the file handle, flushing all pending changes to disk if necessary.