Optional isolated Moonx process launcher and private Node payload lifetime
///|
test "construct an immutable Node payload plan" {
let entry = @moonx.RelativeFilePath::parse("app/entry.js")
let payload = @moonx.Payload::new([
@moonx.PayloadFile::new(entry, b"process.exitCode = 23;"),
], entry)
let arguments = @moonx.Arguments::parse(["", "--", "a b", "é🙂"])
let plan = @moonx.NodeLaunch::new(payload, arguments)
assert_eq(plan.payload().entry().to_string(), "app/entry.js")
assert_eq(plan.arguments().to_array(), ["", "--", "a b", "é🙂"])
}pub suberror ExecutableError {
InvalidExecutable(input~ : String, rule~ : ExecutableRule)
} derive(Debug)pub suberror PayloadError {
DuplicatePayloadPath(first~ : RelativeFilePath, second~ : RelativeFilePath)
PayloadFileDirectoryConflict(file~ : RelativeFilePath, descendant~ : RelativeFilePath)
PayloadDirectoryCaseConflict(first~ : RelativeFilePath, second~ : RelativeFilePath)
PayloadEntryMissing(entry~ : RelativeFilePath)
} derive(Debug)pub suberror PayloadPathError {
InvalidPayloadPath(input~ : String, rule~ : PayloadPathRule)
} derive(Debug)pub struct Arguments {
// private fields
}pub(all) enum ChildCompletion {
Exited(ProcessStatus)
Stopped(cause~ : CancellationCause, status~ : ProcessStatus, force_requested~ : Bool)
Failed(Error)
} derive(Debug)pub struct Command {
// private fields
}pub struct LaunchOutcome {
// private fields
}fn LaunchOutcome::new(result : LaunchResult, selected : ProcessStatus, failures : Array[FinalizationFailure]) -> LaunchOutcomepub struct NodeLaunch {
// private fields
}pub struct Payload {
// private fields
}pub struct PayloadFile {
// private fields
}pub struct ShutdownGrace {
// private fields
}pub(all) enum StartupFailure {
Materialization(Error)
NodeMissing(executable~ : Executable, cause~ : Error)
ProcessStart(Error)
} derive(Debug)