Files
fips/src/tree/mod.rs
T
Johnathan Corgan b8a1f322c2 Module reorganization and clippy cleanup
Move single-consumer modules into node/:
- rate_limit.rs, wire.rs, dns.rs — exclusively used by node subsystem
- Reduces top-level lib.rs from 16 to 13 modules

Split large files into focused subdirectories:
- noise.rs (1475 lines) → noise/{mod, handshake, session, replay, tests}.rs
- tree.rs (1479 lines) → tree/{mod, coordinate, declaration, state, tests}.rs
- bloom.rs (849 lines) → bloom/{mod, filter, state, tests}.rs
- All public APIs re-exported from mod.rs, no external import changes

Remove unused rate_limit defaults:
- HANDSHAKE_TIMEOUT_SECS, MAX_PENDING_INBOUND constants
- Default constructor eliminated in favor of with_params() taking config values

Fix all clippy warnings across codebase:
- Remove .clone() on Copy types, collapse nested ifs, replace match-return-None
  with ?, remove/gate unused code, fix loop indexing, remove unnecessary casts
- Box large PeerSlot enum variants to reduce size disparity
- cargo clippy --all-targets now reports zero warnings
2026-02-15 15:07:42 +00:00

43 lines
1.1 KiB
Rust

//! Spanning Tree Protocol Entities
//!
//! Tree coordinates and parent declarations for the FIPS spanning tree.
//! The spanning tree provides a routing topology where each node maintains
//! a path to a common root, enabling greedy distance-based routing.
mod coordinate;
mod declaration;
mod state;
use thiserror::Error;
use crate::{IdentityError, NodeAddr};
pub use coordinate::{CoordEntry, TreeCoordinate};
pub use declaration::ParentDeclaration;
pub use state::TreeState;
/// Errors related to spanning tree operations.
#[derive(Debug, Error)]
pub enum TreeError {
#[error("invalid tree coordinate: empty path")]
EmptyCoordinate,
#[error("invalid ancestry: does not reach claimed root")]
AncestryNotToRoot,
#[error("signature verification failed for node {0:?}")]
InvalidSignature(NodeAddr),
#[error("sequence number regression: got {got}, expected > {expected}")]
SequenceRegression { got: u64, expected: u64 },
#[error("parent not in peers: {0:?}")]
ParentNotPeer(NodeAddr),
#[error("identity error: {0}")]
Identity(#[from] IdentityError),
}
#[cfg(test)]
mod tests;