Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/graysonarts/uniffi-slab-example
An example of how to use slab to send opaque types across the uniffi boundary as an id in the slab arena.
https://github.com/graysonarts/uniffi-slab-example
Last synced: about 5 hours ago
JSON representation
An example of how to use slab to send opaque types across the uniffi boundary as an id in the slab arena.
- Host: GitHub
- URL: https://github.com/graysonarts/uniffi-slab-example
- Owner: graysonarts
- Created: 2024-03-07T00:38:10.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-03-07T06:47:56.000Z (8 months ago)
- Last Synced: 2024-04-16T01:01:18.546Z (7 months ago)
- Language: Rust
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Using slab to send opaque types over Uniffi bindings
Read the article on dev.to [Opaque Types for UniFFI](https://dev.to/therustgarden/opaque-types-for-uniffi-1j9l)
## Get Everything ready to test
1. Run `build.ps1` (powershell) (or run the commands adjusting for not-windows)
2. Copy `opaque_type.dll` from `target/release` into `target/python`
3. cd into `target/python`
4. Run commands like in the example usage## Example Usage of Generated Python Bindings
```python
import opaque_type;opaque_type.ffi_initialize()
x = opaque_type.ffi_make_opaque(42)
y = opaque_type.ffi_make_opaque(23)
opaque_type.ffi_process_handle(x)
opaque_type.ffi_process_handle(y)
opaque_type.ffi_shutdown()
```