getInstances method

Future<InstanceSet> getInstances(
  1. String isolateId,
  2. String objectId,
  3. int limit,
  4. {bool? includeSubclasses,
  5. bool? includeImplementers}

The getInstances RPC is used to retrieve a set of instances which are of a specific class.

The order of the instances is undefined (i.e., not related to allocation order) and unstable (i.e., multiple invocations of this method against the same class can give different answers even if no Dart code has executed between the invocations).

The set of instances may include objects that are unreachable but have not yet been garbage collected.

objectId is the ID of the Class to retrieve instances for. objectId must be the ID of a Class, otherwise an RPCError is returned.

limit is the maximum number of instances to be returned.

If includeSubclasses is true, instances of subclasses of the specified class will be included in the set.

If includeImplementers is true, instances of implementers of the specified class will be included in the set. Note that subclasses of a class are also considered implementers of that class.

If isolateId refers to an isolate which has exited, then the Collected Sentinel is returned.

See InstanceSet.

This method will throw a SentinelException in the case a Sentinel is returned.


Future<InstanceSet> getInstances(
  String isolateId,
  String objectId,
  int limit, {
  bool? includeSubclasses,
  bool? includeImplementers,
}) =>
    _call('getInstances', {
      'isolateId': isolateId,
      'objectId': objectId,
      'limit': limit,
      if (includeSubclasses != null) 'includeSubclasses': includeSubclasses,
      if (includeImplementers != null)
        'includeImplementers': includeImplementers,