runZoned<R> static method

R runZoned<R>(
  1. R body(
      ),
    1. {Directory createDirectory(
      1. String
      )?,
    2. Directory getCurrentDirectory(
        )?,
      1. void setCurrentDirectory(
        1. String
        )?,
      2. Directory getSystemTempDirectory(
          )?,
        1. File createFile(
          1. String
          )?,
        2. Future<FileStat> stat(
          1. String
          )?,
        3. FileStat statSync(
          1. String
          )?,
        4. Future<bool> fseIdentical(
          1. String,
          2. String
          )?,
        5. bool fseIdenticalSync(
          1. String,
          2. String
          )?,
        6. Future<FileSystemEntityType> fseGetType(
          1. String,
          2. bool
          )?,
        7. FileSystemEntityType fseGetTypeSync(
          1. String,
          2. bool
          )?,
        8. Stream<FileSystemEvent> fsWatch(
          1. String,
          2. int,
          3. bool
          )?,
        9. bool fsWatchIsSupported(
            )?,
          1. Link createLink(
            1. String
            )?,
          2. Future<Socket> socketConnect(
            1. dynamic,
            2. int,
            3. {dynamic sourceAddress,
            4. int sourcePort,
            5. Duration? timeout}
            )?,
          3. Future<ConnectionTask<Socket>> socketStartConnect(
            1. dynamic,
            2. int,
            3. {dynamic sourceAddress,
            4. int sourcePort}
            )?,
          4. Future<ServerSocket> serverSocketBind(
            1. dynamic,
            2. int,
            3. {int backlog,
            4. bool shared,
            5. bool v6Only}
            )?,
          5. Stdin stdin(
              )?,
            1. Stdout stdout(
                )?,
              1. Stdout stderr(
                  )?}
                )

                Runs body in a fresh Zone using the provided overrides.

                See the documentation on the corresponding methods of IOOverrides for information about what the optional arguments do.

                Implementation

                static R runZoned<R>(R body(),
                    {
                    // Directory
                    Directory Function(String)? createDirectory,
                    Directory Function()? getCurrentDirectory,
                    void Function(String)? setCurrentDirectory,
                    Directory Function()? getSystemTempDirectory,
                
                    // File
                    File Function(String)? createFile,
                
                    // FileStat
                    Future<FileStat> Function(String)? stat,
                    FileStat Function(String)? statSync,
                
                    // FileSystemEntity
                    Future<bool> Function(String, String)? fseIdentical,
                    bool Function(String, String)? fseIdenticalSync,
                    Future<FileSystemEntityType> Function(String, bool)? fseGetType,
                    FileSystemEntityType Function(String, bool)? fseGetTypeSync,
                
                    // _FileSystemWatcher
                    Stream<FileSystemEvent> Function(String, int, bool)? fsWatch,
                    bool Function()? fsWatchIsSupported,
                
                    // Link
                    Link Function(String)? createLink,
                
                    // Socket
                    Future<Socket> Function(dynamic, int,
                            {dynamic sourceAddress, int sourcePort, Duration? timeout})?
                        socketConnect,
                    Future<ConnectionTask<Socket>> Function(dynamic, int,
                            {dynamic sourceAddress, int sourcePort})?
                        socketStartConnect,
                
                    // ServerSocket
                    Future<ServerSocket> Function(dynamic, int,
                            {int backlog, bool v6Only, bool shared})?
                        serverSocketBind,
                
                    // Standard Streams
                    Stdin Function()? stdin,
                    Stdout Function()? stdout,
                    Stdout Function()? stderr}) {
                  IOOverrides overrides = new _IOOverridesScope(
                    // Directory
                    createDirectory,
                    getCurrentDirectory,
                    setCurrentDirectory,
                    getSystemTempDirectory,
                
                    // File
                    createFile,
                
                    // FileStat
                    stat,
                    statSync,
                
                    // FileSystemEntity
                    fseIdentical,
                    fseIdenticalSync,
                    fseGetType,
                    fseGetTypeSync,
                
                    // _FileSystemWatcher
                    fsWatch,
                    fsWatchIsSupported,
                
                    // Link
                    createLink,
                
                    // Socket
                    socketConnect,
                    socketStartConnect,
                
                    // ServerSocket
                    serverSocketBind,
                
                    // Standard streams
                    stdin,
                    stdout,
                    stderr,
                  );
                  return _asyncRunZoned<R>(body, zoneValues: {_ioOverridesToken: overrides});
                }