Dosu LogoDosu Logo
Ask
Join our Discord
Organization avatar
stringyPublic
EvilBit Labs LLC
Documentsstringy
architecture
architecture
Type
External
Status
Published
Created
Mar 8, 2026
Updated
Mar 8, 2026
Updated by
Dosu Bot
Source
docs/src/architecture.md

Architecture Overview#

mmap-guard is intentionally thin. The entire crate consists of four source files.

Module Structure#

Loading diagram...

lib.rs#

Crate root. Sets #![deny(clippy::undocumented_unsafe_blocks)] and re-exports the public API:

  • FileData
  • map_file
  • load, load_stdin

file_data.rs#

Defines the FileData enum — the unified type returned by all public functions. Both variants (Mapped and Loaded) deref to &[u8].

map.rs#

Contains map_file() and the single unsafe block in the crate. Performs pre-flight checks (file exists, non-empty) before creating the memory mapping.

load.rs#

Convenience layer. load() routes "-" to load_stdin(Some(1 GiB)) for stdin, and delegates all other paths to map_file(). load_stdin(max_bytes) reads stdin in bounded chunks into a heap buffer and returns FileData::Loaded; passing None removes the cap.

Dependency Graph#

Loading diagram...

The crate has two runtime dependencies (memmap2 and fs4) and one dev-dependency (tempfile).

Documents
Binary Container Parsers
Binary Section Weighting and Symbol Extraction
Project Specification and Task Documentation
Section Weighting and Symbol Extraction
Stringy Binary Analyzer Specification
Stringy Project Specification
Code Quality and Formatting Tools
contributing
Developer Tooling and Quality Configurations
Developer Tooling and Quality Configurations
Documentation and Repository Naming Conventions
Kiro Automation Hooks
Rust Code Analysis and Performance Hooks
Continuous Integration and Dependency Management
AI Agent Contribution Guidelines
CI/CD Pipeline and Release Workflow
Kiro Automation Hooks
release-process
Security Analysis with CodeQL
Security Analysis with CodeQL
Memory-Mapped File I/O Abstraction
api-reference
architecture
development
getting-started
integration
release-process
safety
testing
Project Overview
product
tech
Specification-Driven Development
Documentation and Repository Naming Consistency
Project Specification and Task Documentation
Stringy Project Specification
String Extraction and Deduplication
Binary Section Weighting and Symbol Extraction
Project Specification and Task Documentation
Section Weighting and Symbol Extraction
Stringy Binary Analyzer Specification
Stringy Project Specification
tech
Testing Infrastructure and Quality Assurance
contributing
Contributor Code of Conduct
Documentation and Repository Naming Conventions
release-process
Rust Code Analysis and Performance Hooks
Stringy Binary Analyzer Specification
Stringy Project Specification
testing
AGENTS
Architecture & Design Internals
Architecture Decision Records (ADR) Summary
CHANGELOG
CLAUDE
CODE_OF_CONDUCT
CONTRIBUTING
Contributor & AI-Agent Guidelines - Stringy
GOTCHAS
Product Overview
README
Recently Opened Issues / Near-Term Planned Work
SECURITY
SKILL
SUMMARY
SUMMARY
Strategy
THIRD_PARTY_NOTICES
api
architecture
binary-formats
classification
cli
coding-style
commit-instructions
configuration
development
hooks
installation
introduction
introduction
output-formats
patterns
performance
quickstart
ranking
security
security-assurance
string-extraction
structure
testing
troubleshooting