mirror of
https://github.com/wez/wezterm.git
synced 2024-11-21 18:12:23 +03:00
speculative windows build fix
This commit is contained in:
parent
eb6fc75a17
commit
ccc32faaba
@ -40,6 +40,13 @@ impl std::os::windows::io::AsRawSocket for AsyncSslStream {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
impl std::os::windows::io::AsSocket for AsyncSslStream {
|
||||
fn as_socket(&self) -> std::os::windows::io::BorrowedSocket {
|
||||
self.s.get_ref().as_socket()
|
||||
}
|
||||
}
|
||||
|
||||
impl AsRawDesc for AsyncSslStream {}
|
||||
|
||||
impl std::io::Read for AsyncSslStream {
|
||||
|
@ -1,7 +1,7 @@
|
||||
use crate::{
|
||||
AsRawFileDescriptor, AsRawSocketDescriptor, Error, FileDescriptor, FromRawFileDescriptor,
|
||||
FromRawSocketDescriptor, IntoRawFileDescriptor, IntoRawSocketDescriptor, OwnedHandle, Pipe,
|
||||
Result, StdioDescriptor,
|
||||
AsRawFileDescriptor, AsRawSocketDescriptor, AsSocket, Error, FileDescriptor,
|
||||
FromRawFileDescriptor, FromRawSocketDescriptor, IntoRawFileDescriptor, IntoRawSocketDescriptor,
|
||||
OwnedHandle, Pipe, Result, StdioDescriptor,
|
||||
};
|
||||
use std::io::{self, Error as IoError};
|
||||
use std::os::windows::prelude::*;
|
||||
@ -320,6 +320,12 @@ impl AsRawSocket for FileDescriptor {
|
||||
}
|
||||
}
|
||||
|
||||
impl AsSocket for FileDescriptor {
|
||||
fn as_socket(&self) -> BorrowedSocket {
|
||||
unsafe { BorrowedSocket::borrow_raw(self.as_raw_socket()) }
|
||||
}
|
||||
}
|
||||
|
||||
impl FromRawSocket for FileDescriptor {
|
||||
unsafe fn from_raw_socket(handle: RawSocket) -> FileDescriptor {
|
||||
Self {
|
||||
|
@ -572,6 +572,13 @@ impl std::os::windows::io::AsRawSocket for SshStream {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
impl std::os::windows::io::AsSocket for SshStream {
|
||||
fn as_socket(&self) -> std::os::windows::io::BorrowedSocket {
|
||||
self.stdout.as_socket()
|
||||
}
|
||||
}
|
||||
|
||||
impl Read for SshStream {
|
||||
fn read(&mut self, buf: &mut [u8]) -> Result<usize, std::io::Error> {
|
||||
self.stdout.read(buf)
|
||||
|
@ -11,7 +11,7 @@ use smol::Async;
|
||||
#[cfg(unix)]
|
||||
pub trait AsRawDesc: std::os::unix::io::AsRawFd + std::os::fd::AsFd {}
|
||||
#[cfg(windows)]
|
||||
pub trait AsRawDesc: std::os::windows::io::AsRawSocket {}
|
||||
pub trait AsRawDesc: std::os::windows::io::AsRawSocket + std::os::windows::io::AsSocket {}
|
||||
|
||||
impl AsRawDesc for UnixStream {}
|
||||
impl AsRawDesc for AsyncSslStream {}
|
||||
|
Loading…
Reference in New Issue
Block a user