protosocket/
lib.rs

1//! Low-level connection types for protosocket.
2//!
3//! This is the core of protosocket, providing the `Connection`
4//! type. This type is used to create both client and server
5//! channels.
6//! Normally you will use `Connection` via the protosocket-prost
7//! or protosocket-server crates.
8
9mod connection;
10mod serde;
11mod types;
12
13pub use connection::Connection;
14pub use types::ConnectionBindings;
15pub use types::DeserializeError;
16pub use types::Deserializer;
17pub use types::MessageReactor;
18pub use types::ReactorStatus;
19pub use types::Serializer;
20
21pub(crate) fn interrupted(err: &std::io::Error) -> bool {
22    err.kind() == std::io::ErrorKind::Interrupted
23}
24
25pub(crate) fn would_block(err: &std::io::Error) -> bool {
26    err.kind() == std::io::ErrorKind::WouldBlock
27}