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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
//! Shkeleton is a skeleton Rust project which defines some default dependencies and contains some
//! common API's.
//! The idea behind Shkeleton is that you don't need to update all the dependencies by hand for
//! every your library or binary, you could just update Shkeleton version and get all updates.
//! ## Dependencies
//! * log - logging facade
//! * byteorder - dealing with data reading/writing
//! * lazy_static - macro to define a lazy static constants
//! * array_tool - utilities for dealing with arrays
//! * itertools - utilities for dealing with iterators
//! * regex - regular expressions
//! * url - handling URLs
//! * derive_more & derive_deref - more derive implementations
//! * failure - error handling
//!
//! ## Features
//! Shkeleton also defines a few features which extend the dependencies list and APIs.
//!
//! ### CLI feature
//! Additional dependencies:
//! * clap - define your command line arguments parser
//! * fern - complex logger implementation
//! * glob - dealing with glob patterns
//!
//! ### Concurrency feature
//! Additional dependencies:
//! * scoped-pool - define and use a thread pool
//! * num_cpus - get the number of CPUs and cores available
//! * parking_lot - faster syncronization primitives
//! Concurrency feature also defines a facade for RwLock, which allowes to hide an implementation
//! (std::sync::RwLock or parking_lot::RwLock) behind this facade and switch implementation without
//! the need to update sources. It could be valuable because the parking_lot implementation
//! lacks "lock poisoning" and maybe harder to debug deadlocks.
//!
//! ### Limitations
//! Due to current Rust macro system limitations in order to use derive macros from the derive_deref
//! or derive_more crates you need to import them manually:
//!
//! ```ignore
//! #[macro_use]
//! extern crate derive_more;
//! #[macro_use]
//! extern crate derive_deref;
//! ```
//!

macro_rules! reexport_crate {
    ($crate_name:ident) => {
        #[cfg_attr(feature = "cargo-clippy", allow(useless_attribute))]
        #[macro_use]
        #[allow(unused_imports)]
        pub extern crate $crate_name;
        #[doc(hidden)]
        pub use self::$crate_name::*;
    }
}

mod shkeleton;

reexport_crate!(lazy_static);
reexport_crate!(log);
reexport_crate!(failure);
#[doc(hidden)]
pub extern crate byteorder;
#[doc(hidden)]
pub extern crate itertools;
#[doc(hidden)]
pub extern crate array_tool;
#[doc(hidden)]
pub extern crate regex;
#[doc(hidden)]
pub extern crate url;

#[cfg(feature = "cli")]
#[doc(hidden)]
pub extern crate clap;
#[cfg(feature = "cli")]
#[doc(hidden)]
pub extern crate fern;
#[cfg(feature = "cli")]
#[doc(hidden)]
pub extern crate glob;

#[cfg(feature = "concurrency")]
#[doc(hidden)]
pub extern crate num_cpus;
#[cfg(feature = "concurrency")]
#[doc(hidden)]
pub extern crate parking_lot;
#[cfg(feature = "concurrency")]
#[doc(hidden)]
pub extern crate scoped_pool;

pub use shkeleton::sync;