run<T> static method

MyBootstrapTask run<T>(
  1. Future<T> body(), {
  2. MyBootstrapSeverity severity = MyBootstrapSeverity.degraded,
  3. String? debugLabel,
})

任意会完成的工作。返回类型由闭包推断,不会预先钉成 void

Implementation

static MyBootstrapTask run<T>(
  Future<T> Function() body, {
  MyBootstrapSeverity severity = MyBootstrapSeverity.degraded,
  String? debugLabel,
}) {
  return MyBootstrapTask._(
    () => _executeGuarded(body),
    severity: severity,
    debugLabel: debugLabel,
  );
}