fn write(&self, to_write: OsString, py: Python) -> PyResult<u32> {
        //let utf16_str: Vec<u16> = to_write.encode_utf16().collect();
        let result: Result<u32, OsString> =
            py.allow_threads(move || self.pty.write(to_write));
        match result {
            Ok(bytes) => Ok(bytes),
            Err(error) => {
                let error_str: String = error.to_str().unwrap().to_owned();
                Err(WinptyError::new_err(string_to_static_str(error_str)))
            }
        }
    }
/// Write a byte string into the pseudoterminal input stream.
///
/// Arguments
/// ---------
/// to_write: bytes
///     The byte sequence that is going to be sent to the pseudoterminal.
///
/// Returns
/// -------
/// num_bytes: int
///     The number of bytes that were written successfully.
///
/// Raises
/// ------
/// WinptyError
///     If there was an error whilst trying to write the requested number of bytes
///     into the pseudoterminal.
///
Write a byte string into the pseudoterminal input stream.
Arguments

bytes
The byte sequence that is going to be sent to the pseudoterminal.

Returns

int
The number of bytes that were written successfully.

Raises

WinptyError
If there was an error whilst trying to write the requested number of bytes
into the pseudoterminal.
Write a byte string into the pseudoterminal input stream . Arguments bytes The byte sequence that is going to be sent to the pseudoterminal . Returns int The number of bytes that were written successfully . Raises WinptyError If there was an error whilst trying to write the requested number of bytes into the pseudoterminal .
fn write(&self, to_write: OsString, py: Python) -> PyResult<u32> {
        //let utf16_str: Vec<u16> = to_write.encode_utf16().collect();
        let result: Result<u32, OsString> =
            py.allow_threads(move || self.pty.write(to_write));
        match result {
            Ok(bytes) => Ok(bytes),
            Err(error) => {
                let error_str: String = error.to_str().unwrap().to_owned();
                Err(WinptyError::new_err(string_to_static_str(error_str)))
            }
        }
    }
fn write ( & self , to_write : OsString , py : Python ) -> PyResult < u32 > { //let utf16_str: Vec<u16> = to_write.encode_utf16().collect(); let result : Result < u32 , OsString > = py . allow_threads ( move | | self . pty . write ( to_write ) ) ; match result { Ok ( bytes ) => Ok ( bytes ) , Err ( error ) => { let error_str : String = error . to_str ( ) . unwrap ( ) . to_owned ( ) ; Err ( WinptyError :: new_err ( string_to_static_str ( error_str ) ) ) } } }
Write a byte string into the pseudoterminal input stream.
Write a byte string into the pseudoterminal input stream .
&self
to_write
OsString
py
Python
&self
to_write
OsString
py
Python