API#

xNVMe provides libxnvme, a systems-level library implemented in C, with library bindings available in Python and Rust.

The C section starts with technical details on using the library header. It is followed by subsections that overview the Core abstractions, and additional layers such as NVMe and File. It also includes supplemental helpers and convenience functions found in Command-line Interface (CLI) and Utilities, as well as practical API Code Examples.

../_images/core_api.png
Core

The encapsulates variation in system interfaces, drivers, transports, etc. and provides unified mechanics to:

  • Enumerate devices on a system and obtaining device handles

    • Including device identifiers and open options

  • Construct, submit and process commands

    • Synchronous/blocking

    • Asynchronous/non-blocking via a queue and callback primitive

  • Memory management primitives for command buffers

NVMe

This section consists of the part of xNVMe that strictly adheres to NVMe specifications. This includes definitions of data structures for commands, identify-results, log pages, etc., as well as helpers to form commands, access, and pretty-print data structures.

File

This section describes file-related functionalities within xNVMe.

Command-line Interface (CLI)

This section covers the command-line interface (CLI) functionalities of xNVMe.

Utilities

This portion covers Utilities, which consists of helpers and convenience functions for general applicability, such as XNVME_DEBUG, wall-clock timers, library introspection for version and capabilities, etc.

In addition to navigating the API documentation via the navigation bars on the left and right, the search box is a useful way to quickly look up a function from the API. Additionally, the code uses doxygen-compatible descriptions for your editor/LSP to conveniently pick up.