Skip to main content

Platform

Trait Platform 

Source
pub trait Platform {
    // Required methods
    fn env(&self, name: &str) -> Option<String>;
    fn os(&self) -> Os;
    fn stdin_is_tty(&self) -> bool;
    fn stdout_is_tty(&self) -> bool;
    fn client(&self, config: Config) -> Result<Client, ApiError>;
    fn exec(&self, command: &str, stdin: &[u8]) -> Result<i32>;
    fn terminal(&self) -> Option<Box<dyn Terminal>>;
}
Expand description

What the program asks of the system.

Required Methods§

Source

fn env(&self, name: &str) -> Option<String>

Source

fn os(&self) -> Os

Source

fn stdin_is_tty(&self) -> bool

Source

fn stdout_is_tty(&self) -> bool

Source

fn client(&self, config: Config) -> Result<Client, ApiError>

The API client for this configuration.

Source

fn exec(&self, command: &str, stdin: &[u8]) -> Result<i32>

Runs command through the system’s command interpreter, with stdin on standard input, and returns the exit code.

Source

fn terminal(&self) -> Option<Box<dyn Terminal>>

The terminal in raw mode for the interactive screen, if there is one.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§