setResourceTransform method

Future<CommandCompletion> setResourceTransform(
  1. ResourceTransform transform
)

Rewrites the URLs of the runtime's network requests.

The transform replaces the one set before.

See mln_runtime_set_resource_transform in the C API reference.

Implementation

Future<CommandCompletion> setResourceTransform(ResourceTransform transform) =>
    _command((arena, completion) {
      final registrations = _NativeRegistrations(_callbackRoots);
      return registrations.run(
        () => raw.mln_runtime_set_resource_transform(
          _handle.raw,
          registrations.add(
            _prepareResourceTransform(transform, registrations.roots),
          ),
          completion,
          nativeDiagnostic,
        ),
      );
    });