issue_states/lib.rs
1// Issue states
2//
3// Copyright (c) 2018 Julian Ganz
4//
5// MIT License
6//
7// Permission is hereby granted, free of charge, to any person obtaining a copy
8// of this software and associated documentation files (the "Software"), to deal
9// in the Software without restriction, including without limitation the rights
10// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11// copies of the Software, and to permit persons to whom the Software is
12// furnished to do so, subject to the following conditions:
13//
14// The above copyright notice and this permission notice shall be included in all
15// copies or substantial portions of the Software.
16//
17// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23// SOFTWARE.
24//
25
26//! # Issue states
27//!
28//! This library serves as a reference implementation for the concept of
29//! "issue states": issues in an issue tracker are assigned an `IssueState`
30//! each, based on `Condition`s associated with each state. The conditions
31//! represent predicates on issues or their metadata.
32//!
33//! Users of this library will implement the trait `Condition`, which links
34//! the user's issue-type (or, for example, a type representing an issue's
35//! metadata) to the `IssueState`s provided by this library.
36//!
37//! Given some issue-states, an `IssueStateSet` may be constructed. This type
38//! allows resolving a given issue's state, honouring relations between the
39//! states contained in the set.
40//!
41//! `IssueState`s, and an `IssueStateSet`, may be constructed by the library's
42//! user manually. However, this library also provides means for parsing an
43//! `IssueStateSet` directly from a byte-stream. Currently, only the YAML format
44//! is supported (if this library is compiled with support for `yaml-rust`
45//! enabled).
46//!
47
48#[cfg(feature = "yaml-rust")]
49extern crate yaml_rust;
50
51pub mod condition;
52pub mod error;
53pub mod resolution;
54pub mod state;
55
56mod iter;
57
58#[cfg(feature = "yaml-rust")]
59pub mod yaml;
60
61#[cfg(test)]
62mod test;
63
64// convenience exports
65pub use error::Result;
66pub use resolution::IssueStateSet;
67pub use condition::Condition;
68pub use state::IssueState;
69