-
Notifications
You must be signed in to change notification settings - Fork 692
Expand file tree
/
Copy pathplatform_interface.rs
More file actions
24 lines (19 loc) · 865 Bytes
/
platform_interface.rs
File metadata and controls
24 lines (19 loc) · 865 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use super::*;
pub(crate) trait PlatformInterface {
/// translate path from "native" path to path interpreter expects
fn convert_native_path(config: &Config, working_directory: &Path, path: &Path) -> FunctionResult;
/// install handler, may only be called once
fn install_signal_handler<T: Fn(Signal) + Send + 'static>(handler: T) -> RunResult<'static>;
/// construct command equivalent to running script at `path` with shebang
/// line `shebang`
fn make_shebang_command(
config: &Config,
path: &Path,
shebang: Shebang,
working_directory: Option<&Path>,
) -> Result<Command, OutputError>;
/// set the execute permission on file pointed to by `path`
fn set_execute_permission(path: &Path) -> io::Result<()>;
/// extract signal from process exit status
fn signal_from_exit_status(exit_status: ExitStatus) -> Option<i32>;
}