-
Notifications
You must be signed in to change notification settings - Fork 2
/
bridge_generated.dart
124 lines (101 loc) · 3.72 KB
/
bridge_generated.dart
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
// AUTO GENERATED FILE, DO NOT EDIT.
// Generated by `flutter_rust_bridge`.
// ignore_for_file: non_constant_identifier_names, unused_element, duplicate_ignore, directives_ordering, curly_braces_in_flow_control_structures, unnecessary_lambdas, slash_for_doc_comments, prefer_const_literals_to_create_immutables, implicit_dynamic_list_literal, duplicate_import, unused_import
import 'dart:convert';
import 'dart:typed_data';
import 'dart:convert';
import 'dart:typed_data';
import 'package:flutter_rust_bridge/flutter_rust_bridge.dart';
import 'dart:ffi' as ffi;
abstract class RustFlutter {
Future<int> simpleAdder({required int a, required int b, dynamic hint});
}
class RustFlutterImpl extends FlutterRustBridgeBase<RustFlutterWire>
implements RustFlutter {
factory RustFlutterImpl(ffi.DynamicLibrary dylib) =>
RustFlutterImpl.raw(RustFlutterWire(dylib));
RustFlutterImpl.raw(RustFlutterWire inner) : super(inner);
Future<int> simpleAdder({required int a, required int b, dynamic hint}) =>
executeNormal(FlutterRustBridgeTask(
callFfi: (port_) =>
inner.wire_simple_adder(port_, _api2wire_i32(a), _api2wire_i32(b)),
parseSuccessData: _wire2api_i32,
constMeta: const FlutterRustBridgeTaskConstMeta(
debugName: "simple_adder",
argNames: ["a", "b"],
),
argValues: [a, b],
hint: hint,
));
// Section: api2wire
int _api2wire_i32(int raw) {
return raw;
}
// Section: api_fill_to_wire
}
// Section: wire2api
int _wire2api_i32(dynamic raw) {
return raw as int;
}
// ignore_for_file: camel_case_types, non_constant_identifier_names, avoid_positional_boolean_parameters, annotate_overrides, constant_identifier_names
// AUTO GENERATED FILE, DO NOT EDIT.
//
// Generated by `package:ffigen`.
/// generated by flutter_rust_bridge
class RustFlutterWire implements FlutterRustBridgeWireBase {
/// Holds the symbol lookup function.
final ffi.Pointer<T> Function<T extends ffi.NativeType>(String symbolName)
_lookup;
/// The symbols are looked up in [dynamicLibrary].
RustFlutterWire(ffi.DynamicLibrary dynamicLibrary)
: _lookup = dynamicLibrary.lookup;
/// The symbols are looked up with [lookup].
RustFlutterWire.fromLookup(
ffi.Pointer<T> Function<T extends ffi.NativeType>(String symbolName)
lookup)
: _lookup = lookup;
void wire_simple_adder(
int port_,
int a,
int b,
) {
return _wire_simple_adder(
port_,
a,
b,
);
}
late final _wire_simple_adderPtr = _lookup<
ffi.NativeFunction<
ffi.Void Function(
ffi.Int64, ffi.Int32, ffi.Int32)>>('wire_simple_adder');
late final _wire_simple_adder =
_wire_simple_adderPtr.asFunction<void Function(int, int, int)>();
void free_WireSyncReturnStruct(
WireSyncReturnStruct val,
) {
return _free_WireSyncReturnStruct(
val,
);
}
late final _free_WireSyncReturnStructPtr =
_lookup<ffi.NativeFunction<ffi.Void Function(WireSyncReturnStruct)>>(
'free_WireSyncReturnStruct');
late final _free_WireSyncReturnStruct = _free_WireSyncReturnStructPtr
.asFunction<void Function(WireSyncReturnStruct)>();
void store_dart_post_cobject(
DartPostCObjectFnType ptr,
) {
return _store_dart_post_cobject(
ptr,
);
}
late final _store_dart_post_cobjectPtr =
_lookup<ffi.NativeFunction<ffi.Void Function(DartPostCObjectFnType)>>(
'store_dart_post_cobject');
late final _store_dart_post_cobject = _store_dart_post_cobjectPtr
.asFunction<void Function(DartPostCObjectFnType)>();
}
typedef DartPostCObjectFnType = ffi.Pointer<
ffi.NativeFunction<ffi.Uint8 Function(DartPort, ffi.Pointer<ffi.Void>)>>;
typedef DartPort = ffi.Int64;