11 releases
0.7.6 | Oct 10, 2024 |
---|---|
0.7.5 | Oct 10, 2024 |
0.7.1 | Sep 23, 2024 |
0.6.3 | Sep 23, 2024 |
0.5.8 | Aug 30, 2024 |
#1325 in Development tools
842 downloads per month
1MB
9K
SLoC
FFI for AdGuard FLM
Foreign function interface crate for filter list manager library.
For generating FFI bindings, the uniffi-rs library is used.
Build
Apple
rustup target add x86_64-apple-darwin aarch64-apple-darwin # for macOS universal framework
rustup target add x86_64-apple-ios aarch64-apple-ios-sim # for iPhone simulator universal framework
rustup target add aarch64-apple-ios # for iOS framework
Building Apple XCFramework
cd ${REPO_ROOT}
./platform/apple/build.sh
Windows
tbd...
Usage recommendations and motivation
This crate is a set of bindings over filter-list-manager and build configurations for FFI bindings to interface with other programming languages. Currently, the FFI wrapper uses a Mutex wrapper around FLM, keep this in mind.
For example:
- You want to update filters with
update_filters
method. - Client has bad internet connection, and we have a lot of filters.
- You run filters update process in another thread in your app.
- The main thread wants to read something from FLM.
- Main thread will be blocked until update process will be completed.
Specifically for this case, the solution will be to use the second parameter of
the update_filters
method - loose_timeout
.
FFI-specific symbols
Look at these symbols for better understanding FFI interface.
Functions
Models
Errors
OuterError
- flattened enum from adguard_flm::FLMError
.
Outer Error
Dependencies
~37–51MB
~870K SLoC