molar/
lib.rs

1//! Main MolAR crate.
2
3pub mod core;
4pub mod io;
5pub mod voronoi_cell;
6pub mod analysis_task;
7
8/// Most useful public imports exposed to the users
9pub mod prelude {
10    pub use crate::core::*;
11    pub use crate::io::*;
12    pub use crate::analysis_task::*;
13    pub use rayon::iter::ParallelIterator;
14}
15
16/// Prints a welcome message for MolAR with package information and the specified tool name
17/// # Example
18/// ```
19/// use molar::greeting;
20/// greeting("analysis");
21/// ```
22pub fn greeting(tool: impl AsRef<str>) {
23    use comfy_table::modifiers::UTF8_ROUND_CORNERS;
24    use comfy_table::presets::UTF8_FULL;
25    use comfy_table::{Attribute, Cell, Table};
26
27    let mut table = Table::new();
28    table
29        .load_preset(UTF8_FULL)
30        .apply_modifier(UTF8_ROUND_CORNERS)
31        .add_row(vec![
32            Cell::new("MolAR - Molecular Analysis for Rust").add_attributes(vec![Attribute::Bold])
33        ])
34        .add_row(vec![format!(
35            "{}\n{}",
36            env!("CARGO_PKG_HOMEPAGE"),
37            env!("CARGO_PKG_AUTHORS")
38        )])
39        .add_row(vec![format!("MolAR version: {}", env!("CARGO_PKG_VERSION"))])
40        .add_row(vec![format!(
41            "Tool: {}",tool.as_ref()
42        )]);
43    println!("{table}");
44}
45
46// Test code in README
47#[cfg(doctest)]
48#[doc = include_str!("../../README.md")]
49struct _ReadMe;