Struct passerine::common::source::Source [−][src]
Expand description
Source
represents some literal source code.
Whether a repl session, a file on disk, or some library code.
It’s essentially a string with a path, the path serving as the source’s name.
Source files without a path point to ./source
,
though this behaviour might change in the future.
Fields
contents: String
path: PathBuf
Implementations
Creates a new Source
given both an &str
and a PathBuf
.
Note that this function does not check that the contents of the file
match the source.
Source::path
or Source::source
should be used instead.
Build a Source
from a path.
This will read a file to create a new source.