package mirage-types

  1. Overview
  2. Docs

Device operations. Defines the functions to connect and disconnect any device

type +'a io

A potentially blocking I/O operation

type t

The type representing the internal state of the device

type error

An error signalled by the device, normally returned after a connection attempt

type id

Type defining an identifier for this device that uniquely identifies it among a device tree.

val id : t -> id

Return the identifier that was used to construct this device

val connect : id -> [ `Error of error | `Ok of t ] io

Connect to the device identified by id

val disconnect : t -> unit io

Disconnect from the device. While this might take some time to complete, it can never result in an error.

OCaml

Innovation. Community. Security.