protosocket/
lib.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//! Low-level connection types for protosocket.
//!
//! This is the core of protosocket, providing the `Connection`
//! type. This type is used to create both client and server
//! channels.
//! Normally you will use `Connection` via the protosocket-prost
//! or protosocket-server crates.

mod connection;
mod types;

pub use connection::Connection;
pub use types::ConnectionBindings;
pub use types::DeserializeError;
pub use types::Deserializer;
pub use types::MessageReactor;
pub use types::ReactorStatus;
pub use types::Serializer;

pub(crate) fn interrupted(err: &std::io::Error) -> bool {
    err.kind() == std::io::ErrorKind::Interrupted
}

pub(crate) fn would_block(err: &std::io::Error) -> bool {
    err.kind() == std::io::ErrorKind::WouldBlock
}