Project Structure
This page is a map of the repository.
Top-level files
pyproject.toml: Python package metadata andmaturinbuild configurationCargo.toml: Rust crate metadata and dependenciesREADME.md: main repository overviewbuild.rs: Rust build-time scriptjustfile: useful development commands if you usejustuv.lock: locked Python dependency data foruv
Python package
Path: python/rsloop/
This is the Python-facing side of the project.
__init__.py: public exports_run.py: friendly helpers for starting the loop_loop_compat.py: behavior that makesrsloopfit intoasyncio_bootstrap.py: import-time environment setup_profile.py: profiler helpers
Think of this directory as the "Python wrapper layer".
Rust extension
Path: src/
This is the engine room of the project.
lib.rs: registers the Python extension modulebindings/: PyO3 event-loop bindings and Python compatibility helpersengine/: loop state, shared commands, callbacks, and runtime dispatchtransport/stream/: stream transports, servers, fast streams, and I/O workerstransport/process/: subprocess lifecycle and pipe transportstransport/tls/: TLS configuration and certificate loadingplatform/: Unix/Windows descriptor and runtime integrationrust_async.rs: the public Rust/Python async interop API
If you want to understand behavior changes, this directory is usually where the real implementation lives.
Examples
Path: examples/
This directory shows the supported feature areas in runnable form.
- basics
- sockets
- streams
- Unix sockets
- accepted sockets
- pipes
- signals
- subprocesses
- a FastAPI service for comparing stdlib
asyncio,uvloop, andrsloop - WebSocket examples
- a separate PyO3 extension that exposes Rust futures as Python awaitables
Examples are a good first stop before reading tests.
Tests
Path: tests/
The tests tell you what behavior the project promises today.
test_run.py: basic lifecycle and common operationstest_compat.py:asynciocompatibility behaviorstest_tls.py: TLS-related behaviortest_public_api.py: static type checks for the exported Python APIpackages/: smoke tests against supported frameworks and ASGI servers
When you are unsure whether a feature is expected to work, check the tests.
Benchmarks
Path: benchmarks/
This directory contains performance comparison tools.
It compares:
- stdlib
asyncio uvlooprsloop
Use this directory when you want numbers, not just correctness.
Scripts
Path: scripts/
These are support scripts for maintainers:
- building wheels
- testing supported Python versions
- generating TLS test certificates
- listing Python versions used by the build scripts
You usually do not need these for normal package usage, but they matter for release and CI work.