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;
37pub mod stdlib;
38mod underlying_graph;
39
40#[cfg(feature = "compression")]
41pub mod compress;
42pub mod views;
43
44pub mod approximate_bfs;
45pub mod java_compat;
46
47pub mod utils;
48
49pub use webgraph;
50
51/// Returned by a `try_` method when the given index is past the number of nodes
52/// (or number of label names for [`LabelNames`](properties::LabelNames) properties)
53#[derive(Error, Debug, PartialEq, Eq, Hash, Clone)]
54#[error("Accessed property index {index} out of {len}")]
55pub struct OutOfBoundError {
56    /// Indexed that was accessed
57    pub index: usize,
58    /// Length of the underlying collection (maximum index + 1)
59    pub len: usize,
60}
61
62/// The current version of swh-graph.
63pub const VERSION: &str = env!("CARGO_PKG_VERSION");