fn push(&mut self, request: &[u8]) -> Option<MsgId> {
        if !self.buffer.is_empty() {
            return None;
        }

        0i64.serialize(&mut self.buffer); // auth_key_id = 0

        // Even though https://core.telegram.org/mtproto/samples-auth_key
        // seems to imply the `msg_id` has to follow some rules, there is
        // no need to generate a valid `msg_id`, it seems. Just use `0`.
        0i64.serialize(&mut self.buffer); // message_id

        (request.len() as i32).serialize(&mut self.buffer); // message_data_length
        self.buffer.extend_from_slice(request); // message_data

        Some(MsgId(0))
    }
/// Wraps a request's data into a plain message (also known as
/// [unencrypted messages]), and returns its serialized contents.
///
/// Plain messages may be used for requests that don't require an
/// authorization key to be present, such as those needed to generate
/// the authorization key itself.
///
/// [unencrypted messages]: https://core.telegram.org/mtproto/description#unencrypted-message
Wraps a request's data into a plain message (also known as
[unencrypted messages]), and returns its serialized contents.

Plain messages may be used for requests that don't require an
authorization key to be present, such as those needed to generate
the authorization key itself.


Wraps a request ' s data into a plain message ( also known as [ unencrypted messages ] ) and returns its serialized contents . Plain messages may be used for requests that don ' t require an authorization key to be present such as those needed to generate the authorization key itself .
fn push(&mut self, request: &[u8]) -> Option<MsgId> {
        if !self.buffer.is_empty() {
            return None;
        }
        0i64.serialize(&mut self.buffer); // auth_key_id = 0
        // Even though https://core.telegram.org/mtproto/samples-auth_key
        // seems to imply the `msg_id` has to follow some rules, there is
        // no need to generate a valid `msg_id`, it seems. Just use `0`.
        0i64.serialize(&mut self.buffer); // message_id
        (request.len() as i32).serialize(&mut self.buffer); // message_data_length
        self.buffer.extend_from_slice(request); // message_data
        Some(MsgId(0))
    }
fn push ( & mut self , request : & [ u8 ] ) -> Option < MsgId > { if ! self . buffer . is_empty ( ) { return None ; } 0i64 . serialize ( & mut self . buffer ) ; // auth_key_id = 0 // Even though https://core.telegram.org/mtproto/samples-auth_key // seems to imply the `msg_id` has to follow some rules, there is // no need to generate a valid `msg_id`, it seems. Just use `0`. 0i64 . serialize ( & mut self . buffer ) ; // message_id ( request . len ( ) as i32 ) . serialize ( & mut self . buffer ) ; // message_data_length self . buffer . extend_from_slice ( request ) ; // message_data Some ( MsgId ( 0 ) ) }
Wraps a request's data into a plain message (also known as
[unencrypted messages]), and returns its serialized contents.
Wraps a request ' s data into a plain message ( also known as [ unencrypted messages ] ) and returns its serialized contents .
&mut self
request
&[u8]
&mut self
request
&[u8]