std/embed
On this page
Index
- type
Dir- method
Dir.read - method
Dir.read_text - method
Dir.contains - method
Dir.paths - method
Dir.sub - method
Dir.len - method
Dir.fs
- method
Types
Dir
struct Dir {
files: Map[Str, Bytes]
}Files embedded at build time, keyed by their slash path relative to the directory of the file that declares the constant.
Dir.read
fn (d: Dir) read(path: Str) -> Bytes?The bytes of the file at path, or None.
Dir.read_text
fn (d: Dir) read_text(path: Str) -> Str?The text of the file at path, or None when there is none or it is not valid UTF-8.
Dir.contains
fn (d: Dir) contains(path: Str) -> BoolWhether there is a file at path.
Dir.paths
fn (d: Dir) paths() -> List[Str]Every file’s path, sorted.
Dir.sub
fn (d: Dir) sub(dir: Str) -> DirThe files under directory dir, keyed relative to it.
Dir.len
fn (d: Dir) len() -> IntThe number of files.
Dir.fs
fn (d: Dir) fs() -> FsA read-only Fs over the files (decision 0304), for code written
against Fs: read, read_text, stat, exists, read_dir, walk, glob, mode,
and sub see the files and the directories their paths imply (a path
is relative, /, . and a leading ./ name the root); every write,
open, and lock is FsErr.Denied. Nothing needs a capability.