Skip to content

miniproto_native::tl::tl_decode_string

  • Crate: miniproto_native
  • Rust visibility: restricted
  • Source: rust/miniproto/src/tl.rs
  • Python exposure: miniproto._native.tl_decode_string (confirmed from adjacent PyO3 attributes)
fn tl_decode_string(data: &[u8], offset: usize) -> _
  • data: TL bytes containing one length-prefixed string field.
  • offset: Byte offset at which the field starts.
fn tl_decode_string(data: &[u8], offset: usize) -> PyResult<(String, usize)>

Defined in rust/miniproto/src/tl.rs:682-687

Decodes Python tl_decode_string(data, offset) as UTF-8 and returns it with the next offset.

Returns ValueError for malformed TL data or non-UTF-8 payload bytes.

  • data: TL bytes containing one length-prefixed string field.
  • offset: Byte offset at which the field starts.