package mirage-block-lwt

  1. Overview
  2. Docs
include S
type page_aligned_buffer = Cstruct.t
type error = private [>
  1. | Mirage_device.error
]
val pp_error : error Fmt.t
type write_error = private [>
  1. | `Disconnected
  2. | `Is_read_only
  3. | `Unimplemented
]
val pp_write_error : write_error Fmt.t
type 'a io = 'a Lwt.t
type t
val disconnect : t -> unit io
val get_info : t -> Mirage_block.info io
val read : t -> int64 -> page_aligned_buffer list -> (unit, error) Stdlib.result io
val write : t -> int64 -> page_aligned_buffer list -> (unit, write_error) Stdlib.result io
val seek_unmapped : t -> int64 -> (int64, error) Result.result io

seek_unmapped t start returns the sector offset of the next guaranteed zero-filled region (typically guaranteed because it is unmapped)

val seek_mapped : t -> int64 -> (int64, error) Result.result io

seek_mapped t start returns the sector offset of the next regoin of the device which may have data in it (typically this is the next mapped region)

OCaml

Innovation. Community. Security.