toJson method

Map<String, Object?> toJson()

The json representation of this LinkMode.

The returned json is stable and can be used in LinkMode.fromJson to obtain a LinkMode again.

Implementation

Map<String, Object?> toJson() => switch (this) {
      StaticLinking() => {'type': 'static'},
      LookupInProcess() => {'type': 'dynamic_loading_process'},
      LookupInExecutable() => {'type': 'dynamic_loading_executable'},
      DynamicLoadingBundled() => {'type': 'dynamic_loading_bundle'},
      final DynamicLoadingSystem system => {
          'type': 'dynamic_loading_system',
          'uri': system.uri.toFilePath(),
        },
      _ => throw UnimplementedError('The link mode "$this" is not known'),
    };