1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//! Backend trait for msgpack communication
//!
//! This module defines a simple, pluggable interface for Barretenberg backends.
//! Users can easily implement custom backends (FFI, WASM, IPC, etc.).
use crateResult;
/// Simple interface for msgpack backend implementations.
///
/// Implement this trait to create a custom backend for Barretenberg.
/// The backend handles msgpack-encoded command/response communication.
///
/// # Example
///
/// ```ignore
/// struct MyCustomBackend {
/// // your FFI handle, connection, etc.
/// }
///
/// impl Backend for MyCustomBackend {
/// fn call(&mut self, input: &[u8]) -> Result<Vec<u8>> {
/// // Send input to your backend
/// // Return the response
/// }
///
/// fn destroy(&mut self) -> Result<()> {
/// // Clean up resources
/// Ok(())
/// }
/// }
/// ```