Module design_pattern_examples_rust::adapter
source · Expand description
The Adapter design pattern example module
This example adapts functions that:
- Accesses memory in 32-bit chunks instead of bytes
- Returns error codes but no human-readable error messages
The DataReaderWriter struct (in the adapter_functions.rs module) translates the 32-bit chunk access into arrays of bytes. The DataReaderWriter struct also provides human-readable messages for error codes.
Accessed through the adapter_exercise() function.
Modules
- Contains the wrapper functions for calling into the Adapter_BackEnd DLL.
- Contains the DataReaderWriter struct that acts as an adapter to the Adapter_BackEnd DLL (via the function wrappers in adapter_backend.rs).
Functions
- Example of using the “Adapter” design pattern in rust.