package mirage-types

  1. Overview
  2. Docs

KV RO

Static Key/value store.

type error =
  1. | Unknown_key of string
include V1.DEVICE with type error := error with type 'a io = 'a Lwt.t
type 'a io = 'a Lwt.t

A potentially blocking I/O operation

type t

The type representing the internal state of the device

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.

type page_aligned_buffer = Cstruct.t

Abstract type for a page-aligned memory buffer

val read : t -> string -> int -> int -> [ `Ok of page_aligned_buffer list | `Error of error ] io

read t key offset length reads up to length bytes from the value associated with key. If less data is returned than requested, this indicates the end of the value.

val size : t -> string -> [ `Error of error | `Ok of int64 ] io

Get the value size.

OCaml

Innovation. Community. Security.