• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2023 Huawei Device Co., Ltd.
2 // Licensed under the Apache License, Version 2.0 (the "License");
3 // you may not use this file except in compliance with the License.
4 // You may obtain a copy of the License at
5 //
6 //     http://www.apache.org/licenses/LICENSE-2.0
7 //
8 // Unless required by applicable law or agreed to in writing, software
9 // distributed under the License is distributed on an "AS IS" BASIS,
10 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 // See the License for the specific language governing permissions and
12 // limitations under the License.
13 
14 //! Event-driven nonblocking net-io components.
15 
16 mod poll;
17 pub use poll::Poll;
18 
19 mod token;
20 pub use token::Token;
21 
22 pub mod sys;
23 #[cfg(feature = "udp")]
24 pub use sys::{ConnectedUdpSocket, UdpSocket};
25 pub use sys::{Event, EventTrait, Events, Selector};
26 #[cfg(target_os = "linux")]
27 pub use sys::{SocketAddr, UnixDatagram, UnixListener, UnixStream};
28 #[cfg(feature = "tcp")]
29 pub use sys::{TcpListener, TcpStream};
30 
31 mod interest;
32 pub use interest::Interest;
33 
34 mod source;
35 pub use source::Source;
36 
37 mod waker;
38 pub use waker::Waker;
39 
40 #[cfg(not(any(feature = "tcp", feature = "udp")))]
41 std::compile_error!("tcp and udp feature must be enabled one of them for this crate.");
42