2018-11-21 17:11:31 -08:00
|
|
|
#![doc(html_root_url = "https://docs.rs/tokio-tcp/0.1.3")]
|
2019-05-14 10:27:36 -07:00
|
|
|
#![deny(missing_docs, missing_debug_implementations, rust_2018_idioms)]
|
|
|
|
|
#![cfg_attr(test, deny(warnings))]
|
|
|
|
|
#![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))]
|
2018-08-24 08:58:26 -07:00
|
|
|
|
2018-03-15 03:38:59 +11:00
|
|
|
//! UDP bindings for `tokio`.
|
|
|
|
|
//!
|
|
|
|
|
//! This module contains the UDP networking types, similar to the standard
|
|
|
|
|
//! library, which can be used to implement networking protocols.
|
|
|
|
|
//!
|
|
|
|
|
//! The main struct for UDP is the [`UdpSocket`], which represents a UDP socket.
|
|
|
|
|
//! Reading and writing to it can be done using futures, which return the
|
2019-06-27 02:41:36 +08:00
|
|
|
//! [`Recv`], [`Send`], [`RecvFrom`] and [`SendTo`] structs respectively.
|
2018-03-15 03:38:59 +11:00
|
|
|
|
2019-06-27 02:41:36 +08:00
|
|
|
macro_rules! ready {
|
|
|
|
|
($e:expr) => {
|
|
|
|
|
match $e {
|
|
|
|
|
::std::task::Poll::Ready(t) => t,
|
|
|
|
|
::std::task::Poll::Pending => return ::std::task::Poll::Pending,
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// mod frame;
|
|
|
|
|
mod recv;
|
|
|
|
|
mod recv_from;
|
|
|
|
|
mod send;
|
|
|
|
|
mod send_to;
|
2019-02-21 11:56:15 -08:00
|
|
|
mod socket;
|
2019-07-09 05:47:31 +08:00
|
|
|
pub mod split;
|
2018-03-15 03:38:59 +11:00
|
|
|
|
2019-06-27 02:41:36 +08:00
|
|
|
// pub use self::frame::UdpFramed;
|
|
|
|
|
pub use self::recv::Recv;
|
|
|
|
|
pub use self::recv_from::RecvFrom;
|
|
|
|
|
pub use self::send::Send;
|
|
|
|
|
pub use self::send_to::SendTo;
|
|
|
|
|
|
2019-02-21 11:56:15 -08:00
|
|
|
pub use self::socket::UdpSocket;
|