```
pub trait GetAdjacencyMatrix: GraphBase {
type AdjMatrix;
// Required methods
fn adjacency_matrix(&self) -> Self::AdjMatrix;
fn is_adjacent(
&self,
matrix: &Self::AdjMatrix,
a: Self::NodeId,
b: Self::NodeId
) -> bool;
}
```

## Expand description

Create or access the adjacency matrix of a graph.

The implementor can either create an adjacency matrix, or it can return a placeholder if it has the needed representation internally.

## Required Associated Types§

## Required Methods§

source#### fn adjacency_matrix(&self) -> Self::AdjMatrix

#### fn adjacency_matrix(&self) -> Self::AdjMatrix

Create the adjacency matrix

## Object Safety§

This trait is

**not**object safe.## Implementations on Foreign Types§

source§### impl<'a, G> GetAdjacencyMatrix for &'a Gwhere
G: GetAdjacencyMatrix,

### impl<'a, G> GetAdjacencyMatrix for &'a Gwhere
G: GetAdjacencyMatrix,

#### type AdjMatrix = <G as GetAdjacencyMatrix>::AdjMatrix

#### fn adjacency_matrix(&self) -> <&'a G as GetAdjacencyMatrix>::AdjMatrix

#### fn is_adjacent( &self, matrix: &<&'a G as GetAdjacencyMatrix>::AdjMatrix, a: <&'a G as GraphBase>::NodeId, b: <&'a G as GraphBase>::NodeId ) -> bool

## Implementors§

source§### impl<'a, G> GetAdjacencyMatrix for Frozen<'a, G>where
G: GetAdjacencyMatrix,

### impl<'a, G> GetAdjacencyMatrix for Frozen<'a, G>where
G: GetAdjacencyMatrix,

#### type AdjMatrix = <G as GetAdjacencyMatrix>::AdjMatrix

source§### impl<'a, N, E, Ty, Ix> GetAdjacencyMatrix for &'a Csr<N, E, Ty, Ix>

### impl<'a, N, E, Ty, Ix> GetAdjacencyMatrix for &'a Csr<N, E, Ty, Ix>

The adjacency matrix for **Csr** is a bitmap that’s computed by
`.adjacency_matrix()`

.

#### type AdjMatrix = FixedBitSet

source§### impl<E, Ix> GetAdjacencyMatrix for List<E, Ix>where
Ix: IndexType,

### impl<E, Ix> GetAdjacencyMatrix for List<E, Ix>where
Ix: IndexType,

The adjacency matrix for **List** is a bitmap that’s computed by
`.adjacency_matrix()`

.

#### type AdjMatrix = FixedBitSet

source§### impl<G> GetAdjacencyMatrix for Reversed<G>where
G: GetAdjacencyMatrix,

### impl<G> GetAdjacencyMatrix for Reversed<G>where
G: GetAdjacencyMatrix,

#### type AdjMatrix = <G as GetAdjacencyMatrix>::AdjMatrix

source§### impl<N, E, Ty> GetAdjacencyMatrix for GraphMap<N, E, Ty>

### impl<N, E, Ty> GetAdjacencyMatrix for GraphMap<N, E, Ty>

The `GraphMap`

keeps an adjacency matrix internally.

source§### impl<N, E, Ty, Ix> GetAdjacencyMatrix for StableGraph<N, E, Ty, Ix>

### impl<N, E, Ty, Ix> GetAdjacencyMatrix for StableGraph<N, E, Ty, Ix>

The adjacency matrix for **Graph** is a bitmap that’s computed by
`.adjacency_matrix()`

.

#### type AdjMatrix = FixedBitSet

source§### impl<N, E, Ty, Ix> GetAdjacencyMatrix for Graph<N, E, Ty, Ix>

### impl<N, E, Ty, Ix> GetAdjacencyMatrix for Graph<N, E, Ty, Ix>

The adjacency matrix for **Graph** is a bitmap that’s computed by
`.adjacency_matrix()`

.