Skip to main content

igraph/
lib.rs

1#![doc = include_str!("../README.md")]
2#![warn(missing_docs)]
3// The raw igraph constants (e.g. `igraph_neimode_t_IGRAPH_OUT`) are matched upon.
4#![allow(non_upper_case_globals)]
5
6/// Raw FFI bindings to the igraph C library, generated by `bindgen` at build
7/// time from the installed headers.
8///
9/// Everything here is re-exported at the crate root as well, so that
10/// `igraph::igraph_t` and `igraph::ffi::igraph_t` are the same type. The
11/// Rusty API is built *on top of these very types*: e.g. [`Graph`] is an
12/// alias of [`igraph_t`] enriched with safe methods, and owned
13/// types such as [`VectorInt`](crate::vector::VectorInt) free their memory on drop.
14#[allow(
15    non_upper_case_globals,
16    non_camel_case_types,
17    non_snake_case,
18    missing_docs,
19    dead_code,
20    unsafe_op_in_unsafe_fn,
21    clippy::all
22)]
23pub mod ffi {
24    include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
25}
26#[doc(no_inline)]
27pub use ffi::*;
28
29pub mod bitset;
30pub mod constants;
31pub mod error;
32pub mod graph;
33pub mod list;
34pub mod matrix;
35pub mod rng;
36pub mod selector;
37pub mod strvector;
38pub mod vector;
39
40pub mod adjlist;
41pub mod attributes;
42pub mod bipartite;
43pub mod centrality;
44pub mod cliques;
45pub mod cocitation;
46pub mod community;
47pub mod components;
48pub mod constructors;
49pub mod conversion;
50pub mod cycles;
51pub mod flow;
52pub mod foreign;
53pub mod games;
54pub mod isomorphism;
55pub mod layout;
56pub mod linalg;
57pub mod misc;
58pub mod mixing;
59pub mod operators;
60pub mod paths;
61pub mod structural;
62pub mod visitor;
63
64pub mod tutorial;
65
66pub use error::{Error, ErrorKind, Result};
67pub use graph::{EdgeId, Graph, VertexId};
68
69/// The most commonly used types, traits and enums: `use igraph::prelude::*;`.
70pub mod prelude {
71    pub use crate::bitset::{Bitset, BitsetList};
72    pub use crate::constants::*;
73    pub use crate::error::{Error, ErrorKind, Result};
74    pub use crate::graph::{EdgeId, Graph, VertexId};
75    pub use crate::list::{GraphList, MatrixList, VectorIntList, VectorList};
76    pub use crate::matrix::{Matrix, MatrixBool, MatrixChar, MatrixComplex, MatrixInt};
77    pub use crate::rng::{self, Rng, RngType};
78    pub use crate::selector::{EdgeSelector, VertexSelector};
79    pub use crate::strvector::StrVector;
80    pub use crate::vector::{Vector, VectorBool, VectorChar, VectorComplex, VectorInt};
81}