Skip to content

miniproto_native

Bundled PyO3 acceleration module for miniproto.

Python imports this crate as miniproto._native for cryptography, encrypted MTProto envelopes, selected TL codecs and TCP framing. Python wrappers select these functions or their fallbacks per operation.

  • crypto — Registers cryptographic Python callables.
  • generated_tl — Generated TL constructor metadata and field specifications.
  • mtproto — Registers encrypted MTProto message-envelope callables.
  • tl — Registers primitive and generated fast-path TL codec callables.
  • transport — Registers TCP transport framing callables and the stateful codec class.
fn _native(m: &Bound<'_, pyo3::types::PyModule>) -> PyResult<()>

Defined in rust/miniproto/src/lib.rs:29-35

Initializes Python module miniproto._native.

gil_used = false declares support for free-threaded Python. Python-object access still requires an attached thread, which holds the GIL on GIL-enabled builds. Selected exports detach for native work. Registration errors propagate as Python exceptions.

  • m: The newly-created miniproto._native Python module receiving the registered exports.