Skip to content

miniproto_native

  • Crate: miniproto_native
  • Rust visibility: public
  • Source: rust/miniproto/src/lib.rs
  • Python exposure: Not evidenced by static PyO3 attributes.

Bundled PyO3 acceleration module for miniproto.

Python imports this crate as miniproto._native. It registers native implementations for cryptographic primitives, encrypted MTProto envelopes, selected TL codecs, and TCP transport framing. These routines are an optional acceleration layer: the Python package owns the public fallback policy and must remain correct when this extension cannot be imported.

ItemKindDescription
cryptomodRegisters cryptographic Python callables.
generated_tlmodGenerated TL constructor metadata and field specifications.
mtprotomodRegisters encrypted MTProto message-envelope callables.
tlmodRegisters primitive and generated fast-path TL codec callables.
transportmodRegisters TCP transport framing callables and the stateful codec class.
_nativefnInitializes Python module miniproto._native.
  • 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:34-40

Initializes Python module miniproto._native.

PyO3 declares this module usable without the GIL (gil_used = false), but individual exports still acquire or release it as required by their Python-object interactions. Returns a Python exception if any submodule registration fails.

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