pub struct Message {
pub id: MessageId,
pub seq_no: i32,
pub body: Vec<u8>,
}Expand description
A framed MTProto message ready to be sent.
Fields§
§id: MessageIdUnique identifier for this message.
seq_no: i32Session-scoped sequence number (even for content-unrelated, odd for content-related).
body: Vec<u8>The serialized TL body (constructor ID + fields).
Implementations§
Source§impl Message
impl Message
Sourcepub fn plaintext(id: MessageId, seq_no: i32, body: Vec<u8>) -> Self
pub fn plaintext(id: MessageId, seq_no: i32, body: Vec<u8>) -> Self
Construct a new plaintext message (used before key exchange).
Sourcepub fn to_plaintext_bytes(&self) -> Vec<u8> ⓘ
pub fn to_plaintext_bytes(&self) -> Vec<u8> ⓘ
Serialize the message into the plaintext wire format:
auth_key_id:long (0 for plaintext)
message_id:long
message_data_length:int
message_data:bytesTrait Implementations§
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnsafeUnpin for Message
impl UnwindSafe for Message
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more