Expand description
§WTX
WTX is a human-written collection of different transport implementations and related tools focused primarily on web technologies. Features the in-house development of +10 IETF RFCs along side other elements.
Works on embedded devices with heap allocators. If you find this crate interesting, please consider giving it a star ⭐ on GitHub.
| Specification | URL |
|---|---|
gRPC | https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md |
HTTP/2 | https://datatracker.ietf.org/doc/html/rfc9113 |
PostgreSQL | https://www.postgresql.org/docs/current/protocol.html |
TLS 1.3 | https://datatracker.ietf.org/doc/html/rfc9846 |
WebSocket | https://datatracker.ietf.org/doc/html/rfc6455 |
WebSocket Compression | https://datatracker.ietf.org/doc/html/rfc7692 |
WebSocket Over HTTP/2 | https://datatracker.ietf.org/doc/html/rfc8441 |
X.509 | https://datatracker.ietf.org/doc/html/rfc5280 |
§High-level benchmarks
Checkout wtx-bench or HttpArena and feel free to indicate possible misunderstandings.
§Low-level benchmarks
Anything marked with #[bench] in the repository is considered a low-level benchmark in the sense that they measure very specific operations that generally serve as the basis for other parts.
Take a look at https://bencher.dev/perf/wtx to see all low-level benchmarks over different periods of time.
§Development benchmarks
These numbers provide an estimate of the expected waiting times when developing with WTX. If desired, you can compare them with other similar Rust projects through the dev-bench.sh script.
| Technology | Required Deps 1 | All Deps 2 | Clean Check | Clean Debug Build | Clean Opt Build | Opt size |
|---|---|---|---|---|---|---|
| gRPC Client | 2 | 16 | 4.80s | 6.04s | 6.53s | 736K |
| HTTP/2 Client Pool | 2 | 15 | 4.60s | 5.84s | 6.44s | 728K |
| HTTP/2 Server Framework | 2 | 34 | 7.87s | 10.53s | 10.60s | 996K |
| Postgres Client | 13 | 26 | 5.12s | 6.19s | 6.69s | 652K |
| WebSocket Client | 10 | 22 | 4.24s | 5.04s | 5.31s | 560K |
§Crypto Backend
Taking aside very few exceptions, WTX does not have built-in cryptographic algorithms, as such, it is necessary to select a backend when working with features that require them.
crypto-aws-lc-rscrypto-graviolacrypto-opensslcrypto-ring
Calling methods will halt/panic the application if no backend is selected. These panicking branches will hopefully be erased by dead code analysis if the crypto feature is somehow active but never actually used.
In practice many things require cryptography algorithms. For example, PostgreSQL uses HMAC and secure HTTP cookie uses AEAD.
§Examples
Demonstrations of different use-cases can be found in the wtx-examples directory as well as in the documentation located at https://c410-f3r.github.io/wtx.
§Limitations
-
WTXis not widely used and has not undergone security audits, therefore, use it at your own risk. However, reproducible contributions that improve security are always welcome. -
Does not support systems with a pointer length of 16 bits.
-
Expects the infallible sum of the lengths of an arbitrary number of slices, otherwise the program will likely trigger an overflow that can possibly result in unexpected operations. For example, in a 32bit system such a scenario should be viable without swap memory or through specific limiters like
ulimit.
Modules§
- asn1
asn1 - Abstract Syntax Notation One (ASN.1)
- calendar
- Simple time utilities
- client_
api_ framework client-api-framework - A flexible client API framework for writing asynchronous, fast, organizable, scalable and maintainable applications.
- codec
- Decode/Encode
- collections
- Collection types
- crypto
crypto - Algorithms that prevent third parties or the public from reading private messages.
- database
database - Client connection and schema management.
- executor
- Groups elements related to async operations.
- futures
- A bunch of common structures that implement
Future. - grpc
grpc - gRPC (gRPC Remote Procedure Calls) is a high performance remote procedure call (RPC) framework.
- http
http - Generic HTTP elements
- http2
http2 - Low-level HTTP/2. You should probably look into higher abstractions like the HTTP server framework.
- misc
- Miscellaneous
- pool
- Pool Manager
- rng
- Random Number Generators
- stream
- Abstractions over different types of data streams.
- sync
- Synchronizing primitives
- tls
tls - Transport Layer Security (TLS)
- web_
socket web-socket - A computer communications protocol, providing full-duplex communication channels over a single TCP connection.
- x509
x509 - Implementation of https://datatracker.ietf.org/doc/html/rfc5280.
Macros§
- create_
enum - Implements a bunch of auxiliary methods for enums.
- create_
packages_ aux_ wrapper client-api-framework - Useful to automatically create a local
PkgsAuxwrapper that implementscore::ops::DerefMutin case you want to use a fluent-like interface for your APIs. - hexd
- Decodes a sequence of adhoc hexadecimal bytes.
- hexe
- Encodes into hexadecimal a sequence of adhoc bytes.
- paths
http2-server-frameworkandhttp - Shortcut that avoids having to explicit import types related to paths.
Enums§
- Error
- Grouped individual errors
- Recv
Error - An error returned by the receiving part of a channel
- Send
Error - An error returned by the sending part of a channel
Type Aliases§
- Result
- Shortcut of
core::result::Result<T, Error>.
Attribute Macros§
- api
macros - API
- db
macros - Allows the execution of asynchronous database tests using the runtime provided by
WTX. - main
macros - Allows the execution of asynchronous programs using the runtime provided by
WTX. - pkg
macros - Package
- test
macros - Allows the execution of asynchronous tests using the runtime provided by
WTX.
Derive Macros§
- From
Records macros - From records
- From
Vars macros - Implements the
FromVarstrait. - Lease
macros - Implements the
Leasetrait to different structures. - Table
macros - Generates table fields separated by commas