pub struct LibraryLayout;Expand description
The layout of a library’s files (modules.md, Libraries): a
directory holding MARKER is a library’s root, a module
path P names <root>/P.flow or <root>/contract/P.flow, and the
root module, whose module path is empty, is lib.flow or
contract/lib.flow.
Implementations§
Source§impl LibraryLayout
impl LibraryLayout
Sourcepub const MARKER: &'static str = "flow.toml"
pub const MARKER: &'static str = "flow.toml"
The file whose presence makes a directory a library’s root.
Sourcepub const CONTRACT: &'static str = "contract"
pub const CONTRACT: &'static str = "contract"
The directory, under a library’s root, that holds its contract modules.
Sourcepub fn marker(dir: &str) -> String
pub fn marker(dir: &str) -> String
The path of dir’s marker, dir given from a tree’s root and
empty for the root itself.
Sourcepub fn file(stem: &str) -> String
pub fn file(stem: &str) -> String
The name of the file whose path without its extension is stem.
Sourcepub fn stem(file: &str) -> Option<&str>
pub fn stem(file: &str) -> Option<&str>
The path of the module file file without its extension; None
for a file that is no module’s.
Sourcepub fn placed_stem(module: &Segments) -> Segments
pub fn placed_stem(module: &Segments) -> Segments
The path of module’s file without its extension, from the
directory that holds the files of its placement: the library’s root
for an authored module, its contract directory for a contract one.
The root module’s is lib.
Sourcepub fn placed_file(module: &Segments) -> String
pub fn placed_file(module: &Segments) -> String
The file of module, with its extension, from the directory that
holds the files of its placement: lib.flow for the root module.
Sourcepub fn placed_module(stem: &Segments) -> Segments
pub fn placed_module(stem: &Segments) -> Segments
The module whose file, from the directory that holds the files of
its placement and without its extension, is stem: the inverse of
placed_stem.
Sourcepub fn module_file(module: &Segments, placement: Placement) -> Segments
pub fn module_file(module: &Segments, placement: Placement) -> Segments
The file, inside its library and without its extension, that holds
the module module in placement.