rshyper_hmap/lib.rs
1/*
2 appellation: rshyper-hmap <library>
3 authors: @FL03
4*/
5//! # rshyper-hmap
6//!
7//! [](https://crates.io/crates/rshyper)
8//! [](https://docs.rs/rshyper)
9//! [](https://github.com/FL03/rshyper/blob/main/LICENSE)
10//!
11//! ***
12//!
13//! Welcome to the `rshyper-hmap` crate! This package provides the [`HyperMap`] implementation,
14//! a map-based hypergraph structure designed for efficient storage and manipulation using the
15//! native [`HashMap`](std::collections::HashMap) type.
16//!
17//! - `N`: the type of weight associated with a hypernode
18//! - `E`: the type of weight associated with a hyperedge
19//! - `A`: the attributes of the hypergraph
20//! - `A::Kind`: the _kind_ of hypergraph, either [`Directed`](rshyper_core::Directed) or [`Undirected`](rshyper_core::Undirected)
21//! - `A::Ix`: the type of index used by components within the graph
22//! - `S`: the type of [`BuildHasher`](core::hash::BuildHasher) used for the underling stores
23//!
24//! ## Features
25//!
26//! The crate is heavily feature-gated to maximize compatibility and minimize dependencies,
27//! listed below are some of the most important / impactful features:
28//!
29//! - `rayon`: enables parallel processing capabilities using the `rayon` crate
30//! - `serde`: enables serialization and deserialization of hypergraphs using the `serde` crate
31//!
32//! ## Examples
33//!
34//! For more detailed examples, please refer to the [examples directory](https://github.com/FL03/rshyper/blob/main/rshyper/examples).
35//!
36#![crate_type = "lib"]
37#![doc(
38 html_logo_url = "https://raw.githubusercontent.com/FL03/rshyper/main/.artifacts/assets/logo.svg",
39 html_favicon_url = "https://raw.githubusercontent.com/FL03/rshyper/main/.artifacts/assets/logo.svg"
40)]
41#![allow(clippy::should_implement_trait, clippy::module_inception)]
42// **** WARNING ****
43// the `std` feature is required by the crate, only declared for concistency w.r.t. the
44// available features and for ensuring that all the depencies actually implement the `std`
45// feature since the workspace naturally imports them with the `default-features = false`
46// flag toggled
47// **** WARNING ****
48#![cfg(feature = "std")]
49/// declare the macros module for use throughout the crate
50#[macro_use]
51pub(crate) mod macros {
52 #[macro_use]
53 pub mod seal;
54}
55#[cfg(feature = "algo")]
56extern crate rshyper_algo as algo;
57extern crate rshyper_core as rshyper;
58
59#[doc(inline)]
60pub use self::{graph::*, types::prelude::*};
61
62pub mod graph;
63
64mod impls {
65 #[cfg(feature = "algo")]
66 pub mod impl_algo;
67 pub mod impl_graph;
68 pub mod impl_hyper_graph;
69 pub mod impl_iter;
70 pub mod impl_ops;
71 pub mod impl_repr;
72 #[cfg(feature = "serde")]
73 pub mod impl_serde;
74}
75
76pub mod iter {
77 //! this module implements the iterators for the [`HyperMap`](super::HashGraph)
78 #[doc(inline)]
79 pub use self::prelude::*;
80
81 pub mod edges;
82 pub mod nodes;
83
84 pub(crate) mod prelude {
85 #[doc(inline)]
86 pub use super::edges::*;
87 #[doc(inline)]
88 pub use super::nodes::*;
89 }
90}
91
92pub mod types {
93 //! this module defines various types and type aliases in support of the [`HyperMap`](super::HyperMap)
94 //! implementation
95 #[doc(inline)]
96 pub use self::prelude::*;
97
98 mod aliases;
99
100 pub(crate) mod prelude {
101 #[doc(inline)]
102 pub use super::aliases::*;
103 }
104}
105
106#[doc(hidden)]
107#[allow(missing_docs)]
108pub mod prelude {
109 #[doc(inline)]
110 pub use super::graph::*;
111 #[doc(inline)]
112 pub use super::iter::prelude::*;
113 #[doc(inline)]
114 pub use super::types::prelude::*;
115
116 #[allow(deprecated)]
117 #[deprecated(since = "0.1.3", note = "use `HyperMap` instead")]
118 pub use super::{DiHashGraph, HashGraph, UnHashGraph};
119}