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
95
96
97
98
99
100
101
102
103
104
105
// License: see LICENSE file at root directory of main branch
//! # Namaste
//!
//! ## Project
//!
//! - Repository: <https://bitbucket.org/haibison/namaste-rs>
//! - License: Nice License 1.0.1 _(see LICENSE file at root directory of main branch)_
//! - _This project follows [Semantic Versioning 2.0.0]_
//!
//! ## Features
//!
//! Handling locks amongst processes.
//!
//! ## Design
//!
//! ### Identifier
//!
//! An identifier is a non-empty byte array. The array length must be smaller than `108`.
//!
//! [`Namaste`][struct:Namaste] can be used to lock an ID.
//!
//! - On Linux, it uses abstract sockets (see `unix(7)`).
//! - On other Unix systems, it uses file locks.
//!
//! ## Frequently Answered Questions
//!
//! ### Why not Unix Domain Socket?
//!
//! UDS has a good design, but its implementation has some **serious** flaws:
//!
//! - Already-bound file path _can be deleted_. Any new binding to that path will _silently take control_ of current one.
//!
//! ### Why file locks?
//!
//! Files can still be deleted even when locked. But, that's the only way that other systems support.
//!
//! [Semantic Versioning 2.0.0]: https://semver.org/spec/v2.0.0.html
//! [struct:Namaste]: struct.Namaste.html
// ╔═════════════════╗
// ║ IDENTIFIERS ║
// ╚═════════════════╝
/// # Crate name
pub const NAME: &str = "Namaste";
/// # Crate code name
pub const CODE_NAME: &str = code_name!;
/// # ID of this crate
pub const ID: &str = concat!;
/// # Crate version
pub const VERSION: &str = version!;
/// # Crate release date (year/month/day)
pub const RELEASE_DATE: = ;
/// # Tag, which can be used for logging...
pub const TAG: &str = concat!;
// ╔════════════════════╗
// ║ IMPLEMENTATION ║
// ╚════════════════════╝
/// # Wrapper for format!(), which prefixes your optional message with: crate::TAG, module_path!(), line!()
pub use crate::;
/// # Result type used in this crate
pub type Result<T> = Result;