You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Solution: Convert rust Option<()> to dart bool, where true represents Ok(()) and false represents None.
Steps to reproduce
Create functions like in the description.
Logs
line 136, column 16 of lib/src/rust/frb_generated.io.dart: Operator declarations must be preceded by the keyword 'operator'.
╷
136 │ @protected void? dco_decode_opt_box_autoadd_unit(dynamic raw);
│ ^
╵
line 136, column 16 of lib/src/rust/frb_generated.io.dart: The string '?' isn't a user-definable operator. ╷136 │ @protected void? dco_decode_opt_box_autoadd_unit(dynamic raw); │ ^ ╵line 136, column 16 of lib/src/rust/frb_generated.io.dart: Methods must have an explicit list of parameters. ╷136 │ @protected void? dco_decode_opt_box_autoadd_unit(dynamic raw); │ ^ ╵line 136, column 18 of lib/src/rust/frb_generated.io.dart: A function body must be provided. ╷136 │ @protected void? dco_decode_opt_box_autoadd_unit(dynamic raw); │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ╵line 246, column 16 of lib/src/rust/frb_generated.io.dart: Operator declarations must be preceded by the keyword 'operator'. ╷246 │ @protected void? sse_decode_opt_box_autoadd_unit(SseDeserializer deserializer); │ ^ ╵line 246, column 16 of lib/src/rust/frb_generated.io.dart: The string '?' isn't a user-definable operator.
╷
246 │ @protected void? sse_decode_opt_box_autoadd_unit(SseDeserializer deserializer);
│ ^
╵
line 246, column 16 of lib/src/rust/frb_generated.io.dart: Methods must have an explicit list of parameters.
╷
246 │ @protected void? sse_decode_opt_box_autoadd_unit(SseDeserializer deserializer);
│ ^
╵
line 246, column 18 of lib/src/rust/frb_generated.io.dart: A functionbody must be provided.
╷
246 │ @protected void? sse_decode_opt_box_autoadd_unit(SseDeserializer deserializer);
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
╵
line 358, column 53 of lib/src/rust/frb_generated.io.dart: Expected an identifier.
╷
358 │ @protected void sse_encode_opt_box_autoadd_unit(void? self, SseSerializer serializer);
│ ^
╵
line 358, column 55 of lib/src/rust/frb_generated.io.dart: Expected to find ')'.
╷
358 │ @protected void sse_encode_opt_box_autoadd_unit(void? self, SseSerializer serializer);
│ ^^^^
╵
Could not format because the source could not be parsed:
line 20, column 29 of lib/src/rust/api/vehicle/motor_testing.dart: Expected to find '>'.
╷
20 │ Future<void?>close();
│ ^^^^
╵
line 23, column 9 of lib/src/rust/api/vehicle/motor_testing.dart: Expected to find '>'.
╷
23 │ Future<void?> setMotor({required int idx , required double pct , required bool rev });
│ ^^^^
╵
Could not format because the source could not be parsed:
line 112, column 8 of lib/src/rust/frb_generated.dart: Expected to find '>'.
╷
112 │ Future<void?> crateApiVehicleMotorTestingMotorTestManagerClose({required MotorTestManager that });
│ ^^^^
╵
line 114, column 8 of lib/src/rust/frb_generated.dart: Expected to find '>'.
╷
114 │ Future<void?> crateApiVehicleMotorTestingMotorTestManagerSetMotor({required MotorTestManager that , required int idx , required double pct , required bool rev });
│ ^^^^
╵
line 544, column 18 of lib/src/rust/frb_generated.dart: Expected to find '>'.
╷
544 │ @override Future<void?> crateApiVehicleMotorTestingMotorTestManagerClose({required MotorTestManager that }) { return handler.executeNormal(NormalTask(
│ ^^^^
╵
line 569, column 18 of lib/src/rust/frb_generated.dart: Expected to find '>'.
╷
569 │ @override Future<void?> crateApiVehicleMotorTestingMotorTestManagerSetMotor({required MotorTestManager that , required int idx , required double pct , required bool rev }) { return handler.executeNormal(NormalTask(
│ ^^^^
╵
line 1310, column 15 of lib/src/rust/frb_generated.dart: Expected a type name.
╷
1310 │ return raw as void; }
│ ^^^^
╵
line 1361, column 16 of lib/src/rust/frb_generated.dart: Operator declarations must be preceded by the keyword 'operator'.
╷
1361 │ @protected void? dco_decode_opt_box_autoadd_unit(dynamic raw){ // Codec=Dco (DartCObject based), see doc to use other codecs
│ ^
╵
line 1361, column 16 of lib/src/rust/frb_generated.dart: The string '?' isn't a user-definable operator. ╷1361 │ @protected void? dco_decode_opt_box_autoadd_unit(dynamic raw){ // Codec=Dco (DartCObject based), see doc to use other codecs │ ^ ╵line 1361, column 16 of lib/src/rust/frb_generated.dart: Methods must have an explicit list of parameters. ╷1361 │ @protected void? dco_decode_opt_box_autoadd_unit(dynamic raw){ // Codec=Dco (DartCObject based), see doc to use other codecs │ ^ ╵line 1361, column 18 of lib/src/rust/frb_generated.dart: A function body must be provided. ╷1361 │ @protected void? dco_decode_opt_box_autoadd_unit(dynamic raw){ // Codec=Dco (DartCObject based), see doc to use other codecs │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ╵line 1586, column 16 of lib/src/rust/frb_generated.dart: Operator declarations must be preceded by the keyword 'operator'. ╷1586 │ @protected void? sse_decode_opt_box_autoadd_unit(SseDeserializer deserializer){ // Codec=Sse (Serialization based), see doc to use other codecs │ ^ ╵(7 more errors...)Could not format because the source could not be parsed:line 139, column 16 of lib/src/rust/frb_generated.web.dart: Operator declarations must be preceded by the keyword 'operator'. ╷139 │ @protected void? dco_decode_opt_box_autoadd_unit(dynamic raw); │ ^ ╵line 139, column 16 of lib/src/rust/frb_generated.web.dart: The string '?' isn't a user-definable operator.
╷
139 │ @protected void? dco_decode_opt_box_autoadd_unit(dynamic raw);
│ ^
╵
line 139, column 16 of lib/src/rust/frb_generated.web.dart: Methods must have an explicit list of parameters.
╷
139 │ @protected void? dco_decode_opt_box_autoadd_unit(dynamic raw);
│ ^
╵
line 139, column 18 of lib/src/rust/frb_generated.web.dart: A functionbody must be provided.
╷
139 │ @protected void? dco_decode_opt_box_autoadd_unit(dynamic raw);
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
╵
line 249, column 16 of lib/src/rust/frb_generated.web.dart: Operator declarations must be preceded by the keyword 'operator'.
╷
249 │ @protected void? sse_decode_opt_box_autoadd_unit(SseDeserializer deserializer);
│ ^
╵
line 249, column 16 of lib/src/rust/frb_generated.web.dart: The string '?' isn't a user-definable operator. ╷249 │ @protected void? sse_decode_opt_box_autoadd_unit(SseDeserializer deserializer); │ ^ ╵line 249, column 16 of lib/src/rust/frb_generated.web.dart: Methods must have an explicit list of parameters. ╷249 │ @protected void? sse_decode_opt_box_autoadd_unit(SseDeserializer deserializer); │ ^ ╵line 249, column 18 of lib/src/rust/frb_generated.web.dart: A function body must be provided. ╷249 │ @protected void? sse_decode_opt_box_autoadd_unit(SseDeserializer deserializer); │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ╵line 361, column 53 of lib/src/rust/frb_generated.web.dart: Expected an identifier. ╷361 │ @protected void sse_encode_opt_box_autoadd_unit(void? self, SseSerializer serializer); │ ^ ╵line 361, column 55 of lib/src/rust/frb_generated.web.dart: Expected to find ')'. ╷361 │ @protected void sse_encode_opt_box_autoadd_unit(void? self, SseSerializer serializer); │ ^^^^ ╵)
Expected behavior
Option<()> -> bool
Generated binding code
No response
OS
No response
Version of flutter_rust_bridge_codegen
No response
Flutter info
No response
Version of clang++
No response
Additional context
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
Rust type:
pub async fn set_motor(&self, idx: u8, pct: f32, rev: bool) -> Option<()>
Dart type:
Future<void?> setMotor({required int idx , required double pct , required bool rev });
Solution: Convert rust Option<()> to dart bool, where true represents Ok(()) and false represents None.
Steps to reproduce
Create functions like in the description.
Logs
Expected behavior
Option<()> -> bool
Generated binding code
No response
OS
No response
Version of
flutter_rust_bridge_codegen
No response
Flutter info
No response
Version of
clang++
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: