Skip to main content

Host

Trait Host 

Source
pub trait Host {
    // Required methods
    fn exists(&self, path: &[u8]) -> bool;
    fn is_dir(&self, path: &[u8]) -> bool;
    fn host_path(&self, path: &[u8]) -> Vec<u8> ⓘ;
    fn cwd(&self) -> Vec<u8> ⓘ;
    fn var(&self, name: &[u8]) -> Option<Vec<u8>>;
    fn vars(&self) -> Vec<(Vec<u8>, Vec<u8>)>;
    fn read_fd(&self, fd: i32) -> Result<Vec<u8>>;
    fn fd_path(&self, fd: i32) -> Result<Vec<u8>>;
}
Expand description

The process a command line is interpreted for.

Required Methods§

Source

fn exists(&self, path: &[u8]) -> bool

Whether path, as this process names it, exists.

Source

fn is_dir(&self, path: &[u8]) -> bool

Whether path, as this process names it, is a directory (symlinks followed).

Source

fn host_path(&self, path: &[u8]) -> Vec<u8> ⓘ

The absolute host path behind path as this process names it.

A path that does not exist is still mapped, so a binding may name a mount point that appears later.

Source

fn cwd(&self) -> Vec<u8> ⓘ

The working directory, as this process names it.

Source

fn var(&self, name: &[u8]) -> Option<Vec<u8>>

One environment variable.

Source

fn vars(&self) -> Vec<(Vec<u8>, Vec<u8>)>

The whole environment.

Source

fn read_fd(&self, fd: i32) -> Result<Vec<u8>>

Reads descriptor fd of this process to its end.

Source

fn fd_path(&self, fd: i32) -> Result<Vec<u8>>

The host path descriptor fd of this process is open on.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl Host for Local

Source§

impl Host for Tracee<'_>