These are chat archives for rust-lang/rust

Jun 2017
Erich Cordoba
Jun 25 2017 15:33

Hi, I'm trying to understand the std::process::Command structure, the first thing that I see is this patter.

pub struct Command {
    inner: imp::Command,

From my understanding this is the way to select implementations between OS, is that right? What is the name of this pattern or where can I found more documentation about it ?

Anton Ugryumov
Jun 25 2017 16:25
No, it isn't. You can found the selection between OS example here. Target OS is being specified by the compilation parameters. This is how the target_os parameter is being given.
Erich Cordoba
Jun 25 2017 19:28
Ohh ok, so the usage of the innerbinding is to work with whatever target_os is selected?
Denis Lisov
Jun 25 2017 19:34
This is the way a library can use different implementations in different OS.