Vendor asic-rs 0.8.1 (280 crates, offline builds) + wxWidgets 3.3.3 (pristine + patch queue); UI spec + ADR-0003; M1 on asic-rs
This commit is contained in:
Vendored
+105
@@ -0,0 +1,105 @@
|
||||
macro_rules! os_required {
|
||||
() => {
|
||||
panic!("mio must be compiled with `os-poll` to run.")
|
||||
};
|
||||
}
|
||||
|
||||
mod selector;
|
||||
pub(crate) use self::selector::{event, Event, Events, Selector};
|
||||
|
||||
#[cfg(not(any(target_os = "wasi", target_os = "horizon")))]
|
||||
mod waker;
|
||||
#[cfg(not(any(target_os = "wasi", target_os = "horizon")))]
|
||||
pub(crate) use self::waker::Waker;
|
||||
|
||||
cfg_net! {
|
||||
pub(crate) mod tcp;
|
||||
pub(crate) mod udp;
|
||||
#[cfg(unix)]
|
||||
pub(crate) mod uds;
|
||||
}
|
||||
|
||||
cfg_io_source! {
|
||||
use std::io;
|
||||
#[cfg(any(unix))]
|
||||
use std::os::fd::RawFd;
|
||||
// TODO: once <https://github.com/rust-lang/rust/issues/126198> is fixed this
|
||||
// can use `std::os::fd` and be merged with the above.
|
||||
#[cfg(target_os = "hermit")]
|
||||
use std::os::hermit::io::RawFd;
|
||||
#[cfg(windows)]
|
||||
use std::os::windows::io::RawSocket;
|
||||
|
||||
#[cfg(any(windows, unix, target_os = "hermit"))]
|
||||
use crate::{Registry, Token, Interest};
|
||||
|
||||
pub(crate) struct IoSourceState;
|
||||
|
||||
impl IoSourceState {
|
||||
pub fn new() -> IoSourceState {
|
||||
IoSourceState
|
||||
}
|
||||
|
||||
pub fn do_io<T, F, R>(&self, f: F, io: &T) -> io::Result<R>
|
||||
where
|
||||
F: FnOnce(&T) -> io::Result<R>,
|
||||
{
|
||||
// We don't hold state, so we can just call the function and
|
||||
// return.
|
||||
f(io)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(unix, target_os = "hermit"))]
|
||||
impl IoSourceState {
|
||||
pub fn register(
|
||||
&mut self,
|
||||
_: &Registry,
|
||||
_: Token,
|
||||
_: Interest,
|
||||
_: RawFd,
|
||||
) -> io::Result<()> {
|
||||
os_required!()
|
||||
}
|
||||
|
||||
pub fn reregister(
|
||||
&mut self,
|
||||
_: &Registry,
|
||||
_: Token,
|
||||
_: Interest,
|
||||
_: RawFd,
|
||||
) -> io::Result<()> {
|
||||
os_required!()
|
||||
}
|
||||
|
||||
pub fn deregister(&mut self, _: &Registry, _: RawFd) -> io::Result<()> {
|
||||
os_required!()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
impl IoSourceState {
|
||||
pub fn register(
|
||||
&mut self,
|
||||
_: &Registry,
|
||||
_: Token,
|
||||
_: Interest,
|
||||
_: RawSocket,
|
||||
) -> io::Result<()> {
|
||||
os_required!()
|
||||
}
|
||||
|
||||
pub fn reregister(
|
||||
&mut self,
|
||||
_: &Registry,
|
||||
_: Token,
|
||||
_: Interest,
|
||||
) -> io::Result<()> {
|
||||
os_required!()
|
||||
}
|
||||
|
||||
pub fn deregister(&mut self) -> io::Result<()> {
|
||||
os_required!()
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+129
@@ -0,0 +1,129 @@
|
||||
use std::io;
|
||||
#[cfg(unix)]
|
||||
use std::os::fd::{AsFd, AsRawFd, BorrowedFd, RawFd};
|
||||
use std::time::Duration;
|
||||
|
||||
pub type Event = usize;
|
||||
|
||||
pub type Events = Vec<Event>;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Selector {}
|
||||
|
||||
impl Selector {
|
||||
pub fn try_clone(&self) -> io::Result<Selector> {
|
||||
os_required!();
|
||||
}
|
||||
|
||||
pub fn select(&self, _: &mut Events, _: Option<Duration>) -> io::Result<()> {
|
||||
os_required!();
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
cfg_os_ext! {
|
||||
use crate::{Interest, Token};
|
||||
|
||||
impl Selector {
|
||||
pub fn register(&self, _: RawFd, _: Token, _: Interest) -> io::Result<()> {
|
||||
os_required!();
|
||||
}
|
||||
|
||||
pub fn reregister(&self, _: RawFd, _: Token, _: Interest) -> io::Result<()> {
|
||||
os_required!();
|
||||
}
|
||||
|
||||
pub fn deregister(&self, _: RawFd) -> io::Result<()> {
|
||||
os_required!();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(target_os = "wasi")]
|
||||
cfg_any_os_ext! {
|
||||
use crate::{Interest, Token};
|
||||
|
||||
impl Selector {
|
||||
pub fn register(&self, _: wasi::Fd, _: Token, _: Interest) -> io::Result<()> {
|
||||
os_required!();
|
||||
}
|
||||
|
||||
pub fn reregister(&self, _: wasi::Fd, _: Token, _: Interest) -> io::Result<()> {
|
||||
os_required!();
|
||||
}
|
||||
|
||||
pub fn deregister(&self, _: wasi::Fd) -> io::Result<()> {
|
||||
os_required!();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cfg_io_source! {
|
||||
#[cfg(debug_assertions)]
|
||||
impl Selector {
|
||||
pub fn id(&self) -> usize {
|
||||
os_required!();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
impl AsFd for Selector {
|
||||
fn as_fd(&self) -> BorrowedFd<'_> {
|
||||
os_required!()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
impl AsRawFd for Selector {
|
||||
fn as_raw_fd(&self) -> RawFd {
|
||||
os_required!()
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::trivially_copy_pass_by_ref)]
|
||||
pub mod event {
|
||||
use crate::sys::Event;
|
||||
use crate::Token;
|
||||
use std::fmt;
|
||||
|
||||
pub fn token(_: &Event) -> Token {
|
||||
os_required!();
|
||||
}
|
||||
|
||||
pub fn is_readable(_: &Event) -> bool {
|
||||
os_required!();
|
||||
}
|
||||
|
||||
pub fn is_writable(_: &Event) -> bool {
|
||||
os_required!();
|
||||
}
|
||||
|
||||
pub fn is_error(_: &Event) -> bool {
|
||||
os_required!();
|
||||
}
|
||||
|
||||
pub fn is_read_closed(_: &Event) -> bool {
|
||||
os_required!();
|
||||
}
|
||||
|
||||
pub fn is_write_closed(_: &Event) -> bool {
|
||||
os_required!();
|
||||
}
|
||||
|
||||
pub fn is_priority(_: &Event) -> bool {
|
||||
os_required!();
|
||||
}
|
||||
|
||||
pub fn is_aio(_: &Event) -> bool {
|
||||
os_required!();
|
||||
}
|
||||
|
||||
pub fn is_lio(_: &Event) -> bool {
|
||||
os_required!();
|
||||
}
|
||||
|
||||
pub fn debug_details(_: &mut fmt::Formatter<'_>, _: &Event) -> fmt::Result {
|
||||
os_required!();
|
||||
}
|
||||
}
|
||||
Vendored
+31
@@ -0,0 +1,31 @@
|
||||
use std::io;
|
||||
use std::net::{self, SocketAddr};
|
||||
|
||||
#[cfg(not(target_os = "wasi"))]
|
||||
pub(crate) fn new_for_addr(_: SocketAddr) -> io::Result<i32> {
|
||||
os_required!();
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "wasi"))]
|
||||
pub(crate) fn bind(_: &net::TcpListener, _: SocketAddr) -> io::Result<()> {
|
||||
os_required!();
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "wasi"))]
|
||||
pub(crate) fn connect(_: &net::TcpStream, _: SocketAddr) -> io::Result<()> {
|
||||
os_required!();
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "wasi"))]
|
||||
pub(crate) fn listen(_: &net::TcpListener, _: i32) -> io::Result<()> {
|
||||
os_required!();
|
||||
}
|
||||
|
||||
#[cfg(any(unix, target_os = "hermit"))]
|
||||
pub(crate) fn set_reuseaddr(_: &net::TcpListener, _: bool) -> io::Result<()> {
|
||||
os_required!();
|
||||
}
|
||||
|
||||
pub(crate) fn accept(_: &net::TcpListener) -> io::Result<(net::TcpStream, SocketAddr)> {
|
||||
os_required!();
|
||||
}
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
#![cfg(not(target_os = "wasi"))]
|
||||
use std::io;
|
||||
use std::net::{self, SocketAddr};
|
||||
|
||||
pub fn bind(_: SocketAddr) -> io::Result<net::UdpSocket> {
|
||||
os_required!()
|
||||
}
|
||||
|
||||
pub(crate) fn only_v6(_: &net::UdpSocket) -> io::Result<bool> {
|
||||
os_required!()
|
||||
}
|
||||
Vendored
+44
@@ -0,0 +1,44 @@
|
||||
pub(crate) mod datagram {
|
||||
use std::io;
|
||||
use std::os::unix::net::{self, SocketAddr};
|
||||
|
||||
pub(crate) fn bind_addr(_: &SocketAddr) -> io::Result<net::UnixDatagram> {
|
||||
os_required!()
|
||||
}
|
||||
|
||||
pub(crate) fn unbound() -> io::Result<net::UnixDatagram> {
|
||||
os_required!()
|
||||
}
|
||||
|
||||
pub(crate) fn pair() -> io::Result<(net::UnixDatagram, net::UnixDatagram)> {
|
||||
os_required!()
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) mod listener {
|
||||
use std::io;
|
||||
use std::os::unix::net::{self, SocketAddr};
|
||||
|
||||
use crate::net::UnixStream;
|
||||
|
||||
pub(crate) fn bind_addr(_: &SocketAddr) -> io::Result<net::UnixListener> {
|
||||
os_required!()
|
||||
}
|
||||
|
||||
pub(crate) fn accept(_: &net::UnixListener) -> io::Result<(UnixStream, SocketAddr)> {
|
||||
os_required!()
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) mod stream {
|
||||
use std::io;
|
||||
use std::os::unix::net::{self, SocketAddr};
|
||||
|
||||
pub(crate) fn connect_addr(_: &SocketAddr) -> io::Result<net::UnixStream> {
|
||||
os_required!()
|
||||
}
|
||||
|
||||
pub(crate) fn pair() -> io::Result<(net::UnixStream, net::UnixStream)> {
|
||||
os_required!()
|
||||
}
|
||||
}
|
||||
Vendored
+16
@@ -0,0 +1,16 @@
|
||||
use crate::sys::Selector;
|
||||
use crate::Token;
|
||||
use std::io;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Waker {}
|
||||
|
||||
impl Waker {
|
||||
pub fn new(_: &Selector, _: Token) -> io::Result<Waker> {
|
||||
os_required!();
|
||||
}
|
||||
|
||||
pub fn wake(&self) -> io::Result<()> {
|
||||
os_required!();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user