pub_just::platform_interface

Trait PlatformInterface

Source
pub trait PlatformInterface {
    // Required methods
    fn make_shebang_command(
        path: &Path,
        working_directory: Option<&Path>,
        shebang: Shebang<'_>,
    ) -> Result<Command, OutputError>;
    fn set_execute_permission(path: &Path) -> Result<()>;
    fn signal_from_exit_status(exit_status: ExitStatus) -> Option<i32>;
    fn convert_native_path(
        working_directory: &Path,
        path: &Path,
    ) -> Result<String, String>;
}

Required MethodsĀ§

Source

fn make_shebang_command( path: &Path, working_directory: Option<&Path>, shebang: Shebang<'_>, ) -> Result<Command, OutputError>

Construct a command equivalent to running the script at path with the shebang line shebang

Source

fn set_execute_permission(path: &Path) -> Result<()>

Set the execute permission on the file pointed to by path

Source

fn signal_from_exit_status(exit_status: ExitStatus) -> Option<i32>

Extract the signal from a process exit status, if it was terminated by a signal

Source

fn convert_native_path( working_directory: &Path, path: &Path, ) -> Result<String, String>

Translate a path from a ā€œnativeā€ path to a path the interpreter expects

Dyn CompatibilityĀ§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

ImplementorsĀ§