validateWasm method
Future<Result<WasmType, ParserError> >
validateWasm({
- required WasmInput input,
- WasmFeatures? features,
Implementation
Future<Result<WasmType, ParserError>> validateWasm({
required WasmInput input,
WasmFeatures? features,
}) async {
final results = await _validateWasm([
input.toWasm(),
(features == null
? const None().toWasm()
: Option.fromValue(features).toWasm((some) => some.toWasm()))
]);
final result = results[0];
return withContext(() => Result.fromJson(
result,
(ok) => WasmType.fromJson(ok),
(error) => error is String ? error : (error! as ParsedString).value));
}