rgb_io/
lib.rs

1// License: see LICENSE file at root directory of `master` branch
2
3//! # RGB-IO
4//!
5//! ## Project
6//!
7//! - Repository: <https://bitbucket.org/haibison/rgb-io>
8//! - License: Nice License 1.0.0 _(see LICENSE file at root directory of `master` branch)_
9//! - _This project follows [Semantic Versioning 2.0.0]_
10//!
11//! ## Features
12//!
13//! This is a simple program, which lets you type in RGB color(s) in hexadecimal format, then prints sample color(s) to standard ouput.
14//!
15//! You can run the program with `help` command for more details.
16//!
17//! ## Building from source or installing via Cargo
18//!
19//! This crate is intended to be used as a program. So default features just contain some documentation, constants and no dependencies.
20//!
21//! `bin` feature contains a binary which uses some dependencies.
22//!
23//! ### Building from source:
24//!
25//! ```shell
26//! ~> # Clone a specific version via tag name
27//! ~> git clone --branch=x.y.z --depth=1 -- https://bitbucket.org/haibison/rgb-io rgb-io-x.y.z/
28//! ~> cd rgb-io-x.y.z/
29//! ~> cargo build --release --features=bin
30//! ```
31//!
32//! ### Installing via Cargo:
33//!
34//! ```shell
35//! ~> cargo install rgb-io --version=x.y.z --features=bin
36//! ```
37//!
38//! [Semantic Versioning 2.0.0]: https://semver.org/spec/v2.0.0.html
39
40#![warn(missing_docs)]
41#![forbid(unsafe_code)]
42
43// ╔═════════════════╗
44// ║   IDENTIFIERS   ║
45// ╚═════════════════╝
46
47macro_rules! code_name  { () => { "rgb-io" }}
48macro_rules! version    { () => { "0.2.0" }}
49
50/// # Crate name
51pub const NAME: &str = "RGB-IO";
52
53/// # Crate code name
54pub const CODE_NAME: &str = code_name!();
55
56/// # ID of this crate
57pub const ID: &str = concat!(
58    "7bc0b3e2-15657bb9-948b50f2-2e16b5f8-57035ffe-15a77504-755029d1-b86572a8-",
59    "d10b7fb4-ec1f842b-2c671d4a-ce9f0724-c6cb6197-a77a095e-7bf075cd-e5cff89f",
60);
61
62/// # Crate version
63pub const VERSION: &str = version!();
64
65/// # Crate release date (year/month/day)
66pub const RELEASE_DATE: (u16, u8, u8) = (2019, 12, 12);
67
68/// # Tag, which can be used for logging...
69pub const TAG: &str = concat!(code_name!(), "::7bc0b3e2::", version!());
70
71// ╔════════════════════╗
72// ║   IMPLEMENTATION   ║
73// ╚════════════════════╝
74
75pub mod version_info;
76
77/// # Result type used in this crate
78pub type Result<T> = core::result::Result<T, Error>;
79
80/// # Error type used in this crate
81pub type Error = std::io::Error;
82
83#[test]
84fn test_crate_version() {
85    assert_eq!(VERSION, env!("CARGO_PKG_VERSION"));
86}