swh_graph/
lib.rs

1// Copyright (C) 2023-2024  The Software Heritage developers
2// See the AUTHORS file at the top-level directory of this distribution
3// License: GNU General Public License version 3, or any later version
4// See top-level LICENSE file for more information
5
6#![doc = include_str!("../README.md")]
7
8use thiserror::Error;
9
10pub mod _crash_course;
11pub mod _tutorial;
12
13mod swhid;
14#[cfg(feature = "macros")]
15pub use swhid::__parse_swhid;
16pub use swhid::{StrSWHIDDeserializationError, SWHID};
17
18mod swhtype;
19pub use swhtype::{ArcType, NodeConstraint, NodeType};
20
21pub mod algos;
22pub mod arc_iterators;
23pub mod collections;
24pub mod front_coded_list;
25pub mod graph;
26pub mod graph_builder;
27mod r#impl;
28mod labeling;
29pub mod labels;
30pub mod map;
31pub mod mph;
32pub mod properties;
33pub use properties::{AllSwhGraphProperties, SwhGraphProperties};
34#[cfg(feature = "serde")]
35pub mod serde;
36pub mod stats;
37mod underlying_graph;
38
39#[cfg(feature = "compression")]
40pub mod compress;
41pub mod views;
42
43pub mod approximate_bfs;
44pub mod java_compat;
45
46pub mod utils;
47
48pub use webgraph;
49
50/// Returned by a `try_` method when the given index is past the number of nodes
51/// (or number of label names for [`LabelNames`](properties::LabelNames) properties)
52#[derive(Error, Debug, PartialEq, Eq, Hash, Clone)]
53#[error("Accessed property index {index} out of {len}")]
54pub struct OutOfBoundError {
55    /// Indexed that was accessed
56    pub index: usize,
57    /// Length of the underlying collection (maximum index + 1)
58    pub len: usize,
59}
60
61/// The current version of swh-graph.
62pub const VERSION: &str = env!("CARGO_PKG_VERSION");