orthanc_api
[!CAUTION] Work in progress. Please reach out via GitHub or Matrix if you're using this crate! It would motivate me to complete the missing features.
Rust package defining types for Orthanc REST API requests and responses.
Motivation
Orthanc has an OpenAPI schema from which we can generate model code automatically, e.g. see orthanc_client_ogen. The type definitions here supplement the OpenAPI specification where response models are untyped. Furthermore, the handwritten definitions are more precise and idiomatic than what can be expressed using OpenAPI.
Features
- Type-safe deserialization of complex enums
not covered by Orthanc's OpenAPI specification, e.g.
orthanc_api::JobInfo
. - Use of nutype
- Related types are associated each other using traits: e.g. the trait implementation
of
DicomResourceId
forSeriesId
(1) associates it withSeries
, which contains detailed information about a DICOM series, and (2) denotes its ancestor type asStudyId
because a DICOM study is a set of DICOM series. - This crate is sans-IO: it describes API types, but it does not implement communication with Orthanc. It can be built upon to provide an HTTP client for Orthanc (not implemented) or to be used in developing an Orthanc plugin that speaks to the built-in API (see orthanc_sdk).