Skip to content

miniproto.tl.fast.decode_fast

decode_fast(constructor_id: int, data: bytes | memoryview, offset: int = 0, *, boxed: bool = True) -> tuple[tuple[object, ...], int] | None

Attempt native deserialization for a generated TL constructor.

Parameters:

  • constructor_id (int) – Unsigned 32-bit TL constructor identifier.
  • data (bytes | memoryview) – Wire bytes; memoryviews deliberately use the Python path.
  • offset (int) – Initial byte offset, defaulting to 0.
  • boxed (bool) – Whether the input includes a constructor identifier.

Returns:

  • tuple[tuple[object, …], int] | None – Decoded field values and next offset, or None when no fast path applies.