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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// TODO: #![warn(missing_docs)]
#[macro_use]
pub extern crate log;
extern crate tokio;
pub extern crate dvm_api as api;
pub use api::tonic;

pub type StdError = Box<dyn std::error::Error + Send + Sync>;

pub mod endpoint;
pub mod serve;

#[cfg(unix)]
mod unix;

pub mod transport {
    #[cfg(unix)]
    pub use super::unix::*;

    #[cfg(target_os = "windows")]
    compile_error!("windows platform is not supported");
}

pub mod prelude {
    //! The DVM-NET Prelude
    //!
    //! The purpose of this module is to give imports-set for many common cases
    //! by adding a glob import to the top:
    //!
    //! ```
    //! # #![allow(unused_imports)]
    //! use dvm_net::prelude::*;
    //! ```
    //!
    //! Also contains reshared `TryInto` and `TryFrom` std traits.

    pub use crate::serve::*;
    pub use crate::endpoint::*;
    pub use crate::transport::*;

    pub use std::convert::{TryInto, TryFrom};
}