Eio.StdenvSourceThe standard environment of a process.
All access to the outside world comes from running the event loop, which provides a t.
Example:
let () =
Eio_main.run @@ fun env ->
Eio.Path.with_open_dir env#fs "/srv/www" @@ fun www ->
serve_files www
~net:env#nettype t =
< stdin : Flow.source
; stdout : Flow.sink
; stderr : Flow.sink
; net : Net.t
; domain_mgr : Domain_manager.t
; clock : Time.clock
; mono_clock : Time.Mono.t
; fs : Fs.dir Path.t
; cwd : Fs.dir Path.t
; secure_random : Flow.source
; debug : Debug.t >To use these, see Flow.
To use these, see Path.
cwd t is the current working directory of the process (this may change over time if the process does a "chdir" operation, which is not recommended).
fs t is the process's full access to the filesystem.
Paths can be absolute or relative (to the current working directory). Using relative paths with this is similar to using them with cwd, except that this will follow ".." and symlinks to other parts of the filesystem.
fs is useful for handling paths passed in by the user.
To use this, see Net.
To use this, see Domain_manager.
domain_mgr t allows running code on other cores.
To use this, see Time.
clock t is the system clock (used to get the current time and date).
mono_clock t is a monotonic clock (used for measuring intervals).
secure_random t is an infinite source of random bytes suitable for cryptographic purposes.