Skip to main content

_msrtc_rans/
lib.rs

1// Licensed under the MIT license.
2// Author: Riaan de Beer - github.com/infinityabundance - rdebeer.infinityabundance@gmail.com
3
4//! # msrtc-rans-python
5//!
6//! Python extension module `_msrtc_rans` providing the msrtc.rans Python API.
7//!
8//! This crate uses PyO3 to create a CPython extension module that is
9//! import-path-compatible with the existing `msrtc.rans` package.
10//!
11//! ## Safety
12//!
13//! This crate uses `unsafe` for PyO3 FFI interactions (required by the
14//! Python C API). All unsafe is contained in the PyO3-generated bindings.
15
16#![allow(missing_docs)]
17
18use pyo3::prelude::*;
19
20/// Python module for msrtc rANS implementation.
21#[pymodule]
22fn _msrtc_rans(_py: Python, m: &Bound<'_, PyModule>) -> PyResult<()> {
23    m.add("__version__", env!("CARGO_PKG_VERSION"))?;
24    Ok(())
25}