Context
Related to PR #424 which demonstrates the pattern for modularisation by refactoring the connection module.
Request from: @leynos
Source: #424
Objective
Untangle layering violation where fragment_packet is under app but used by the connection actor. Move it to a non-app module and re-export from app if needed to preserve the old path.
Current situation
fragment_packet is defined in src/app/fragment_utils.rs:1
- Used by connection actor at
src/connection.rs:52 and src/connection.rs:662
- This creates a layering violation where the connection module depends on app-specific utilities
Proposed solution
- Move
fragment_packet to a non-app module (e.g., src/fragment/packet.rs)
- Re-export from
app to preserve the old public API path if needed
- Update imports in
src/connection.rs to reference the new location
Approach
Follow the pattern established in PR #424:
- Extract the functionality into a dedicated module
- Maintain public API compatibility through re-exports where appropriate
- Ensure all tests continue to pass after refactoring
Context
Related to PR #424 which demonstrates the pattern for modularisation by refactoring the connection module.
Request from: @leynos
Source: #424
Objective
Untangle layering violation where
fragment_packetis underappbut used by the connection actor. Move it to a non-appmodule and re-export fromappif needed to preserve the old path.Current situation
fragment_packetis defined insrc/app/fragment_utils.rs:1src/connection.rs:52andsrc/connection.rs:662Proposed solution
fragment_packetto a non-appmodule (e.g.,src/fragment/packet.rs)appto preserve the old public API path if neededsrc/connection.rsto reference the new locationApproach
Follow the pattern established in PR #424: