executeSync<S, E extends Object> method
Similar to executeNormal
, except that this will return synchronously
Implementation
@protected
S executeSync<S, E extends Object>(FlutterRustBridgeSyncTask<S, E> task) {
final WireSyncReturn syncReturn;
try {
syncReturn = task.callFfi();
} catch (err, st) {
throw PanicException('EXECUTE_SYNC_ABORT $err $st');
}
try {
final syncReturnAsDartObject = wireSyncReturnIntoDart(syncReturn);
return _transformRust2DartMessage(syncReturnAsDartObject,
task.parseSuccessData, task.parseErrorData, wire2apiPanicError);
} catch (err) {
rethrow;
} finally {
inner.free_WireSyncReturn(syncReturn);
}
}