Describe the bug
My project is at https://github.com/gjf2a/groundline.
It compiles and runs perfectly well with frb 1.51.0.
It does not compile with frb 1.53.0. I was careful to run flutter pub upgrade
and then regenerate the bridge code after upgrading. If I switch back to 1.51.0, it compiles and runs with no trouble whatsoever.
Here is the error message:
Launching lib\main.dart on KFAUWI in debug mode...
Running Gradle task 'assembleDebug'...
lib/bridge_generated.dart:363:7: Error: The non-abstract class 'NativeWire' is missing implementations for these members:
- FlutterRustBridgeWireBase.drop_dart_object
- FlutterRustBridgeWireBase.get_dart_object
- FlutterRustBridgeWireBase.new_dart_opaque
Try to either
- provide an implementation,
- inherit an implementation from a superclass or mixin,
- mark the class as abstract, or
- provide a 'noSuchMethod' implementation.
class NativeWire implements FlutterRustBridgeWireBase {
^^^^^^^^^^
../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/flutter_rust_bridge-1.53.0/lib/src/ffi/stub.dart:31:8: Context: 'FlutterRustBridgeWireBase.drop_dart_object' is defined here.
void drop_dart_object(int ptr) {
^^^^^^^^^^^^^^^^
../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/flutter_rust_bridge-1.53.0/lib/src/ffi/stub.dart:26:10: Context: 'FlutterRustBridgeWireBase.get_dart_object' is defined here.
Object get_dart_object(int ptr) {
^^^^^^^^^^^^^^^
../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/flutter_rust_bridge-1.53.0/lib/src/ffi/stub.dart:36:7: Context: 'FlutterRustBridgeWireBase.new_dart_opaque' is defined here.
int new_dart_opaque(Object obj) {
^^^^^^^^^^^^^^^
FAILURE: Build failed with an exception.
* Where:
Script 'C:\Users\ferrer\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1159
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\Users\ferrer\flutter\bin\flutter.bat'' finished with non-zero exit value 1
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 18s
Exception: Gradle task assembleDebug failed with exit code 1
Codegen logs with RUST_LOG=debug
environment variable
PS C:\Users\ferrer\AndroidStudioProjects\groundline\native> $env:RUST_LOG='debug'
PS C:\Users\ferrer\AndroidStudioProjects\groundline\native> flutter_rust_bridge_codegen --rust-input src\api.rs --dart-output ..\lib\bridge_generated.dart --dart-decl-output ..\lib\bridge_definitions.dart
[2022-12-07T21:58:25Z DEBUG flutter_rust_bridge_codegen] configs=[Opts { rust_input_path: "C:\\Users\\ferrer\\AndroidStudioProjects\\groundline\\native\\src\\api.rs", dart_output_path: "C:\\Users\\ferrer\\AndroidStudioProjects\\groundline\\native\\..\\lib\\bridge_generated.dart", dart_decl_output_path: Some("C:\\Users\\ferrer\\AndroidStudioProjects\\groundline\\native\\..\\lib\\bridge_definitions.dart"), c_output_path: ["C:\\Users\\ferrer\\AppData\\Local\\Temp\\.tmpG9E0FZ.h"], rust_crate_dir: "C:\\Users\\ferrer\\AndroidStudioProjects\\groundline\\native", rust_output_path:
"C:\\Users\\ferrer\\AndroidStudioProjects\\groundline\\native\\src\\bridge_generated.rs", class_name: "Native", dart_format_line_length: 80, skip_add_mod_to_lib: false, llvm_path: ["/opt/homebrew/opt/llvm", "/usr/local/opt/llvm", "/usr/lib/llvm-9", "/usr/lib/llvm-10", "/usr/lib/llvm-11", "/usr/lib/llvm-12", "/usr/lib/llvm-13", "/usr/lib/llvm-14", "/usr/lib/", "/usr/lib64/", "C:/Program Files/llvm", "C:/msys64/mingw64"], llvm_compiler_opts: "", manifest_path: "C:\\Users\\ferrer\\AndroidStudioProjects\\groundline\\native\\Cargo.toml", dart_root: Some("C:\\Users\\ferrer\\AndroidStudioProjects\\groundline\\native\\.."), build_runner: true, block_index: BlockIndex(0), skip_deps_check: false, wasm_enabled: false, inline_rust: false }]
[2022-12-07T21:58:26Z DEBUG lib_flutter_rust_bridge_codegen::source_graph] Trying to parse "\\\\?\\C:\\Users\\ferrer\\AndroidStudioProjects\\groundline\\native\\src\\api.rs"
[2022-12-07T21:58:26Z DEBUG lib_flutter_rust_bridge_codegen::source_graph] Trying to parse "\\\\?\\C:\\Users\\ferrer\\AndroidStudioProjects\\groundline\\native\\src\\bridge_generated.rs"
[2022-12-07T21:58:26Z WARN lib_flutter_rust_bridge_codegen::source_graph] Skipping unresolvable module io (tried \\?\C:\Users\ferrer\AndroidStudioProjects\groundline\native\src\io.rs, \\?\C:\Users\ferrer\AndroidStudioProjects\groundline\native\src\io\mod.rs, \\?\C:\Users\ferrer\AndroidStudioProjects\groundline\native\src\bridge_generated\io.rs, \\?\C:\Users\ferrer\AndroidStudioProjects\groundline\native\src\bridge_generated\io\mod.rs, )
[2022-12-07T21:58:26Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(kmeans_ready)
[2022-12-07T21:58:26Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(training_time)
[2022-12-07T21:58:26Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(intensity_rgba)
[2022-12-07T21:58:26Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(yuv_rgba)
[2022-12-07T21:58:26Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(color_count)
[2022-12-07T21:58:26Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(groundline_sample_overlay)
[2022-12-07T21:58:26Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(start_kmeans_training)
[2022-12-07T21:58:26Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(color_clusterer)
[2022-12-07T21:58:26Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(groundline_k_means)
[2022-12-07T21:58:26Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(get_correlation_flow)
[2022-12-07T21:58:26Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(reset_position_estimate)
[2022-12-07T21:58:26Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(process_sensor_data)
[2022-12-07T21:58:26Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(parse_sensor_data)
[2022-12-07T21:58:26Z DEBUG lib_flutter_rust_bridge_codegen::tools] Guessing toolchain the runner is run into
[2022-12-07T21:58:26Z DEBUG lib_flutter_rust_bridge_codegen::commands] execute command: bin=powershell args="-noprofile -command & \"flutter\" \"--version\"" current_dir=None cmd="powershell" "-noprofile" "-command" "& \"flutter\" \"--version\""
Flutter 3.3.9 • channel stable • https://github.com/flutter/flutter.git
Framework • revision b8f7f1f986 (2 weeks ago) • 2022-11-23 06:43:51 +0900
Engine • revision 8f2221fbef
Tools • Dart 2.18.5 • DevTools 2.15.0
[2022-12-07T21:58:28Z DEBUG lib_flutter_rust_bridge_codegen::commands] command="powershell" "-noprofile" "-command" "& \"flutter\" \"--version\"" stdout= stderr=
[2022-12-07T21:58:28Z DEBUG lib_flutter_rust_bridge_codegen::tools] Checking presence of ffi in dependencies at C:\Users\ferrer\AndroidStudioProjects\groundline\native\..
[2022-12-07T21:58:28Z DEBUG lib_flutter_rust_bridge_codegen::tools] Checking presence of ffi in dependencies at C:\Users\ferrer\AndroidStudioProjects\groundline\native\..
[2022-12-07T21:58:28Z DEBUG lib_flutter_rust_bridge_codegen::tools] Checking presence of ffigen in dev_dependencies at C:\Users\ferrer\AndroidStudioProjects\groundline\native\..
[2022-12-07T21:58:28Z DEBUG lib_flutter_rust_bridge_codegen::tools] Checking presence of ffigen in dev_dependencies at C:\Users\ferrer\AndroidStudioProjects\groundline\native\..
[2022-12-07T21:58:28Z INFO lib_flutter_rust_bridge_codegen] Picked config: Opts { rust_input_path: "C:\\Users\\ferrer\\AndroidStudioProjects\\groundline\\native\\src\\api.rs", dart_output_path: "C:\\Users\\ferrer\\AndroidStudioProjects\\groundline\\native\\..\\lib\\bridge_generated.dart", dart_decl_output_path: Some("C:\\Users\\ferrer\\AndroidStudioProjects\\groundline\\native\\..\\lib\\bridge_definitions.dart"), c_output_path: ["C:\\Users\\ferrer\\AppData\\Local\\Temp\\.tmpG9E0FZ.h"], rust_crate_dir: "C:\\Users\\ferrer\\AndroidStudioProjects\\groundline\\native", rust_output_path: "C:\\Users\\ferrer\\AndroidStudioProjects\\groundline\\native\\src\\bridge_generated.rs", class_name: "Native", dart_format_line_length: 80, skip_add_mod_to_lib: false, llvm_path: ["/opt/homebrew/opt/llvm", "/usr/local/opt/llvm", "/usr/lib/llvm-9", "/usr/lib/llvm-10", "/usr/lib/llvm-11", "/usr/lib/llvm-12", "/usr/lib/llvm-13", "/usr/lib/llvm-14", "/usr/lib/", "/usr/lib64/", "C:/Program Files/llvm", "C:/msys64/mingw64"], llvm_compiler_opts: "", manifest_path: "C:\\Users\\ferrer\\AndroidStudioProjects\\groundline\\native\\Cargo.toml", dart_root: Some("C:\\Users\\ferrer\\AndroidStudioProjects\\groundline\\native\\.."), build_runner: true, block_index: BlockIndex(0), skip_deps_check: false, wasm_enabled: false, inline_rust: false }
[2022-12-07T21:58:28Z INFO lib_flutter_rust_bridge_codegen] Phase: Parse source code to AST, then to IR
[2022-12-07T21:58:28Z DEBUG lib_flutter_rust_bridge_codegen::source_graph] Trying to parse "\\\\?\\C:\\Users\\ferrer\\AndroidStudioProjects\\groundline\\native\\src\\api.rs"
[2022-12-07T21:58:28Z DEBUG lib_flutter_rust_bridge_codegen::source_graph] Trying to parse "\\\\?\\C:\\Users\\ferrer\\AndroidStudioProjects\\groundline\\native\\src\\bridge_generated.rs"
[2022-12-07T21:58:28Z WARN lib_flutter_rust_bridge_codegen::source_graph] Skipping unresolvable module io (tried \\?\C:\Users\ferrer\AndroidStudioProjects\groundline\native\src\io.rs, \\?\C:\Users\ferrer\AndroidStudioProjects\groundline\native\src\io\mod.rs, \\?\C:\Users\ferrer\AndroidStudioProjects\groundline\native\src\bridge_generated\io.rs, \\?\C:\Users\ferrer\AndroidStudioProjects\groundline\native\src\bridge_generated\io\mod.rs, )
[2022-12-07T21:58:28Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(kmeans_ready)
[2022-12-07T21:58:28Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(training_time)
[2022-12-07T21:58:28Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(intensity_rgba)
[2022-12-07T21:58:28Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(yuv_rgba)
[2022-12-07T21:58:28Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(color_count)
[2022-12-07T21:58:28Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(groundline_sample_overlay)
[2022-12-07T21:58:28Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(start_kmeans_training)
[2022-12-07T21:58:28Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(color_clusterer)
[2022-12-07T21:58:28Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(groundline_k_means)
[2022-12-07T21:58:28Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(get_correlation_flow)
[2022-12-07T21:58:28Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(reset_position_estimate)
[2022-12-07T21:58:28Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(process_sensor_data)
[2022-12-07T21:58:28Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(parse_sensor_data)
[2022-12-07T21:58:28Z INFO lib_flutter_rust_bridge_codegen] Phase: Transform IR
[2022-12-07T21:58:28Z DEBUG lib_flutter_rust_bridge_codegen::transformer] transform_func_input_add_boxed wrap Boxed to field=IrField { ty: StructRef(IrTypeStructRef { name: "ImageData", freezed: false }), name: IrIdent { raw: "img" }, is_final: true, comments: [] }
[2022-12-07T21:58:28Z DEBUG lib_flutter_rust_bridge_codegen::transformer] transform_func_input_add_boxed wrap Boxed to field=IrField { ty: StructRef(IrTypeStructRef { name: "ImageData", freezed: false }), name: IrIdent { raw: "img" }, is_final: true, comments: [] }
[2022-12-07T21:58:28Z DEBUG lib_flutter_rust_bridge_codegen::transformer] transform_func_input_add_boxed wrap Boxed to field=IrField { ty: StructRef(IrTypeStructRef { name: "ImageData", freezed: false }), name: IrIdent { raw: "img" }, is_final: true, comments: [] }
[2022-12-07T21:58:28Z DEBUG lib_flutter_rust_bridge_codegen::transformer] transform_func_input_add_boxed wrap Boxed to field=IrField { ty: StructRef(IrTypeStructRef { name: "ImageData", freezed: false }), name: IrIdent { raw: "img" }, is_final: true, comments: [] }
[2022-12-07T21:58:28Z DEBUG lib_flutter_rust_bridge_codegen::transformer] transform_func_input_add_boxed wrap Boxed to field=IrField { ty: StructRef(IrTypeStructRef { name: "ImageData", freezed: false }), name: IrIdent { raw: "img" }, is_final: true, comments: [] }
[2022-12-07T21:58:28Z DEBUG lib_flutter_rust_bridge_codegen::transformer] transform_func_input_add_boxed wrap Boxed to field=IrField { ty: StructRef(IrTypeStructRef { name: "ImageData", freezed: false }), name: IrIdent { raw: "img" }, is_final: true, comments: [] }
[2022-12-07T21:58:28Z INFO lib_flutter_rust_bridge_codegen] Phase: Generate Rust code
[2022-12-07T21:58:28Z INFO lib_flutter_rust_bridge_codegen] Phase: Generate Dart code
[2022-12-07T21:58:28Z DEBUG lib_flutter_rust_bridge_codegen::generator::dart] distinct_input_types=[Delegate(String), Boxed(IrTypeBoxed { exist_in_real_api: false, inner: StructRef(IrTypeStructRef { name: "ImageData", freezed: false }) }), Primitive(I64), StructRef(IrTypeStructRef { name:
"ImageData", freezed: false }), Primitive(U8), PrimitiveList(IrTypePrimitiveList { primitive: U8 })]
[2022-12-07T21:58:28Z DEBUG lib_flutter_rust_bridge_codegen::generator::dart] distinct_output_types=[Delegate(String), Delegate(ZeroCopyBufferVecPrimitive(U8)), Primitive(Bool), StructRef(IrTypeStructRef { name: "CorrelationFlow", freezed: false }), Primitive(I16), Primitive(I64), StructRef(IrTypeStructRef { name: "SensorData", freezed: false }), Primitive(U8), PrimitiveList(IrTypePrimitiveList { primitive: U8 }), Primitive(Unit)]
[2022-12-07T21:58:28Z DEBUG lib_flutter_rust_bridge_codegen::commands] execute format_rust path=["C:\\Users\\ferrer\\AndroidStudioProjects\\groundline\\native\\src\\bridge_generated.rs"]
[2022-12-07T21:58:28Z DEBUG lib_flutter_rust_bridge_codegen::commands] execute command: bin=rustfmt args="C:\\Users\\ferrer\\AndroidStudioProjects\\groundline\\native\\src\\bridge_generated.rs" current_dir=None cmd="rustfmt" "C:\\Users\\ferrer\\AndroidStudioProjects\\groundline\\native\\src\\bridge_generated.rs"
[2022-12-07T21:58:29Z DEBUG lib_flutter_rust_bridge_codegen::commands] command="rustfmt" "C:\\Users\\ferrer\\AndroidStudioProjects\\groundline\\native\\src\\bridge_generated.rs" stdout= stderr=
[2022-12-07T21:58:29Z INFO lib_flutter_rust_bridge_codegen] Phase: Generating Dart bindings for Rust
[2022-12-07T21:58:29Z DEBUG lib_flutter_rust_bridge_codegen::commands] execute cbindgen rust_crate_dir=C:\Users\ferrer\AndroidStudioProjects\groundline\native c_output_path=C:\Users\ferrer\AppData\Local\Temp\.tmpvY1CSd.h
[2022-12-07T21:58:29Z DEBUG lib_flutter_rust_bridge_codegen::commands] cbindgen config: Config {
header: None,
includes: [],
sys_includes: [
"stdbool.h",
"stdint.h",
"stdlib.h",
],
after_includes: None,
trailer: None,
include_guard: None,
pragma_once: false,
no_includes: true,
autogen_warning: None,
include_version: false,
namespace: None,
namespaces: None,
using_namespaces: None,
braces: SameLine,
line_length: 100,
tab_width: 2,
line_endings: LF,
language: C,
cpp_compat: false,
style: Both,
sort_by: None,
usize_is_size_t: false,
parse: ParseConfig {
parse_deps: false,
include: None,
exclude: [],
expand: ParseExpandConfig {
crates: [],
all_features: false,
default_features: true,
features: None,
profile: Debug,
},
clean: false,
extra_bindings: [],
},
export: ExportConfig {
include: [
"\"wire_CorrelationFlow\"",
"\"wire_ImageData\"",
"\"wire_SensorData\"",
],
exclude: [],
rename: {},
pre_body: {},
body: {},
prefix: None,
item_types: [],
renaming_overrides_prefixing: false,
mangle: MangleConfig {
rename_types: None,
remove_underscores: false,
},
},
macro_expansion: MacroExpansionConfig {
bitflags: false,
},
layout: LayoutConfig {
packed: None,
aligned_n: None,
},
function: FunctionConfig {
prefix: None,
postfix: None,
must_use: None,
args: Auto,
rename_args: None,
swift_name_macro: None,
sort_by: None,
no_return: None,
},
structure: StructConfig {
rename_fields: None,
derive_constructor: false,
derive_eq: false,
derive_neq: false,
derive_lt: false,
derive_lte: false,
derive_gt: false,
derive_gte: false,
derive_ostream: false,
associated_constants_in_body: false,
must_use: None,
},
enumeration: EnumConfig {
rename_variants: None,
rename_variant_name_fields: SnakeCase,
add_sentinel: false,
prefix_with_name: false,
derive_helper_methods: false,
derive_const_casts: false,
derive_mut_casts: false,
cast_assert_name: None,
must_use: None,
derive_tagged_enum_destructor: false,
derive_tagged_enum_copy_constructor: false,
derive_tagged_enum_copy_assignment: false,
derive_ostream: false,
enum_class: true,
private_default_tagged_enum_constructor: false,
},
constant: ConstantConfig {
allow_static_const: true,
allow_constexpr: true,
sort_by: None,
},
defines: {},
documentation: true,
documentation_style: Auto,
documentation_length: Full,
pointer: PtrConfig {
non_null_attribute: None,
},
only_target_dependencies: false,
cython: CythonConfig {
header: None,
cimports: {},
},
}
[2022-12-07T21:58:29Z DEBUG cbindgen::bindgen::parser] Parsing crate native
[2022-12-07T21:58:29Z INFO cbindgen::bindgen::parser] Take native::RgbTriple - opaque (Tuples are not supported types.).
[2022-12-07T21:58:29Z INFO cbindgen::bindgen::parser] Take native::ImageData - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
[2022-12-07T21:58:29Z INFO cbindgen::bindgen::parser] Take native::SensorData - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
[2022-12-07T21:58:29Z WARN cbindgen::bindgen::parser] Skip native::UPPER_SAMPLE_HEIGHT - (not `pub`).
[2022-12-07T21:58:29Z WARN cbindgen::bindgen::parser] Skip native::UPPER_SAMPLE_WIDTH - (not `pub`).
[2022-12-07T21:58:29Z WARN cbindgen::bindgen::parser] Skip native::LOWER_SAMPLE_WIDTH - (not `pub`).
[2022-12-07T21:58:29Z WARN cbindgen::bindgen::parser] Skip native::LOWER_SAMPLE_HEIGHT - (not `pub`).
[2022-12-07T21:58:29Z INFO cbindgen::bindgen::parser] Take native::Rect - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
[2022-12-07T21:58:29Z INFO cbindgen::bindgen::parser] Take native::GroundlineOverlay - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
[2022-12-07T21:58:29Z WARN cbindgen::bindgen::parser] Skip native::NUM_COLOR_CLUSTERS - (not `pub`).
[2022-12-07T21:58:29Z INFO cbindgen::bindgen::parser] Take native::CorrelationFlow - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
[2022-12-07T21:58:29Z INFO cbindgen::bindgen::parser] Take native::DartPort.
[2022-12-07T21:58:29Z INFO cbindgen::bindgen::parser] Take native::DartPostCObjectFnType.
[2022-12-07T21:58:29Z INFO cbindgen::bindgen::parser] Take native::store_dart_post_cobject.
[2022-12-07T21:58:29Z INFO cbindgen::bindgen::parser] Take native::WireSyncReturnStruct.
[2022-12-07T21:58:29Z INFO cbindgen::bindgen::parser] Take native::wire_kmeans_ready.
[2022-12-07T21:58:29Z INFO cbindgen::bindgen::parser] Take native::wire_training_time.
[2022-12-07T21:58:29Z INFO cbindgen::bindgen::parser] Take native::wire_intensity_rgba.
[2022-12-07T21:58:29Z INFO cbindgen::bindgen::parser] Take native::wire_yuv_rgba.
[2022-12-07T21:58:29Z INFO cbindgen::bindgen::parser] Take native::wire_color_count.
[2022-12-07T21:58:29Z INFO cbindgen::bindgen::parser] Take native::wire_groundline_sample_overlay.
[2022-12-07T21:58:29Z INFO cbindgen::bindgen::parser] Take native::wire_start_kmeans_training.
[2022-12-07T21:58:29Z INFO cbindgen::bindgen::parser] Take native::wire_color_clusterer.
[2022-12-07T21:58:29Z INFO cbindgen::bindgen::parser] Take native::wire_groundline_k_means.
[2022-12-07T21:58:29Z INFO cbindgen::bindgen::parser] Take native::wire_get_correlation_flow.
[2022-12-07T21:58:29Z INFO cbindgen::bindgen::parser] Take native::wire_reset_position_estimate.
[2022-12-07T21:58:29Z INFO cbindgen::bindgen::parser] Take native::wire_process_sensor_data.
[2022-12-07T21:58:29Z INFO cbindgen::bindgen::parser] Take native::wire_parse_sensor_data.
[2022-12-07T21:58:29Z INFO cbindgen::bindgen::parser] Take native::new_box_autoadd_image_data_0.
[2022-12-07T21:58:29Z INFO cbindgen::bindgen::parser] Take native::new_uint_8_list_0.
[2022-12-07T21:58:29Z INFO cbindgen::bindgen::parser] Take native::wire_ImageData.
[2022-12-07T21:58:29Z INFO cbindgen::bindgen::parser] Take native::wire_uint_8_list.
[2022-12-07T21:58:29Z INFO cbindgen::bindgen::parser] Take native::free_WireSyncReturnStruct.
[2022-12-07T21:58:29Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config.
[2022-12-07T21:58:29Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config.
[2022-12-07T21:58:29Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config.
[2022-12-07T21:58:29Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config.
[2022-12-07T21:58:29Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config.
[2022-12-07T21:58:29Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config.
[2022-12-07T21:58:29Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config.
[2022-12-07T21:58:29Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config.
[2022-12-07T21:58:29Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config.
[2022-12-07T21:58:29Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config.
[2022-12-07T21:58:29Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config.
[2022-12-07T21:58:29Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config.
[2022-12-07T21:58:29Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config.
[2022-12-07T21:58:29Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config.
[2022-12-07T21:58:29Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config.
[2022-12-07T21:58:29Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config.
[2022-12-07T21:58:29Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config.
[2022-12-07T21:58:29Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config.
[2022-12-07T21:58:29Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config.
[2022-12-07T21:58:29Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config.
[2022-12-07T21:58:29Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config.
[2022-12-07T21:58:29Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config.
[2022-12-07T21:58:29Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config.
[2022-12-07T21:58:29Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config.
[2022-12-07T21:58:29Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config.
[2022-12-07T21:58:29Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config.
[2022-12-07T21:58:29Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config.
[2022-12-07T21:58:29Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config.
[2022-12-07T21:58:29Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config.
[2022-12-07T21:58:29Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config.
[2022-12-07T21:58:29Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config.
[2022-12-07T21:58:29Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config.
[2022-12-07T21:58:29Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config.
[2022-12-07T21:58:29Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config.
[2022-12-07T21:58:29Z DEBUG lib_flutter_rust_bridge_codegen::commands] execute ffigen c_path=C:\Users\ferrer\AppData\Local\Temp\.tmpvY1CSd.h dart_path=C:\Users\ferrer\AppData\Local\Temp\.tmp1fnksy llvm_path=["/opt/homebrew/opt/llvm", "/usr/local/opt/llvm", "/usr/lib/llvm-9", "/usr/lib/llvm-10", "/usr/lib/llvm-11", "/usr/lib/llvm-12", "/usr/lib/llvm-13", "/usr/lib/llvm-14", "/usr/lib/", "/usr/lib64/", "C:/Program Files/llvm", "C:/msys64/mingw64"]
[2022-12-07T21:58:29Z DEBUG lib_flutter_rust_bridge_codegen::commands] ffigen config:
output: 'C:\Users\ferrer\AppData\Local\Temp\.tmp1fnksy'
name: 'NativeWire'
description: 'generated by flutter_rust_bridge'
headers:
entry-points:
- 'C:\Users\ferrer\AppData\Local\Temp\.tmpvY1CSd.h'
include-directives:
- 'C:\Users\ferrer\AppData\Local\Temp\.tmpvY1CSd.h'
comments: false
preamble: |
// ignore_for_file: camel_case_types, non_constant_identifier_names, avoid_positional_boolean_parameters, annotate_overrides, constant_identifier_names
llvm-path:
- '/opt/homebrew/opt/llvm'
- '/usr/local/opt/llvm'
- '/usr/lib/llvm-9'
- '/usr/lib/llvm-10'
- '/usr/lib/llvm-11'
- '/usr/lib/llvm-12'
- '/usr/lib/llvm-13'
- '/usr/lib/llvm-14'
- '/usr/lib/'
- '/usr/lib64/'
- 'C:/Program Files/llvm'
- 'C:/msys64/mingw64'
[2022-12-07T21:58:29Z DEBUG lib_flutter_rust_bridge_codegen::commands] ffigen config_file: NamedTempFile("C:\\Users\\ferrer\\AppData\\Local\\Temp\\.tmp4ruDu5")
[2022-12-07T21:58:29Z DEBUG lib_flutter_rust_bridge_codegen::tools] Guessing toolchain the runner is run into
[2022-12-07T21:58:29Z DEBUG lib_flutter_rust_bridge_codegen::commands] execute command: bin=powershell args="-noprofile -command & \"flutter\" \"pub\" \"run\" \"ffigen\" \"--config\" \"C:\\\\Users\\\\ferrer\\\\AppData\\\\Local\\\\Temp\\\\.tmp4ruDu5\"" current_dir=Some("C:\\Users\\ferrer\\AndroidStudioProjects\\groundline\\native\\..") cmd="powershell" "-noprofile" "-command" "& \"flutter\" \"pub\" \"run\" \"ffigen\" \"--config\" \"C:\\\\Users\\\\ferrer\\\\AppData\\\\Local\\\\Temp\\\\.tmp4ruDu5\""
Running in Directory: 'C:\Users\ferrer\AndroidStudioProjects\groundline'
Input Headers: [C:\Users\ferrer\AppData\Local\Temp\.tmpvY1CSd.h]
Finished, Bindings generated in C:\Users\ferrer\AppData\Local\Temp\.tmp1fnksy
[2022-12-07T21:58:32Z DEBUG lib_flutter_rust_bridge_codegen::commands] command="powershell" "-noprofile" "-command" "& \"flutter\" \"pub\" \"run\" \"ffigen\" \"--config\" \"C:\\\\Users\\\\ferrer\\\\AppData\\\\Local\\\\Temp\\\\.tmp4ruDu5\"" stdout= stderr=
[2022-12-07T21:58:32Z INFO lib_flutter_rust_bridge_codegen] Phase: Running build_runner
[2022-12-07T21:58:32Z INFO lib_flutter_rust_bridge_codegen] Phase: Formatting Dart code
[2022-12-07T21:58:32Z DEBUG lib_flutter_rust_bridge_codegen::commands] execute format_dart path=["C:\\Users\\ferrer\\AndroidStudioProjects\\groundline\\native\\..\\lib\\bridge_generated.dart", "C:\\Users\\ferrer\\AndroidStudioProjects\\groundline\\native\\..\\lib\\bridge_definitions.dart"] line_length=80
[2022-12-07T21:58:32Z DEBUG lib_flutter_rust_bridge_codegen::commands] execute command: bin=powershell args="-noprofile -command & \"dart\" \"format\" \"--line-length\" \"80\" \"C:\\\\Users\\\\ferrer\\\\AndroidStudioProjects\\\\groundline\\\\native\\\\..\\\\lib\\\\bridge_generated.dart\" \"C:\\\\Users\\\\ferrer\\\\AndroidStudioProjects\\\\groundline\\\\native\\\\..\\\\lib\\\\bridge_definitions.dart\"" current_dir=None cmd="powershell" "-noprofile" "-command" "& \"dart\" \"format\" \"--line-length\" \"80\" \"C:\\\\Users\\\\ferrer\\\\AndroidStudioProjects\\\\groundline\\\\native\\\\..\\\\lib\\\\bridge_generated.dart\" \"C:\\\\Users\\\\ferrer\\\\AndroidStudioProjects\\\\groundline\\\\native\\\\..\\\\lib\\\\bridge_definitions.dart\""
Formatted C:\\Users\\ferrer\\AndroidStudioProjects\\groundline\\native\\..\\lib\\bridge_generated.dart
Formatted C:\\Users\\ferrer\\AndroidStudioProjects\\groundline\\native\\..\\lib\\bridge_definitions.dart
Formatted 2 files (2 changed) in 0.32 seconds.
[2022-12-07T21:58:34Z DEBUG lib_flutter_rust_bridge_codegen::commands] command="powershell" "-noprofile" "-command" "& \"dart\" \"format\" \"--line-length\" \"80\" \"C:\\\\Users\\\\ferrer\\\\AndroidStudioProjects\\\\groundline\\\\native\\\\..\\\\lib\\\\bridge_generated.dart\" \"C:\\\\Users\\\\ferrer\\\\AndroidStudioProjects\\\\groundline\\\\native\\\\..\\\\lib\\\\bridge_definitions.dart\"" stdout= stderr=
[2022-12-07T21:58:34Z INFO lib_flutter_rust_bridge_codegen] Success!
[2022-12-07T21:58:34Z INFO flutter_rust_bridge_codegen] Now go and use it :)
PS C:\Users\ferrer\AndroidStudioProjects\groundline\native>
To Reproduce
Clone https://github.com/gjf2a/groundline
flutter run
Expected behavior
I expected the app to run.
Generated binding code
// AUTO GENERATED FILE, DO NOT EDIT.
// Generated by `flutter_rust_bridge`@ 1.49.0.
// 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, prefer_single_quotes, prefer_const_constructors, use_super_parameters, always_use_package_imports, annotate_overrides, invalid_use_of_protected_member, constant_identifier_names
import "bridge_definitions.dart";
import 'dart:convert';
import 'dart:async';
import 'package:flutter_rust_bridge/flutter_rust_bridge.dart';
import 'package:meta/meta.dart';
import 'dart:convert';
import 'dart:async';
import 'package:flutter_rust_bridge/flutter_rust_bridge.dart';
import 'package:meta/meta.dart';
import 'dart:ffi' as ffi;
class NativeImpl implements Native {
final NativePlatform _platform;
factory NativeImpl(ExternalLibrary dylib) =>
NativeImpl.raw(NativePlatform(dylib));
/// Only valid on web/WASM platforms.
factory NativeImpl.wasm(FutureOr<WasmModule> module) =>
NativeImpl(module as ExternalLibrary);
NativeImpl.raw(this._platform);
Future<bool> kmeansReady({dynamic hint}) =>
_platform.executeNormal(FlutterRustBridgeTask(
callFfi: (port_) => _platform.inner.wire_kmeans_ready(port_),
parseSuccessData: _wire2api_bool,
constMeta: kKmeansReadyConstMeta,
argValues: [],
hint: hint,
));
FlutterRustBridgeTaskConstMeta get kKmeansReadyConstMeta =>
const FlutterRustBridgeTaskConstMeta(
debugName: "kmeans_ready",
argNames: [],
);
Future<int> trainingTime({dynamic hint}) =>
_platform.executeNormal(FlutterRustBridgeTask(
callFfi: (port_) => _platform.inner.wire_training_time(port_),
parseSuccessData: _wire2api_i64,
constMeta: kTrainingTimeConstMeta,
argValues: [],
hint: hint,
));
FlutterRustBridgeTaskConstMeta get kTrainingTimeConstMeta =>
const FlutterRustBridgeTaskConstMeta(
debugName: "training_time",
argNames: [],
);
Future<Uint8List> intensityRgba(
{required Uint8List intensities, dynamic hint}) =>
_platform.executeNormal(FlutterRustBridgeTask(
callFfi: (port_) => _platform.inner.wire_intensity_rgba(
port_, _platform.api2wire_uint_8_list(intensities)),
parseSuccessData: _wire2api_ZeroCopyBuffer_Uint8List,
constMeta: kIntensityRgbaConstMeta,
argValues: [intensities],
hint: hint,
));
FlutterRustBridgeTaskConstMeta get kIntensityRgbaConstMeta =>
const FlutterRustBridgeTaskConstMeta(
debugName: "intensity_rgba",
argNames: ["intensities"],
);
Future<Uint8List> yuvRgba({required ImageData img, dynamic hint}) =>
_platform.executeNormal(FlutterRustBridgeTask(
callFfi: (port_) => _platform.inner.wire_yuv_rgba(
port_, _platform.api2wire_box_autoadd_image_data(img)),
parseSuccessData: _wire2api_ZeroCopyBuffer_Uint8List,
constMeta: kYuvRgbaConstMeta,
argValues: [img],
hint: hint,
));
FlutterRustBridgeTaskConstMeta get kYuvRgbaConstMeta =>
const FlutterRustBridgeTaskConstMeta(
debugName: "yuv_rgba",
argNames: ["img"],
);
Future<int> colorCount({required ImageData img, dynamic hint}) =>
_platform.executeNormal(FlutterRustBridgeTask(
callFfi: (port_) => _platform.inner.wire_color_count(
port_, _platform.api2wire_box_autoadd_image_data(img)),
parseSuccessData: _wire2api_i64,
constMeta: kColorCountConstMeta,
argValues: [img],
hint: hint,
));
FlutterRustBridgeTaskConstMeta get kColorCountConstMeta =>
const FlutterRustBridgeTaskConstMeta(
debugName: "color_count",
argNames: ["img"],
);
Future<Uint8List> groundlineSampleOverlay(
{required ImageData img, dynamic hint}) =>
_platform.executeNormal(FlutterRustBridgeTask(
callFfi: (port_) => _platform.inner.wire_groundline_sample_overlay(
port_, _platform.api2wire_box_autoadd_image_data(img)),
parseSuccessData: _wire2api_ZeroCopyBuffer_Uint8List,
constMeta: kGroundlineSampleOverlayConstMeta,
argValues: [img],
hint: hint,
));
FlutterRustBridgeTaskConstMeta get kGroundlineSampleOverlayConstMeta =>
const FlutterRustBridgeTaskConstMeta(
debugName: "groundline_sample_overlay",
argNames: ["img"],
);
Future<void> startKmeansTraining({required ImageData img, dynamic hint}) =>
_platform.executeNormal(FlutterRustBridgeTask(
callFfi: (port_) => _platform.inner.wire_start_kmeans_training(
port_, _platform.api2wire_box_autoadd_image_data(img)),
parseSuccessData: _wire2api_unit,
constMeta: kStartKmeansTrainingConstMeta,
argValues: [img],
hint: hint,
));
FlutterRustBridgeTaskConstMeta get kStartKmeansTrainingConstMeta =>
const FlutterRustBridgeTaskConstMeta(
debugName: "start_kmeans_training",
argNames: ["img"],
);
Future<Uint8List> colorClusterer({required ImageData img, dynamic hint}) =>
_platform.executeNormal(FlutterRustBridgeTask(
callFfi: (port_) => _platform.inner.wire_color_clusterer(
port_, _platform.api2wire_box_autoadd_image_data(img)),
parseSuccessData: _wire2api_ZeroCopyBuffer_Uint8List,
constMeta: kColorClustererConstMeta,
argValues: [img],
hint: hint,
));
FlutterRustBridgeTaskConstMeta get kColorClustererConstMeta =>
const FlutterRustBridgeTaskConstMeta(
debugName: "color_clusterer",
argNames: ["img"],
);
Future<Uint8List> groundlineKMeans({required ImageData img, dynamic hint}) =>
_platform.executeNormal(FlutterRustBridgeTask(
callFfi: (port_) => _platform.inner.wire_groundline_k_means(
port_, _platform.api2wire_box_autoadd_image_data(img)),
parseSuccessData: _wire2api_ZeroCopyBuffer_Uint8List,
constMeta: kGroundlineKMeansConstMeta,
argValues: [img],
hint: hint,
));
FlutterRustBridgeTaskConstMeta get kGroundlineKMeansConstMeta =>
const FlutterRustBridgeTaskConstMeta(
debugName: "groundline_k_means",
argNames: ["img"],
);
Future<CorrelationFlow> getCorrelationFlow(
{required Uint8List prevYs,
required Uint8List currentYs,
required int width,
required int height,
dynamic hint}) =>
_platform.executeNormal(FlutterRustBridgeTask(
callFfi: (port_) => _platform.inner.wire_get_correlation_flow(
port_,
_platform.api2wire_uint_8_list(prevYs),
_platform.api2wire_uint_8_list(currentYs),
_platform.api2wire_i64(width),
_platform.api2wire_i64(height)),
parseSuccessData: _wire2api_correlation_flow,
constMeta: kGetCorrelationFlowConstMeta,
argValues: [prevYs, currentYs, width, height],
hint: hint,
));
FlutterRustBridgeTaskConstMeta get kGetCorrelationFlowConstMeta =>
const FlutterRustBridgeTaskConstMeta(
debugName: "get_correlation_flow",
argNames: ["prevYs", "currentYs", "width", "height"],
);
Future<void> resetPositionEstimate({dynamic hint}) =>
_platform.executeNormal(FlutterRustBridgeTask(
callFfi: (port_) => _platform.inner.wire_reset_position_estimate(port_),
parseSuccessData: _wire2api_unit,
constMeta: kResetPositionEstimateConstMeta,
argValues: [],
hint: hint,
));
FlutterRustBridgeTaskConstMeta get kResetPositionEstimateConstMeta =>
const FlutterRustBridgeTaskConstMeta(
debugName: "reset_position_estimate",
argNames: [],
);
Future<String> processSensorData(
{required String incomingData, dynamic hint}) =>
_platform.executeNormal(FlutterRustBridgeTask(
callFfi: (port_) => _platform.inner.wire_process_sensor_data(
port_, _platform.api2wire_String(incomingData)),
parseSuccessData: _wire2api_String,
constMeta: kProcessSensorDataConstMeta,
argValues: [incomingData],
hint: hint,
));
FlutterRustBridgeTaskConstMeta get kProcessSensorDataConstMeta =>
const FlutterRustBridgeTaskConstMeta(
debugName: "process_sensor_data",
argNames: ["incomingData"],
);
Future<SensorData> parseSensorData(
{required String incomingData, dynamic hint}) =>
_platform.executeNormal(FlutterRustBridgeTask(
callFfi: (port_) => _platform.inner.wire_parse_sensor_data(
port_, _platform.api2wire_String(incomingData)),
parseSuccessData: _wire2api_sensor_data,
constMeta: kParseSensorDataConstMeta,
argValues: [incomingData],
hint: hint,
));
FlutterRustBridgeTaskConstMeta get kParseSensorDataConstMeta =>
const FlutterRustBridgeTaskConstMeta(
debugName: "parse_sensor_data",
argNames: ["incomingData"],
);
// Section: wire2api
String _wire2api_String(dynamic raw) {
return raw as String;
}
Uint8List _wire2api_ZeroCopyBuffer_Uint8List(dynamic raw) {
return raw as Uint8List;
}
bool _wire2api_bool(dynamic raw) {
return raw as bool;
}
CorrelationFlow _wire2api_correlation_flow(dynamic raw) {
final arr = raw as List<dynamic>;
if (arr.length != 2)
throw Exception('unexpected arr length: expect 2 but see ${arr.length}');
return CorrelationFlow(
dx: _wire2api_i16(arr[0]),
dy: _wire2api_i16(arr[1]),
);
}
int _wire2api_i16(dynamic raw) {
return raw as int;
}
int _wire2api_i64(dynamic raw) {
return castInt(raw);
}
SensorData _wire2api_sensor_data(dynamic raw) {
final arr = raw as List<dynamic>;
if (arr.length != 7)
throw Exception('unexpected arr length: expect 7 but see ${arr.length}');
return SensorData(
sonarFront: _wire2api_i64(arr[0]),
sonarLeft: _wire2api_i64(arr[1]),
sonarRight: _wire2api_i64(arr[2]),
leftCount: _wire2api_i64(arr[3]),
rightCount: _wire2api_i64(arr[4]),
leftSpeed: _wire2api_i64(arr[5]),
rightSpeed: _wire2api_i64(arr[6]),
);
}
int _wire2api_u8(dynamic raw) {
return raw as int;
}
Uint8List _wire2api_uint_8_list(dynamic raw) {
return raw as Uint8List;
}
void _wire2api_unit(dynamic raw) {
return;
}
}
// Section: api2wire
@protected
int api2wire_u8(int raw) {
return raw;
}
class NativePlatform extends FlutterRustBridgeBase<NativeWire> {
NativePlatform(ffi.DynamicLibrary dylib) : super(NativeWire(dylib));
// Section: api2wire
@protected
ffi.Pointer<wire_uint_8_list> api2wire_String(String raw) {
return api2wire_uint_8_list(utf8.encoder.convert(raw));
}
@protected
ffi.Pointer<wire_ImageData> api2wire_box_autoadd_image_data(ImageData raw) {
final ptr = inner.new_box_autoadd_image_data_0();
_api_fill_to_wire_image_data(raw, ptr.ref);
return ptr;
}
@protected
int api2wire_i64(int raw) {
return raw;
}
@protected
ffi.Pointer<wire_uint_8_list> api2wire_uint_8_list(Uint8List raw) {
final ans = inner.new_uint_8_list_0(raw.length);
ans.ref.ptr.asTypedList(raw.length).setAll(0, raw);
return ans;
}
// Section: api_fill_to_wire
void _api_fill_to_wire_box_autoadd_image_data(
ImageData apiObj, ffi.Pointer<wire_ImageData> wireObj) {
_api_fill_to_wire_image_data(apiObj, wireObj.ref);
}
void _api_fill_to_wire_image_data(ImageData apiObj, wire_ImageData wireObj) {
wireObj.ys = api2wire_uint_8_list(apiObj.ys);
wireObj.us = api2wire_uint_8_list(apiObj.us);
wireObj.vs = api2wire_uint_8_list(apiObj.vs);
wireObj.width = api2wire_i64(apiObj.width);
wireObj.height = api2wire_i64(apiObj.height);
wireObj.uv_row_stride = api2wire_i64(apiObj.uvRowStride);
wireObj.uv_pixel_stride = api2wire_i64(apiObj.uvPixelStride);
}
}
// 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 NativeWire 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].
NativeWire(ffi.DynamicLibrary dynamicLibrary)
: _lookup = dynamicLibrary.lookup;
/// The symbols are looked up with [lookup].
NativeWire.fromLookup(
ffi.Pointer<T> Function<T extends ffi.NativeType>(String symbolName)
lookup)
: _lookup = lookup;
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)>();
void wire_kmeans_ready(
int port_,
) {
return _wire_kmeans_ready(
port_,
);
}
late final _wire_kmeans_readyPtr =
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64)>>(
'wire_kmeans_ready');
late final _wire_kmeans_ready =
_wire_kmeans_readyPtr.asFunction<void Function(int)>();
void wire_training_time(
int port_,
) {
return _wire_training_time(
port_,
);
}
late final _wire_training_timePtr =
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64)>>(
'wire_training_time');
late final _wire_training_time =
_wire_training_timePtr.asFunction<void Function(int)>();
void wire_intensity_rgba(
int port_,
ffi.Pointer<wire_uint_8_list> intensities,
) {
return _wire_intensity_rgba(
port_,
intensities,
);
}
late final _wire_intensity_rgbaPtr = _lookup<
ffi.NativeFunction<
ffi.Void Function(ffi.Int64,
ffi.Pointer<wire_uint_8_list>)>>('wire_intensity_rgba');
late final _wire_intensity_rgba = _wire_intensity_rgbaPtr
.asFunction<void Function(int, ffi.Pointer<wire_uint_8_list>)>();
void wire_yuv_rgba(
int port_,
ffi.Pointer<wire_ImageData> img,
) {
return _wire_yuv_rgba(
port_,
img,
);
}
late final _wire_yuv_rgbaPtr = _lookup<
ffi.NativeFunction<
ffi.Void Function(
ffi.Int64, ffi.Pointer<wire_ImageData>)>>('wire_yuv_rgba');
late final _wire_yuv_rgba = _wire_yuv_rgbaPtr
.asFunction<void Function(int, ffi.Pointer<wire_ImageData>)>();
void wire_color_count(
int port_,
ffi.Pointer<wire_ImageData> img,
) {
return _wire_color_count(
port_,
img,
);
}
late final _wire_color_countPtr = _lookup<
ffi.NativeFunction<
ffi.Void Function(
ffi.Int64, ffi.Pointer<wire_ImageData>)>>('wire_color_count');
late final _wire_color_count = _wire_color_countPtr
.asFunction<void Function(int, ffi.Pointer<wire_ImageData>)>();
void wire_groundline_sample_overlay(
int port_,
ffi.Pointer<wire_ImageData> img,
) {
return _wire_groundline_sample_overlay(
port_,
img,
);
}
late final _wire_groundline_sample_overlayPtr = _lookup<
ffi.NativeFunction<
ffi.Void Function(ffi.Int64,
ffi.Pointer<wire_ImageData>)>>('wire_groundline_sample_overlay');
late final _wire_groundline_sample_overlay =
_wire_groundline_sample_overlayPtr
.asFunction<void Function(int, ffi.Pointer<wire_ImageData>)>();
void wire_start_kmeans_training(
int port_,
ffi.Pointer<wire_ImageData> img,
) {
return _wire_start_kmeans_training(
port_,
img,
);
}
late final _wire_start_kmeans_trainingPtr = _lookup<
ffi.NativeFunction<
ffi.Void Function(ffi.Int64,
ffi.Pointer<wire_ImageData>)>>('wire_start_kmeans_training');
late final _wire_start_kmeans_training = _wire_start_kmeans_trainingPtr
.asFunction<void Function(int, ffi.Pointer<wire_ImageData>)>();
void wire_color_clusterer(
int port_,
ffi.Pointer<wire_ImageData> img,
) {
return _wire_color_clusterer(
port_,
img,
);
}
late final _wire_color_clustererPtr = _lookup<
ffi.NativeFunction<
ffi.Void Function(
ffi.Int64, ffi.Pointer<wire_ImageData>)>>('wire_color_clusterer');
late final _wire_color_clusterer = _wire_color_clustererPtr
.asFunction<void Function(int, ffi.Pointer<wire_ImageData>)>();
void wire_groundline_k_means(
int port_,
ffi.Pointer<wire_ImageData> img,
) {
return _wire_groundline_k_means(
port_,
img,
);
}
late final _wire_groundline_k_meansPtr = _lookup<
ffi.NativeFunction<
ffi.Void Function(ffi.Int64,
ffi.Pointer<wire_ImageData>)>>('wire_groundline_k_means');
late final _wire_groundline_k_means = _wire_groundline_k_meansPtr
.asFunction<void Function(int, ffi.Pointer<wire_ImageData>)>();
void wire_get_correlation_flow(
int port_,
ffi.Pointer<wire_uint_8_list> prev_ys,
ffi.Pointer<wire_uint_8_list> current_ys,
int width,
int height,
) {
return _wire_get_correlation_flow(
port_,
prev_ys,
current_ys,
width,
height,
);
}
late final _wire_get_correlation_flowPtr = _lookup<
ffi.NativeFunction<
ffi.Void Function(
ffi.Int64,
ffi.Pointer<wire_uint_8_list>,
ffi.Pointer<wire_uint_8_list>,
ffi.Int64,
ffi.Int64)>>('wire_get_correlation_flow');
late final _wire_get_correlation_flow =
_wire_get_correlation_flowPtr.asFunction<
void Function(int, ffi.Pointer<wire_uint_8_list>,
ffi.Pointer<wire_uint_8_list>, int, int)>();
void wire_reset_position_estimate(
int port_,
) {
return _wire_reset_position_estimate(
port_,
);
}
late final _wire_reset_position_estimatePtr =
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64)>>(
'wire_reset_position_estimate');
late final _wire_reset_position_estimate =
_wire_reset_position_estimatePtr.asFunction<void Function(int)>();
void wire_process_sensor_data(
int port_,
ffi.Pointer<wire_uint_8_list> incoming_data,
) {
return _wire_process_sensor_data(
port_,
incoming_data,
);
}
late final _wire_process_sensor_dataPtr = _lookup<
ffi.NativeFunction<
ffi.Void Function(ffi.Int64,
ffi.Pointer<wire_uint_8_list>)>>('wire_process_sensor_data');
late final _wire_process_sensor_data = _wire_process_sensor_dataPtr
.asFunction<void Function(int, ffi.Pointer<wire_uint_8_list>)>();
void wire_parse_sensor_data(
int port_,
ffi.Pointer<wire_uint_8_list> incoming_data,
) {
return _wire_parse_sensor_data(
port_,
incoming_data,
);
}
late final _wire_parse_sensor_dataPtr = _lookup<
ffi.NativeFunction<
ffi.Void Function(ffi.Int64,
ffi.Pointer<wire_uint_8_list>)>>('wire_parse_sensor_data');
late final _wire_parse_sensor_data = _wire_parse_sensor_dataPtr
.asFunction<void Function(int, ffi.Pointer<wire_uint_8_list>)>();
ffi.Pointer<wire_ImageData> new_box_autoadd_image_data_0() {
return _new_box_autoadd_image_data_0();
}
late final _new_box_autoadd_image_data_0Ptr =
_lookup<ffi.NativeFunction<ffi.Pointer<wire_ImageData> Function()>>(
'new_box_autoadd_image_data_0');
late final _new_box_autoadd_image_data_0 = _new_box_autoadd_image_data_0Ptr
.asFunction<ffi.Pointer<wire_ImageData> Function()>();
ffi.Pointer<wire_uint_8_list> new_uint_8_list_0(
int len,
) {
return _new_uint_8_list_0(
len,
);
}
late final _new_uint_8_list_0Ptr = _lookup<
ffi.NativeFunction<
ffi.Pointer<wire_uint_8_list> Function(
ffi.Int32)>>('new_uint_8_list_0');
late final _new_uint_8_list_0 = _new_uint_8_list_0Ptr
.asFunction<ffi.Pointer<wire_uint_8_list> Function(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)>();
}
class wire_uint_8_list extends ffi.Struct {
external ffi.Pointer<ffi.Uint8> ptr;
@ffi.Int32()
external int len;
}
class wire_ImageData extends ffi.Struct {
external ffi.Pointer<wire_uint_8_list> ys;
external ffi.Pointer<wire_uint_8_list> us;
external ffi.Pointer<wire_uint_8_list> vs;
@ffi.Int64()
external int width;
@ffi.Int64()
external int height;
@ffi.Int64()
external int uv_row_stride;
@ffi.Int64()
external int uv_pixel_stride;
}
typedef DartPostCObjectFnType = ffi.Pointer<
ffi.NativeFunction<ffi.Bool Function(DartPort, ffi.Pointer<ffi.Void>)>>;
typedef DartPort = ffi.Int64;
// AUTO GENERATED FILE, DO NOT EDIT.
// Generated by `flutter_rust_bridge`@ 1.49.0.
// 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, prefer_single_quotes, prefer_const_constructors, use_super_parameters, always_use_package_imports, annotate_overrides, invalid_use_of_protected_member, constant_identifier_names
import 'dart:convert';
import 'dart:async';
import 'package:flutter_rust_bridge/flutter_rust_bridge.dart';
abstract class Native {
Future<bool> kmeansReady({dynamic hint});
FlutterRustBridgeTaskConstMeta get kKmeansReadyConstMeta;
Future<int> trainingTime({dynamic hint});
FlutterRustBridgeTaskConstMeta get kTrainingTimeConstMeta;
Future<Uint8List> intensityRgba(
{required Uint8List intensities, dynamic hint});
FlutterRustBridgeTaskConstMeta get kIntensityRgbaConstMeta;
Future<Uint8List> yuvRgba({required ImageData img, dynamic hint});
FlutterRustBridgeTaskConstMeta get kYuvRgbaConstMeta;
Future<int> colorCount({required ImageData img, dynamic hint});
FlutterRustBridgeTaskConstMeta get kColorCountConstMeta;
Future<Uint8List> groundlineSampleOverlay(
{required ImageData img, dynamic hint});
FlutterRustBridgeTaskConstMeta get kGroundlineSampleOverlayConstMeta;
Future<void> startKmeansTraining({required ImageData img, dynamic hint});
FlutterRustBridgeTaskConstMeta get kStartKmeansTrainingConstMeta;
Future<Uint8List> colorClusterer({required ImageData img, dynamic hint});
FlutterRustBridgeTaskConstMeta get kColorClustererConstMeta;
Future<Uint8List> groundlineKMeans({required ImageData img, dynamic hint});
FlutterRustBridgeTaskConstMeta get kGroundlineKMeansConstMeta;
Future<CorrelationFlow> getCorrelationFlow(
{required Uint8List prevYs,
required Uint8List currentYs,
required int width,
required int height,
dynamic hint});
FlutterRustBridgeTaskConstMeta get kGetCorrelationFlowConstMeta;
Future<void> resetPositionEstimate({dynamic hint});
FlutterRustBridgeTaskConstMeta get kResetPositionEstimateConstMeta;
Future<String> processSensorData(
{required String incomingData, dynamic hint});
FlutterRustBridgeTaskConstMeta get kProcessSensorDataConstMeta;
Future<SensorData> parseSensorData(
{required String incomingData, dynamic hint});
FlutterRustBridgeTaskConstMeta get kParseSensorDataConstMeta;
}
class CorrelationFlow {
final int dx;
final int dy;
CorrelationFlow({
required this.dx,
required this.dy,
});
}
class ImageData {
final Uint8List ys;
final Uint8List us;
final Uint8List vs;
final int width;
final int height;
final int uvRowStride;
final int uvPixelStride;
ImageData({
required this.ys,
required this.us,
required this.vs,
required this.width,
required this.height,
required this.uvRowStride,
required this.uvPixelStride,
});
}
class SensorData {
final int sonarFront;
final int sonarLeft;
final int sonarRight;
final int leftCount;
final int rightCount;
final int leftSpeed;
final int rightSpeed;
SensorData({
required this.sonarFront,
required this.sonarLeft,
required this.sonarRight,
required this.leftCount,
required this.rightCount,
required this.leftSpeed,
required this.rightSpeed,
});
}
OS
Windows
Version of flutter_rust_bridge_codegen
1.53.0
Flutter info
PS C:\Users\ferrer\AndroidStudioProjects\groundline> flutter doctor -v
[√] Flutter (Channel stable, 3.3.9, on Microsoft Windows [Version 10.0.19043.1288], locale en-US)
• Flutter version 3.3.9 on channel stable at C:\Users\ferrer\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision b8f7f1f986 (2 weeks ago), 2022-11-23 06:43:51 +0900
• Engine revision 8f2221fbef
• Dart version 2.18.5
• DevTools version 2.15.0
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at C:\Users\ferrer\AppData\Local\Android\Sdk
• Platform android-33, build-tools 30.0.3
• ANDROID_HOME = C:\Users\ferrer\AppData\Local\Android\Sdk
• Java binary at: C:\Program Files\Android\Android Studio1\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.3.6)
• Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
• Visual Studio Community 2019 version 16.3.29418.71
• Windows 10 SDK version 10.0.18362.0
[!] Android Studio (version 3.5)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 44.0.1
• Dart plugin version 191.8593
X Unable to determine bundled Java version.
• Try updating or re-installing Android Studio.
[√] Android Studio (version 2021.2)
• Android Studio at C:\Program Files\Android\Android Studio1
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)
[√] IntelliJ IDEA Community Edition (version 2022.2)
• IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2022.2.2
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
[√] VS Code, 64-bit edition (version 1.73.1)
• VS Code at C:\Program Files\Microsoft VS Code
• Flutter extension can be installed from:
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[√] Connected device (4 available)
• KFAUWI (mobile) • G0W0MA078282F7EP • android-arm • Android 5.1.1 (API 22)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19043.1288]
• Chrome (web) • chrome • web-javascript • Google Chrome 108.0.5359.71
• Edge (web) • edge • web-javascript • Microsoft Edge 107.0.1418.62
[√] HTTP Host Availability
• All required HTTP hosts are available
! Doctor found issues in 1 category.
PS C:\Users\ferrer\AndroidStudioProjects\groundline>
Version of clang++
No response
Version of ffigen
7.2.2
Additional context
No response
bug