package mirage
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=ade8c410b2de3997c4a513f53f6c990dac6af508161e20df01b64fa7975ca5be
sha512=42fddf09be84c4251417145b88d4f63b41db1b29c9622b2b4e4508e31146f227a16875e670da96251208745f79a42f0b7d2bd8b44b883a705381b4c97a4255b8
doc/mirage.functoria/Functoria/Device/index.html
Module Functoria.Device
Source
Signature for functoria devices. A device
is a module implementation which contains a runtime state which can be set either at configuration time (by the application builder) or at runtime, using command-line arguments.
The type for devices whose runtime state is of type 'a
and having extra data-dependencies of type 'b
.
packages t
is the list of OPAM packages that are needed by t
.
install t i
is the list of files installed by t
, using the build information i
.
extra_deps t
is the list of dependencies that be initialized before running the code generated by connect t
.
id t
is t
's unique identifier. Freshly generated for each call to v
.
pp pp_dep
is the pretty-printer for devices, using pp_dep
to pretty-print the extra data-dependencies.
witness a b
provides an equality witness.
Resources
files t info s
is the list of files generated configure-time.
keys t
is the list of keys which can be used to configure t
.
runtime_args t
is the list of command-line arguments which can be used to configure t
at runtime.
Code Generation
The type for fragments of code of type 'a
.
val code :
pos:(string * int * int * int) ->
('a, Format.formatter, unit, 'b code) format4 ->
'a
Generate localised code.
connect t info impl_name args
is the code to execute in order to create a new state (usually calling <module_name t>.connect
) with the arguments args
, in the context of the project information info
. The freshly created state will be made available in var_name t
start ?pos impl_name args
is the code <impl_name>.start <args>
.
nice_name d
provides a identifier unique to d
which is a valid OCaml identifier.
Actions
dune t info
are the dune stanza which needs to be generated to build the application.
Configuration
configure t info
is configure hook for t
the device and the files it generates. During the configure phase, you cannot rely on packages t
being installed.
To run code during the build
phase, generate a dune
fragment instead.
Constructors
val v :
?packages:Package.t list ->
?packages_v:Package.t list Key.value ->
?install:(Info.t -> Install.t) ->
?install_v:(Info.t -> Install.t Key.value) ->
?keys:Key.t list ->
?runtime_args:Runtime_arg.t list ->
?extra_deps:'b list ->
?connect:(Info.t -> string -> string list -> 'a code) ->
?dune:(Info.t -> Dune.stanza list) ->
?configure:(Info.t -> unit Action.t) ->
?files:(Info.t -> Fpath.t list) ->
string ->
'a Type.t ->
('a, 'b) t