Struct papyrus::Script [−][src]
pub struct Script { /* fields omitted */ }
Methods
impl Script
[src]
impl Script
pub fn build_compile_dir<P: AsRef<Path>>(
src: &[u8],
package_name: &str,
compile_dir: &P,
src_filetype: SourceFileType
) -> Result<Self, Context<String>>
[src]
pub fn build_compile_dir<P: AsRef<Path>>(
src: &[u8],
package_name: &str,
compile_dir: &P,
src_filetype: SourceFileType
) -> Result<Self, Context<String>>
Constructs the compile directory with the given main source file contents.
Expects SourceFileType::Rs
to define a main()
function.
SourceFileType::Rscript
will encase code in a main()
function.
pub fn run<P: AsRef<Path>>(
self,
working_dir: &P
) -> Result<Output, Context<String>>
[src]
pub fn run<P: AsRef<Path>>(
self,
working_dir: &P
) -> Result<Output, Context<String>>
Runs cargo build
, then runs the exe
from the given directory. Stdin and Stdout are inherited (allowing live updating of progress).
Waits for process to finish and returns the Output
of the process.