rust/chg/src/clientext.rs
changeset 45620 426294d06ddc
parent 44752 d6f706929120
equal deleted inserted replaced
45619:e8078af6af30 45620:426294d06ddc
    41         &mut self,
    41         &mut self,
    42         stdin: &impl AsRawFd,
    42         stdin: &impl AsRawFd,
    43         stdout: &impl AsRawFd,
    43         stdout: &impl AsRawFd,
    44         stderr: &impl AsRawFd,
    44         stderr: &impl AsRawFd,
    45     ) -> io::Result<()> {
    45     ) -> io::Result<()> {
    46         attachio::attach_io(self.client.borrow_protocol_mut(), stdin, stdout, stderr).await
    46         attachio::attach_io(
       
    47             self.client.borrow_protocol_mut(),
       
    48             stdin,
       
    49             stdout,
       
    50             stderr,
       
    51         )
       
    52         .await
    47     }
    53     }
    48 
    54 
    49     /// Changes the working directory of the server.
    55     /// Changes the working directory of the server.
    50     pub async fn set_current_dir(&mut self, dir: impl AsRef<Path>) -> io::Result<()> {
    56     pub async fn set_current_dir(
       
    57         &mut self,
       
    58         dir: impl AsRef<Path>,
       
    59     ) -> io::Result<()> {
    51         let dir_bytes = dir.as_ref().as_os_str().as_bytes().to_owned();
    60         let dir_bytes = dir.as_ref().as_os_str().as_bytes().to_owned();
    52         self.client
    61         self.client
    53             .borrow_protocol_mut()
    62             .borrow_protocol_mut()
    54             .send_command_with_args("chdir", dir_bytes)
    63             .send_command_with_args("chdir", dir_bytes)
    55             .await
    64             .await
    65             .send_command_with_args("setenv", message::pack_env_vars_os(vars))
    74             .send_command_with_args("setenv", message::pack_env_vars_os(vars))
    66             .await
    75             .await
    67     }
    76     }
    68 
    77 
    69     /// Changes the process title of the server.
    78     /// Changes the process title of the server.
    70     pub async fn set_process_name(&mut self, name: impl AsRef<OsStr>) -> io::Result<()> {
    79     pub async fn set_process_name(
       
    80         &mut self,
       
    81         name: impl AsRef<OsStr>,
       
    82     ) -> io::Result<()> {
    71         let name_bytes = name.as_ref().as_bytes().to_owned();
    83         let name_bytes = name.as_ref().as_bytes().to_owned();
    72         self.client
    84         self.client
    73             .borrow_protocol_mut()
    85             .borrow_protocol_mut()
    74             .send_command_with_args("setprocname", name_bytes)
    86             .send_command_with_args("setprocname", name_bytes)
    75             .await
    87             .await