axum_gate/permissions/
permission_collision.rs

1/// A group of permission strings that share the same 64‑bit deterministic hash.
2///
3/// This can represent:
4/// - Pure duplicates (all strings identical)
5/// - A *true* collision (different strings hashing to the same 64‑bit value; extremely rare)
6///
7/// Use logic like:
8/// ```rust
9/// # use axum_gate::permissions::ValidationReport;
10/// # fn analyze(report: &ValidationReport) {
11/// for group in &report.collisions {
12///     let all_equal = group.permissions.windows(2).all(|w| w[0] == w[1]);
13///     if all_equal {
14///         // handle duplicate
15///     } else {
16///         // handle distinct collision (critical)
17///     }
18/// }
19/// # }
20/// ```
21#[derive(Debug, Clone)]
22pub struct PermissionCollision {
23    /// The hash ID that has multiple permissions mapping to it (64-bit).
24    pub id: u64,
25    /// List of permission strings that all hash to the same value.
26    pub permissions: Vec<String>,
27}