miniproto_native::transport::TransportCodec::encode_packet
Provenance
Section titled “Provenance”- Crate:
miniproto_native - Rust visibility:
restricted - Source:
rust/miniproto/src/transport.rs - Python exposure:
miniproto._native.TransportCodec.encode_packet(confirmed from adjacent PyO3 attributes)
Signature
Section titled “Signature”fn encode_packet(self: &Self, payload: &[u8], quick_ack: bool) -> _Arguments
Section titled “Arguments”payload: Complete MTProto payload to frame.quick_ack: Whether to set the outbound quick-ACK request bit where the mode supports it.
cargo-docs-md rendering
Section titled “cargo-docs-md rendering”-
fn encode_packet(&self, payload: &[u8], quick_ack: bool) -> PyResult<Vec<u8>>Encodes Python
encode_packet(payload, quick_ack=False)into a single TCP frame.Returns
ValueErrorfor oversized payloads, invalid abridged alignment, length overflow,or operating-system randomness failure in padded mode.
Arguments
Section titled “Arguments”-
payload: Complete MTProto payload to frame. -
quick_ack: Whether to set the outbound quick-ACK request bit where the mode supports it.
-