bip_peer/
lib.rs

1#[macro_use]
2extern crate bip_bencode;
3extern crate bip_handshake;
4extern crate bip_util;
5extern crate bytes;
6extern crate byteorder;
7extern crate crossbeam;
8#[macro_use]
9extern crate error_chain;
10extern crate futures;
11extern crate tokio_core;
12extern crate tokio_io;
13extern crate tokio_timer;
14#[macro_use]
15extern crate nom;
16
17#[macro_use]
18mod macros;
19
20mod codec;
21mod manager;
22mod message;
23mod protocol;
24
25pub use codec::PeerProtocolCodec;
26pub use protocol::{PeerProtocol, NestedPeerProtocol};
27pub use manager::{ManagedMessage, PeerManager, PeerManagerSink, PeerManagerStream, IPeerManagerMessage, OPeerManagerMessage, MessageId};
28pub use manager::builder::PeerManagerBuilder;
29pub use manager::peer_info::PeerInfo;
30
31/// Serializable and deserializable protocol messages.
32pub mod messages {
33    /// Builder types for protocol messages.
34    pub mod builders {
35        pub use message::{ExtendedMessageBuilder};
36    }
37
38    pub use message::{BitFieldIter, BitFieldMessage, CancelMessage, ExtendedMessage, HaveMessage, PieceMessage, PortMessage,
39        RequestMessage, UtMetadataRequestMessage, UtMetadataDataMessage, UtMetadataRejectMessage, BitsExtensionMessage, ExtendedType,
40        NullProtocolMessage, PeerExtensionProtocolMessage, PeerWireProtocolMessage, UtMetadataMessage};
41}
42
43/// `PeerManager` error types.
44pub mod error {
45    pub use manager::error::{PeerManagerError, PeerManagerErrorKind, PeerManagerResultExt, PeerManagerResult};
46}
47
48/// Implementations of `PeerProtocol`.
49pub mod protocols {
50    pub use protocol::unit::UnitProtocol;
51    pub use protocol::null::NullProtocol;
52    pub use protocol::wire::PeerWireProtocol;
53    pub use protocol::extension::PeerExtensionProtocol;
54}