1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
* SPDX-FileCopyrightText: 2023 Inria
* SPDX-FileCopyrightText: 2023 Sebastiano Vigna
*
* SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
*/
//! Traits used throughout the crate.
/**
A support trait that makes it possible to treat a pair (2-tuple) as a trait.
This approach (“traitification”) was suggested by
[David Henry Mantilla](https://github.com/danielhenrymantilla/lending-iterator.rs/issues/13#issuecomment-1735475634)
as a solution to the problem of specifying that a [`Lender`](lender::Lender)
should return pairs of nodes and successors, and to impose conditions on the two components
of the pairs. This is not possible directly, as a pair is a type, not a trait.
For example, [when implementing projections](crate::labels::proj) one needs
to specify that the label of a labeling is a pair, and in the case a
component is `usize`, the associated projection can be seen as a graph.
To specify these constraints we have to resort to traitification using
the [`Pair`] trait.
The user should rarely, if ever, interact with this trait. Iterating over an iterator whose output
has been traitified using [`Pair`] is a bit cumbersome, as the output of the iterator is a [`Pair`]
and must be turned into a pair using the [`into_pair`](Pair::into_pair) method.
*/
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;