struct MapFile
pub struct MapFile {
pub name string
pub body string
pub dir bool
}Purpose
Structure encapsulating name, body, dir.
Public fields
namestring- name
bodystring- body
dirbool- directory
#testing/fstestIn-memory MapFS and a consistency check.
struct MapFilepub struct MapFile {
pub name string
pub body string
pub dir bool
}Structure encapsulating name, body, dir.
name stringbody stringdir boolstruct MapFSpub struct MapFS {
pub files []MapFile
}Structure encapsulating files.
files []MapFilemap_fspub fn map_fs() MapFSConstruct an in-memory MapFS virtual test filesystem.
No arguments are required.
MapFS — a value of this type
($&MapFS) addpub fn (fs $&MapFS) add(name string, body string)Operation on $&MapFS: add.
fs $&MapFSMapFS instance used by this call (exclusive borrow).name stringbody stringThis call does not return a value.
($&MapFS) add_dirpub fn (fs $&MapFS) add_dir(name string)Operation on $&MapFS: add directory.
fs $&MapFSMapFS instance used by this call (exclusive borrow).name stringThis call does not return a value.
(MapFS) read_filepub fn (fs MapFS) read_file(name string) stringOperation on MapFS: read file. Throws on failure; handle the error or propagate it to the caller.
fs MapFSMapFS instance used by this call (value receiver).name stringstring — result string
(MapFS) stat_dirpub fn (fs MapFS) stat_dir(name string) boolOperation on MapFS: stat directory.
fs MapFSMapFS instance used by this call (value receiver).name stringbool — true or false
(MapFS) haspub fn (fs MapFS) has(name string) boolExecute has on MapFS.
fs MapFSMapFS instance used by this call (value receiver).name stringbool — true or false
testpub fn test(fs &MapFS) intExecute test. Throws on failure; handle the error or propagate it to the caller.
fs &MapFSint — a value of this type