1
# ! [ allow ( non_camel_case_types , non_snake_case ) ] pub use mtproto_prelude :: * ; pub const LAYER : i32 = 73i32 ; # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `AccountDaysTTL`\n\n```text\naccountDaysTTL#b8d0afdf days:int = AccountDaysTTL;\n```\n" ] pub enum AccountDaysTTL { AccountDaysTTL ( :: mtproto :: account_days_ttl :: AccountDaysTTL ) , } impl AccountDaysTTL { pub fn days ( & self ) -> & :: mtproto :: int { match self { & AccountDaysTTL :: AccountDaysTTL ( ref x ) => & x . days , } } } impl :: BoxedSerialize for AccountDaysTTL { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & AccountDaysTTL :: AccountDaysTTL ( ref x ) => ( :: ConstructorNumber ( 0xb8d0afdf ) , x ) , } } } impl :: BoxedDeserialize for AccountDaysTTL { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xb8d0afdf ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xb8d0afdf ) => Ok ( AccountDaysTTL :: AccountDaysTTL ( _de . read_bare :: < :: mtproto :: account_days_ttl :: AccountDaysTTL > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `Authorization`\n\n```text\nauthorization#7bf2e6f6 hash:long flags:int device_model:string platform:string system_version:string api_id:int app_name:string app_version:string date_created:int date_active:int ip:string country:string region:string = Authorization;\n```\n" ] pub enum Authorization { Authorization ( :: mtproto :: authorization :: Authorization ) , } impl Authorization { pub fn api_id ( & self ) -> & :: mtproto :: int { match self { & Authorization :: Authorization ( ref x ) => & x . api_id , } } pub fn app_name ( & self ) -> & :: mtproto :: string { match self { & Authorization :: Authorization ( ref x ) => & x . app_name , } } pub fn app_version ( & self ) -> & :: mtproto :: string { match self { & Authorization :: Authorization ( ref x ) => & x . app_version , } } pub fn country ( & self ) -> & :: mtproto :: string { match self { & Authorization :: Authorization ( ref x ) => & x . country , } } pub fn date_active ( & self ) -> & :: mtproto :: int { match self { & Authorization :: Authorization ( ref x ) => & x . date_active , } } pub fn date_created ( & self ) -> & :: mtproto :: int { match self { & Authorization :: Authorization ( ref x ) => & x . date_created , } } pub fn device_model ( & self ) -> & :: mtproto :: string { match self { & Authorization :: Authorization ( ref x ) => & x . device_model , } } pub fn flags ( & self ) -> & :: mtproto :: int { match self { & Authorization :: Authorization ( ref x ) => & x . flags , } } pub fn hash ( & self ) -> & :: mtproto :: long { match self { & Authorization :: Authorization ( ref x ) => & x . hash , } } pub fn ip ( & self ) -> & :: mtproto :: string { match self { & Authorization :: Authorization ( ref x ) => & x . ip , } } pub fn platform ( & self ) -> & :: mtproto :: string { match self { & Authorization :: Authorization ( ref x ) => & x . platform , } } pub fn region ( & self ) -> & :: mtproto :: string { match self { & Authorization :: Authorization ( ref x ) => & x . region , } } pub fn system_version ( & self ) -> & :: mtproto :: string { match self { & Authorization :: Authorization ( ref x ) => & x . system_version , } } } impl :: BoxedSerialize for Authorization { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Authorization :: Authorization ( ref x ) => ( :: ConstructorNumber ( 0x7bf2e6f6 ) , x ) , } } } impl :: BoxedDeserialize for Authorization { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x7bf2e6f6 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x7bf2e6f6 ) => Ok ( Authorization :: Authorization ( _de . read_bare :: < :: mtproto :: authorization :: Authorization > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `BadMsgNotification`\n\n```text\nbad_msg_notification#a7eff811 bad_msg_id:long bad_msg_seqno:int error_code:int = BadMsgNotification;\n\nbad_server_salt#edab447b bad_msg_id:long bad_msg_seqno:int error_code:int new_server_salt:long = BadMsgNotification;\n```\n" ] pub enum BadMsgNotification { MsgNotification ( :: mtproto :: bad :: MsgNotification ) , ServerSalt ( :: mtproto :: bad :: ServerSalt ) , } impl BadMsgNotification { pub fn bad_msg_id ( & self ) -> & :: mtproto :: long { match self { & BadMsgNotification :: ServerSalt ( ref x ) => & x . bad_msg_id , & BadMsgNotification :: MsgNotification ( ref x ) => & x . bad_msg_id , } } pub fn bad_msg_seqno ( & self ) -> & :: mtproto :: int { match self { & BadMsgNotification :: MsgNotification ( ref x ) => & x . bad_msg_seqno , & BadMsgNotification :: ServerSalt ( ref x ) => & x . bad_msg_seqno , } } pub fn error_code ( & self ) -> & :: mtproto :: int { match self { & BadMsgNotification :: MsgNotification ( ref x ) => & x . error_code , & BadMsgNotification :: ServerSalt ( ref x ) => & x . error_code , } } pub fn new_server_salt ( & self ) -> Option < & :: mtproto :: long > { match self { & BadMsgNotification :: ServerSalt ( ref x ) => Some ( & x . new_server_salt ) , _ => None } } } impl :: BoxedSerialize for BadMsgNotification { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & BadMsgNotification :: MsgNotification ( ref x ) => ( :: ConstructorNumber ( 0xa7eff811 ) , x ) , & BadMsgNotification :: ServerSalt ( ref x ) => ( :: ConstructorNumber ( 0xedab447b ) , x ) , } } } impl :: BoxedDeserialize for BadMsgNotification { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xa7eff811 ) , :: ConstructorNumber ( 0xedab447b ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xa7eff811 ) => Ok ( BadMsgNotification :: MsgNotification ( _de . read_bare :: < :: mtproto :: bad :: MsgNotification > ( ) ? ) ) , :: ConstructorNumber ( 0xedab447b ) => Ok ( BadMsgNotification :: ServerSalt ( _de . read_bare :: < :: mtproto :: bad :: ServerSalt > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `Bool`\n\n```text\nboolFalse#bc799737 = Bool;\n\nboolTrue#997275b5 = Bool;\n```\n" ] pub enum Bool { False , True , } impl :: BoxedSerialize for Bool { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Bool :: False => ( :: ConstructorNumber ( 0xbc799737 ) , & ( ) ) , & Bool :: True => ( :: ConstructorNumber ( 0x997275b5 ) , & ( ) ) , } } } impl :: BoxedDeserialize for Bool { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xbc799737 ) , :: ConstructorNumber ( 0x997275b5 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xbc799737 ) => Ok ( Bool :: False ) , :: ConstructorNumber ( 0x997275b5 ) => Ok ( Bool :: True ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `BotCommand`\n\n```text\nbotCommand#c27ac8c7 command:string description:string = BotCommand;\n```\n" ] pub enum BotCommand { BotCommand ( :: mtproto :: bot_command :: BotCommand ) , } impl BotCommand { pub fn command ( & self ) -> & :: mtproto :: string { match self { & BotCommand :: BotCommand ( ref x ) => & x . command , } } pub fn description ( & self ) -> & :: mtproto :: string { match self { & BotCommand :: BotCommand ( ref x ) => & x . description , } } } impl :: BoxedSerialize for BotCommand { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & BotCommand :: BotCommand ( ref x ) => ( :: ConstructorNumber ( 0xc27ac8c7 ) , x ) , } } } impl :: BoxedDeserialize for BotCommand { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xc27ac8c7 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xc27ac8c7 ) => Ok ( BotCommand :: BotCommand ( _de . read_bare :: < :: mtproto :: bot_command :: BotCommand > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `BotInfo`\n\n```text\nbotInfo#98e81d3a user_id:int description:string commands:Vector<BotCommand> = BotInfo;\n```\n" ] pub enum BotInfo { BotInfo ( :: mtproto :: bot_info :: BotInfo ) , } impl BotInfo { pub fn commands ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: BotCommand > { match self { & BotInfo :: BotInfo ( ref x ) => & x . commands , } } pub fn description ( & self ) -> & :: mtproto :: string { match self { & BotInfo :: BotInfo ( ref x ) => & x . description , } } pub fn user_id ( & self ) -> & :: mtproto :: int { match self { & BotInfo :: BotInfo ( ref x ) => & x . user_id , } } } impl :: BoxedSerialize for BotInfo { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & BotInfo :: BotInfo ( ref x ) => ( :: ConstructorNumber ( 0x98e81d3a ) , x ) , } } } impl :: BoxedDeserialize for BotInfo { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x98e81d3a ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x98e81d3a ) => Ok ( BotInfo :: BotInfo ( _de . read_bare :: < :: mtproto :: bot_info :: BotInfo > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `BotInlineMessage`\n\n```text\nbotInlineMessageMediaAuto#a74b15b flags:# caption:string reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\n\nbotInlineMessageText#8c7f65e2 flags:# no_webpage:flags.0?true message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\n\nbotInlineMessageMediaGeo#b722de65 flags:# geo:GeoPoint period:int reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\n\nbotInlineMessageMediaVenue#4366232e flags:# geo:GeoPoint title:string address:string provider:string venue_id:string reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\n\nbotInlineMessageMediaContact#35edb4d4 flags:# phone_number:string first_name:string last_name:string reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\n```\n" ] pub enum BotInlineMessage { MediaAuto ( :: mtproto :: bot_inline_message :: MediaAuto ) , Text ( :: mtproto :: bot_inline_message :: Text ) , MediaGeo ( :: mtproto :: bot_inline_message :: MediaGeo ) , MediaVenue ( :: mtproto :: bot_inline_message :: MediaVenue ) , MediaContact ( :: mtproto :: bot_inline_message :: MediaContact ) , } impl BotInlineMessage { pub fn address ( & self ) -> Option < & :: mtproto :: string > { match self { & BotInlineMessage :: MediaVenue ( ref x ) => Some ( & x . address ) , _ => None } } pub fn caption ( & self ) -> Option < & :: mtproto :: string > { match self { & BotInlineMessage :: MediaAuto ( ref x ) => Some ( & x . caption ) , _ => None } } pub fn entities ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: MessageEntity > > { match self { & BotInlineMessage :: Text ( ref x ) => x . entities . as_ref ( ) , _ => None } } pub fn first_name ( & self ) -> Option < & :: mtproto :: string > { match self { & BotInlineMessage :: MediaContact ( ref x ) => Some ( & x . first_name ) , _ => None } } pub fn geo ( & self ) -> Option < & :: mtproto :: GeoPoint > { match self { & BotInlineMessage :: MediaVenue ( ref x ) => Some ( & x . geo ) , & BotInlineMessage :: MediaGeo ( ref x ) => Some ( & x . geo ) , _ => None } } pub fn last_name ( & self ) -> Option < & :: mtproto :: string > { match self { & BotInlineMessage :: MediaContact ( ref x ) => Some ( & x . last_name ) , _ => None } } pub fn message ( & self ) -> Option < & :: mtproto :: string > { match self { & BotInlineMessage :: Text ( ref x ) => Some ( & x . message ) , _ => None } } pub fn no_webpage ( & self ) -> Option < bool > { match self { & BotInlineMessage :: Text ( ref x ) => Some ( x . no_webpage ) , _ => None } } pub fn period ( & self ) -> Option < & :: mtproto :: int > { match self { & BotInlineMessage :: MediaGeo ( ref x ) => Some ( & x . period ) , _ => None } } pub fn phone_number ( & self ) -> Option < & :: mtproto :: string > { match self { & BotInlineMessage :: MediaContact ( ref x ) => Some ( & x . phone_number ) , _ => None } } pub fn provider ( & self ) -> Option < & :: mtproto :: string > { match self { & BotInlineMessage :: MediaVenue ( ref x ) => Some ( & x . provider ) , _ => None } } pub fn reply_markup ( & self ) -> Option < & :: mtproto :: ReplyMarkup > { match self { & BotInlineMessage :: MediaVenue ( ref x ) => x . reply_markup . as_ref ( ) , & BotInlineMessage :: MediaGeo ( ref x ) => x . reply_markup . as_ref ( ) , & BotInlineMessage :: MediaAuto ( ref x ) => x . reply_markup . as_ref ( ) , & BotInlineMessage :: MediaContact ( ref x ) => x . reply_markup . as_ref ( ) , & BotInlineMessage :: Text ( ref x ) => x . reply_markup . as_ref ( ) , } } pub fn title ( & self ) -> Option < & :: mtproto :: string > { match self { & BotInlineMessage :: MediaVenue ( ref x ) => Some ( & x . title ) , _ => None } } pub fn venue_id ( & self ) -> Option < & :: mtproto :: string > { match self { & BotInlineMessage :: MediaVenue ( ref x ) => Some ( & x . venue_id ) , _ => None } } } impl :: BoxedSerialize for BotInlineMessage { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & BotInlineMessage :: MediaAuto ( ref x ) => ( :: ConstructorNumber ( 0x0a74b15b ) , x ) , & BotInlineMessage :: Text ( ref x ) => ( :: ConstructorNumber ( 0x8c7f65e2 ) , x ) , & BotInlineMessage :: MediaGeo ( ref x ) => ( :: ConstructorNumber ( 0xb722de65 ) , x ) , & BotInlineMessage :: MediaVenue ( ref x ) => ( :: ConstructorNumber ( 0x4366232e ) , x ) , & BotInlineMessage :: MediaContact ( ref x ) => ( :: ConstructorNumber ( 0x35edb4d4 ) , x ) , } } } impl :: BoxedDeserialize for BotInlineMessage { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x0a74b15b ) , :: ConstructorNumber ( 0x8c7f65e2 ) , :: ConstructorNumber ( 0xb722de65 ) , :: ConstructorNumber ( 0x4366232e ) , :: ConstructorNumber ( 0x35edb4d4 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x0a74b15b ) => Ok ( BotInlineMessage :: MediaAuto ( _de . read_bare :: < :: mtproto :: bot_inline_message :: MediaAuto > ( ) ? ) ) , :: ConstructorNumber ( 0x8c7f65e2 ) => Ok ( BotInlineMessage :: Text ( _de . read_bare :: < :: mtproto :: bot_inline_message :: Text > ( ) ? ) ) , :: ConstructorNumber ( 0xb722de65 ) => Ok ( BotInlineMessage :: MediaGeo ( _de . read_bare :: < :: mtproto :: bot_inline_message :: MediaGeo > ( ) ? ) ) , :: ConstructorNumber ( 0x4366232e ) => Ok ( BotInlineMessage :: MediaVenue ( _de . read_bare :: < :: mtproto :: bot_inline_message :: MediaVenue > ( ) ? ) ) , :: ConstructorNumber ( 0x35edb4d4 ) => Ok ( BotInlineMessage :: MediaContact ( _de . read_bare :: < :: mtproto :: bot_inline_message :: MediaContact > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `BotInlineResult`\n\n```text\nbotInlineResult#9bebaeb9 flags:# id:string type:string title:flags.1?string description:flags.2?string url:flags.3?string thumb_url:flags.4?string content_url:flags.5?string content_type:flags.5?string w:flags.6?int h:flags.6?int duration:flags.7?int send_message:BotInlineMessage = BotInlineResult;\n\nbotInlineMediaResult#17db940b flags:# id:string type:string photo:flags.0?Photo document:flags.1?Document title:flags.2?string description:flags.3?string send_message:BotInlineMessage = BotInlineResult;\n```\n" ] pub enum BotInlineResult { Result ( :: mtproto :: bot_inline :: Result ) , MediaResult ( :: mtproto :: bot_inline :: MediaResult ) , } impl BotInlineResult { pub fn content_type ( & self ) -> Option < & :: mtproto :: string > { match self { & BotInlineResult :: Result ( ref x ) => x . content_type . as_ref ( ) , _ => None } } pub fn content_url ( & self ) -> Option < & :: mtproto :: string > { match self { & BotInlineResult :: Result ( ref x ) => x . content_url . as_ref ( ) , _ => None } } pub fn description ( & self ) -> Option < & :: mtproto :: string > { match self { & BotInlineResult :: MediaResult ( ref x ) => x . description . as_ref ( ) , & BotInlineResult :: Result ( ref x ) => x . description . as_ref ( ) , } } pub fn document ( & self ) -> Option < & :: mtproto :: Document > { match self { & BotInlineResult :: MediaResult ( ref x ) => x . document . as_ref ( ) , _ => None } } pub fn duration ( & self ) -> Option < & :: mtproto :: int > { match self { & BotInlineResult :: Result ( ref x ) => x . duration . as_ref ( ) , _ => None } } pub fn h ( & self ) -> Option < & :: mtproto :: int > { match self { & BotInlineResult :: Result ( ref x ) => x . h . as_ref ( ) , _ => None } } pub fn id ( & self ) -> & :: mtproto :: string { match self { & BotInlineResult :: Result ( ref x ) => & x . id , & BotInlineResult :: MediaResult ( ref x ) => & x . id , } } pub fn photo ( & self ) -> Option < & :: mtproto :: Photo > { match self { & BotInlineResult :: MediaResult ( ref x ) => x . photo . as_ref ( ) , _ => None } } pub fn send_message ( & self ) -> & :: mtproto :: BotInlineMessage { match self { & BotInlineResult :: MediaResult ( ref x ) => & x . send_message , & BotInlineResult :: Result ( ref x ) => & x . send_message , } } pub fn thumb_url ( & self ) -> Option < & :: mtproto :: string > { match self { & BotInlineResult :: Result ( ref x ) => x . thumb_url . as_ref ( ) , _ => None } } pub fn title ( & self ) -> Option < & :: mtproto :: string > { match self { & BotInlineResult :: Result ( ref x ) => x . title . as_ref ( ) , & BotInlineResult :: MediaResult ( ref x ) => x . title . as_ref ( ) , } } pub fn type_ ( & self ) -> & :: mtproto :: string { match self { & BotInlineResult :: MediaResult ( ref x ) => & x . type_ , & BotInlineResult :: Result ( ref x ) => & x . type_ , } } pub fn url ( & self ) -> Option < & :: mtproto :: string > { match self { & BotInlineResult :: Result ( ref x ) => x . url . as_ref ( ) , _ => None } } pub fn w ( & self ) -> Option < & :: mtproto :: int > { match self { & BotInlineResult :: Result ( ref x ) => x . w . as_ref ( ) , _ => None } } } impl :: BoxedSerialize for BotInlineResult { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & BotInlineResult :: Result ( ref x ) => ( :: ConstructorNumber ( 0x9bebaeb9 ) , x ) , & BotInlineResult :: MediaResult ( ref x ) => ( :: ConstructorNumber ( 0x17db940b ) , x ) , } } } impl :: BoxedDeserialize for BotInlineResult { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x9bebaeb9 ) , :: ConstructorNumber ( 0x17db940b ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x9bebaeb9 ) => Ok ( BotInlineResult :: Result ( _de . read_bare :: < :: mtproto :: bot_inline :: Result > ( ) ? ) ) , :: ConstructorNumber ( 0x17db940b ) => Ok ( BotInlineResult :: MediaResult ( _de . read_bare :: < :: mtproto :: bot_inline :: MediaResult > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `CdnConfig`\n\n```text\ncdnConfig#5725e40a public_keys:Vector<CdnPublicKey> = CdnConfig;\n```\n" ] pub enum CdnConfig { CdnConfig ( :: mtproto :: cdn_config :: CdnConfig ) , } impl CdnConfig { pub fn public_keys ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: CdnPublicKey > { match self { & CdnConfig :: CdnConfig ( ref x ) => & x . public_keys , } } } impl :: BoxedSerialize for CdnConfig { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & CdnConfig :: CdnConfig ( ref x ) => ( :: ConstructorNumber ( 0x5725e40a ) , x ) , } } } impl :: BoxedDeserialize for CdnConfig { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x5725e40a ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x5725e40a ) => Ok ( CdnConfig :: CdnConfig ( _de . read_bare :: < :: mtproto :: cdn_config :: CdnConfig > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `CdnFileHash`\n\n```text\ncdnFileHash#77eec38f offset:int limit:int hash:bytes = CdnFileHash;\n```\n" ] pub enum CdnFileHash { CdnFileHash ( :: mtproto :: cdn_file_hash :: CdnFileHash ) , } impl CdnFileHash { pub fn hash ( & self ) -> & :: mtproto :: bytes { match self { & CdnFileHash :: CdnFileHash ( ref x ) => & x . hash , } } pub fn limit ( & self ) -> & :: mtproto :: int { match self { & CdnFileHash :: CdnFileHash ( ref x ) => & x . limit , } } pub fn offset ( & self ) -> & :: mtproto :: int { match self { & CdnFileHash :: CdnFileHash ( ref x ) => & x . offset , } } } impl :: BoxedSerialize for CdnFileHash { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & CdnFileHash :: CdnFileHash ( ref x ) => ( :: ConstructorNumber ( 0x77eec38f ) , x ) , } } } impl :: BoxedDeserialize for CdnFileHash { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x77eec38f ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x77eec38f ) => Ok ( CdnFileHash :: CdnFileHash ( _de . read_bare :: < :: mtproto :: cdn_file_hash :: CdnFileHash > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `CdnPublicKey`\n\n```text\ncdnPublicKey#c982eaba dc_id:int public_key:string = CdnPublicKey;\n```\n" ] pub enum CdnPublicKey { CdnPublicKey ( :: mtproto :: cdn_public_key :: CdnPublicKey ) , } impl CdnPublicKey { pub fn dc_id ( & self ) -> & :: mtproto :: int { match self { & CdnPublicKey :: CdnPublicKey ( ref x ) => & x . dc_id , } } pub fn public_key ( & self ) -> & :: mtproto :: string { match self { & CdnPublicKey :: CdnPublicKey ( ref x ) => & x . public_key , } } } impl :: BoxedSerialize for CdnPublicKey { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & CdnPublicKey :: CdnPublicKey ( ref x ) => ( :: ConstructorNumber ( 0xc982eaba ) , x ) , } } } impl :: BoxedDeserialize for CdnPublicKey { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xc982eaba ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xc982eaba ) => Ok ( CdnPublicKey :: CdnPublicKey ( _de . read_bare :: < :: mtproto :: cdn_public_key :: CdnPublicKey > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `ChannelAdminLogEvent`\n\n```text\nchannelAdminLogEvent#3b5a3e40 id:long date:int user_id:int action:ChannelAdminLogEventAction = ChannelAdminLogEvent;\n```\n" ] pub enum ChannelAdminLogEvent { ChannelAdminLogEvent ( :: mtproto :: channel_admin_log_event :: ChannelAdminLogEvent ) , } impl ChannelAdminLogEvent { pub fn action ( & self ) -> & :: mtproto :: ChannelAdminLogEventAction { match self { & ChannelAdminLogEvent :: ChannelAdminLogEvent ( ref x ) => & x . action , } } pub fn date ( & self ) -> & :: mtproto :: int { match self { & ChannelAdminLogEvent :: ChannelAdminLogEvent ( ref x ) => & x . date , } } pub fn id ( & self ) -> & :: mtproto :: long { match self { & ChannelAdminLogEvent :: ChannelAdminLogEvent ( ref x ) => & x . id , } } pub fn user_id ( & self ) -> & :: mtproto :: int { match self { & ChannelAdminLogEvent :: ChannelAdminLogEvent ( ref x ) => & x . user_id , } } } impl :: BoxedSerialize for ChannelAdminLogEvent { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ChannelAdminLogEvent :: ChannelAdminLogEvent ( ref x ) => ( :: ConstructorNumber ( 0x3b5a3e40 ) , x ) , } } } impl :: BoxedDeserialize for ChannelAdminLogEvent { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x3b5a3e40 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x3b5a3e40 ) => Ok ( ChannelAdminLogEvent :: ChannelAdminLogEvent ( _de . read_bare :: < :: mtproto :: channel_admin_log_event :: ChannelAdminLogEvent > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `ChannelAdminLogEventAction`\n\n```text\nchannelAdminLogEventActionChangeTitle#e6dfb825 prev_value:string new_value:string = ChannelAdminLogEventAction;\n\nchannelAdminLogEventActionChangeAbout#55188a2e prev_value:string new_value:string = ChannelAdminLogEventAction;\n\nchannelAdminLogEventActionChangeUsername#6a4afc38 prev_value:string new_value:string = ChannelAdminLogEventAction;\n\nchannelAdminLogEventActionChangePhoto#b82f55c3 prev_photo:ChatPhoto new_photo:ChatPhoto = ChannelAdminLogEventAction;\n\nchannelAdminLogEventActionToggleInvites#1b7907ae new_value:Bool = ChannelAdminLogEventAction;\n\nchannelAdminLogEventActionToggleSignatures#26ae0971 new_value:Bool = ChannelAdminLogEventAction;\n\nchannelAdminLogEventActionUpdatePinned#e9e82c18 message:Message = ChannelAdminLogEventAction;\n\nchannelAdminLogEventActionEditMessage#709b2405 prev_message:Message new_message:Message = ChannelAdminLogEventAction;\n\nchannelAdminLogEventActionDeleteMessage#42e047bb message:Message = ChannelAdminLogEventAction;\n\nchannelAdminLogEventActionParticipantJoin#183040d3 = ChannelAdminLogEventAction;\n\nchannelAdminLogEventActionParticipantLeave#f89777f2 = ChannelAdminLogEventAction;\n\nchannelAdminLogEventActionParticipantInvite#e31c34d8 participant:ChannelParticipant = ChannelAdminLogEventAction;\n\nchannelAdminLogEventActionParticipantToggleBan#e6d83d7e prev_participant:ChannelParticipant new_participant:ChannelParticipant = ChannelAdminLogEventAction;\n\nchannelAdminLogEventActionParticipantToggleAdmin#d5676710 prev_participant:ChannelParticipant new_participant:ChannelParticipant = ChannelAdminLogEventAction;\n\nchannelAdminLogEventActionChangeStickerSet#b1c3caa7 prev_stickerset:InputStickerSet new_stickerset:InputStickerSet = ChannelAdminLogEventAction;\n\nchannelAdminLogEventActionTogglePreHistoryHidden#5f5c95f1 new_value:Bool = ChannelAdminLogEventAction;\n```\n" ] pub enum ChannelAdminLogEventAction { ChangeTitle ( :: mtproto :: channel_admin_log_event_action :: ChangeTitle ) , ChangeAbout ( :: mtproto :: channel_admin_log_event_action :: ChangeAbout ) , ChangeUsername ( :: mtproto :: channel_admin_log_event_action :: ChangeUsername ) , ChangePhoto ( :: mtproto :: channel_admin_log_event_action :: ChangePhoto ) , ToggleInvites ( :: mtproto :: channel_admin_log_event_action :: ToggleInvites ) , ToggleSignatures ( :: mtproto :: channel_admin_log_event_action :: ToggleSignatures ) , UpdatePinned ( :: mtproto :: channel_admin_log_event_action :: UpdatePinned ) , EditMessage ( :: mtproto :: channel_admin_log_event_action :: EditMessage ) , DeleteMessage ( :: mtproto :: channel_admin_log_event_action :: DeleteMessage ) , ParticipantJoin , ParticipantLeave , ParticipantInvite ( :: mtproto :: channel_admin_log_event_action :: ParticipantInvite ) , ParticipantToggleBan ( :: mtproto :: channel_admin_log_event_action :: ParticipantToggleBan ) , ParticipantToggleAdmin ( :: mtproto :: channel_admin_log_event_action :: ParticipantToggleAdmin ) , ChangeStickerSet ( :: mtproto :: channel_admin_log_event_action :: ChangeStickerSet ) , TogglePreHistoryHidden ( :: mtproto :: channel_admin_log_event_action :: TogglePreHistoryHidden ) , } impl ChannelAdminLogEventAction { pub fn message ( & self ) -> Option < & :: mtproto :: Message > { match self { & ChannelAdminLogEventAction :: UpdatePinned ( ref x ) => Some ( & x . message ) , & ChannelAdminLogEventAction :: DeleteMessage ( ref x ) => Some ( & x . message ) , _ => None } } pub fn new_message ( & self ) -> Option < & :: mtproto :: Message > { match self { & ChannelAdminLogEventAction :: EditMessage ( ref x ) => Some ( & x . new_message ) , _ => None } } pub fn new_participant ( & self ) -> Option < & :: mtproto :: ChannelParticipant > { match self { & ChannelAdminLogEventAction :: ParticipantToggleAdmin ( ref x ) => Some ( & x . new_participant ) , & ChannelAdminLogEventAction :: ParticipantToggleBan ( ref x ) => Some ( & x . new_participant ) , _ => None } } pub fn new_photo ( & self ) -> Option < & :: mtproto :: ChatPhoto > { match self { & ChannelAdminLogEventAction :: ChangePhoto ( ref x ) => Some ( & x . new_photo ) , _ => None } } pub fn new_stickerset ( & self ) -> Option < & :: mtproto :: InputStickerSet > { match self { & ChannelAdminLogEventAction :: ChangeStickerSet ( ref x ) => Some ( & x . new_stickerset ) , _ => None } } pub fn participant ( & self ) -> Option < & :: mtproto :: ChannelParticipant > { match self { & ChannelAdminLogEventAction :: ParticipantInvite ( ref x ) => Some ( & x . participant ) , _ => None } } pub fn prev_message ( & self ) -> Option < & :: mtproto :: Message > { match self { & ChannelAdminLogEventAction :: EditMessage ( ref x ) => Some ( & x . prev_message ) , _ => None } } pub fn prev_participant ( & self ) -> Option < & :: mtproto :: ChannelParticipant > { match self { & ChannelAdminLogEventAction :: ParticipantToggleAdmin ( ref x ) => Some ( & x . prev_participant ) , & ChannelAdminLogEventAction :: ParticipantToggleBan ( ref x ) => Some ( & x . prev_participant ) , _ => None } } pub fn prev_photo ( & self ) -> Option < & :: mtproto :: ChatPhoto > { match self { & ChannelAdminLogEventAction :: ChangePhoto ( ref x ) => Some ( & x . prev_photo ) , _ => None } } pub fn prev_stickerset ( & self ) -> Option < & :: mtproto :: InputStickerSet > { match self { & ChannelAdminLogEventAction :: ChangeStickerSet ( ref x ) => Some ( & x . prev_stickerset ) , _ => None } } pub fn prev_value ( & self ) -> Option < & :: mtproto :: string > { match self { & ChannelAdminLogEventAction :: ChangeAbout ( ref x ) => Some ( & x . prev_value ) , & ChannelAdminLogEventAction :: ChangeTitle ( ref x ) => Some ( & x . prev_value ) , & ChannelAdminLogEventAction :: ChangeUsername ( ref x ) => Some ( & x . prev_value ) , _ => None } } } impl :: BoxedSerialize for ChannelAdminLogEventAction { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ChannelAdminLogEventAction :: ChangeTitle ( ref x ) => ( :: ConstructorNumber ( 0xe6dfb825 ) , x ) , & ChannelAdminLogEventAction :: ChangeAbout ( ref x ) => ( :: ConstructorNumber ( 0x55188a2e ) , x ) , & ChannelAdminLogEventAction :: ChangeUsername ( ref x ) => ( :: ConstructorNumber ( 0x6a4afc38 ) , x ) , & ChannelAdminLogEventAction :: ChangePhoto ( ref x ) => ( :: ConstructorNumber ( 0xb82f55c3 ) , x ) , & ChannelAdminLogEventAction :: ToggleInvites ( ref x ) => ( :: ConstructorNumber ( 0x1b7907ae ) , x ) , & ChannelAdminLogEventAction :: ToggleSignatures ( ref x ) => ( :: ConstructorNumber ( 0x26ae0971 ) , x ) , & ChannelAdminLogEventAction :: UpdatePinned ( ref x ) => ( :: ConstructorNumber ( 0xe9e82c18 ) , x ) , & ChannelAdminLogEventAction :: EditMessage ( ref x ) => ( :: ConstructorNumber ( 0x709b2405 ) , x ) , & ChannelAdminLogEventAction :: DeleteMessage ( ref x ) => ( :: ConstructorNumber ( 0x42e047bb ) , x ) , & ChannelAdminLogEventAction :: ParticipantJoin => ( :: ConstructorNumber ( 0x183040d3 ) , & ( ) ) , & ChannelAdminLogEventAction :: ParticipantLeave => ( :: ConstructorNumber ( 0xf89777f2 ) , & ( ) ) , & ChannelAdminLogEventAction :: ParticipantInvite ( ref x ) => ( :: ConstructorNumber ( 0xe31c34d8 ) , x ) , & ChannelAdminLogEventAction :: ParticipantToggleBan ( ref x ) => ( :: ConstructorNumber ( 0xe6d83d7e ) , x ) , & ChannelAdminLogEventAction :: ParticipantToggleAdmin ( ref x ) => ( :: ConstructorNumber ( 0xd5676710 ) , x ) , & ChannelAdminLogEventAction :: ChangeStickerSet ( ref x ) => ( :: ConstructorNumber ( 0xb1c3caa7 ) , x ) , & ChannelAdminLogEventAction :: TogglePreHistoryHidden ( ref x ) => ( :: ConstructorNumber ( 0x5f5c95f1 ) , x ) , } } } impl :: BoxedDeserialize for ChannelAdminLogEventAction { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xe6dfb825 ) , :: ConstructorNumber ( 0x55188a2e ) , :: ConstructorNumber ( 0x6a4afc38 ) , :: ConstructorNumber ( 0xb82f55c3 ) , :: ConstructorNumber ( 0x1b7907ae ) , :: ConstructorNumber ( 0x26ae0971 ) , :: ConstructorNumber ( 0xe9e82c18 ) , :: ConstructorNumber ( 0x709b2405 ) , :: ConstructorNumber ( 0x42e047bb ) , :: ConstructorNumber ( 0x183040d3 ) , :: ConstructorNumber ( 0xf89777f2 ) , :: ConstructorNumber ( 0xe31c34d8 ) , :: ConstructorNumber ( 0xe6d83d7e ) , :: ConstructorNumber ( 0xd5676710 ) , :: ConstructorNumber ( 0xb1c3caa7 ) , :: ConstructorNumber ( 0x5f5c95f1 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xe6dfb825 ) => Ok ( ChannelAdminLogEventAction :: ChangeTitle ( _de . read_bare :: < :: mtproto :: channel_admin_log_event_action :: ChangeTitle > ( ) ? ) ) , :: ConstructorNumber ( 0x55188a2e ) => Ok ( ChannelAdminLogEventAction :: ChangeAbout ( _de . read_bare :: < :: mtproto :: channel_admin_log_event_action :: ChangeAbout > ( ) ? ) ) , :: ConstructorNumber ( 0x6a4afc38 ) => Ok ( ChannelAdminLogEventAction :: ChangeUsername ( _de . read_bare :: < :: mtproto :: channel_admin_log_event_action :: ChangeUsername > ( ) ? ) ) , :: ConstructorNumber ( 0xb82f55c3 ) => Ok ( ChannelAdminLogEventAction :: ChangePhoto ( _de . read_bare :: < :: mtproto :: channel_admin_log_event_action :: ChangePhoto > ( ) ? ) ) , :: ConstructorNumber ( 0x1b7907ae ) => Ok ( ChannelAdminLogEventAction :: ToggleInvites ( _de . read_bare :: < :: mtproto :: channel_admin_log_event_action :: ToggleInvites > ( ) ? ) ) , :: ConstructorNumber ( 0x26ae0971 ) => Ok ( ChannelAdminLogEventAction :: ToggleSignatures ( _de . read_bare :: < :: mtproto :: channel_admin_log_event_action :: ToggleSignatures > ( ) ? ) ) , :: ConstructorNumber ( 0xe9e82c18 ) => Ok ( ChannelAdminLogEventAction :: UpdatePinned ( _de . read_bare :: < :: mtproto :: channel_admin_log_event_action :: UpdatePinned > ( ) ? ) ) , :: ConstructorNumber ( 0x709b2405 ) => Ok ( ChannelAdminLogEventAction :: EditMessage ( _de . read_bare :: < :: mtproto :: channel_admin_log_event_action :: EditMessage > ( ) ? ) ) , :: ConstructorNumber ( 0x42e047bb ) => Ok ( ChannelAdminLogEventAction :: DeleteMessage ( _de . read_bare :: < :: mtproto :: channel_admin_log_event_action :: DeleteMessage > ( ) ? ) ) , :: ConstructorNumber ( 0x183040d3 ) => Ok ( ChannelAdminLogEventAction :: ParticipantJoin ) , :: ConstructorNumber ( 0xf89777f2 ) => Ok ( ChannelAdminLogEventAction :: ParticipantLeave ) , :: ConstructorNumber ( 0xe31c34d8 ) => Ok ( ChannelAdminLogEventAction :: ParticipantInvite ( _de . read_bare :: < :: mtproto :: channel_admin_log_event_action :: ParticipantInvite > ( ) ? ) ) , :: ConstructorNumber ( 0xe6d83d7e ) => Ok ( ChannelAdminLogEventAction :: ParticipantToggleBan ( _de . read_bare :: < :: mtproto :: channel_admin_log_event_action :: ParticipantToggleBan > ( ) ? ) ) , :: ConstructorNumber ( 0xd5676710 ) => Ok ( ChannelAdminLogEventAction :: ParticipantToggleAdmin ( _de . read_bare :: < :: mtproto :: channel_admin_log_event_action :: ParticipantToggleAdmin > ( ) ? ) ) , :: ConstructorNumber ( 0xb1c3caa7 ) => Ok ( ChannelAdminLogEventAction :: ChangeStickerSet ( _de . read_bare :: < :: mtproto :: channel_admin_log_event_action :: ChangeStickerSet > ( ) ? ) ) , :: ConstructorNumber ( 0x5f5c95f1 ) => Ok ( ChannelAdminLogEventAction :: TogglePreHistoryHidden ( _de . read_bare :: < :: mtproto :: channel_admin_log_event_action :: TogglePreHistoryHidden > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `ChannelAdminLogEventsFilter`\n\n```text\nchannelAdminLogEventsFilter#ea107ae4 flags:# join:flags.0?true leave:flags.1?true invite:flags.2?true ban:flags.3?true unban:flags.4?true kick:flags.5?true unkick:flags.6?true promote:flags.7?true demote:flags.8?true info:flags.9?true settings:flags.10?true pinned:flags.11?true edit:flags.12?true delete:flags.13?true = ChannelAdminLogEventsFilter;\n```\n" ] pub enum ChannelAdminLogEventsFilter { ChannelAdminLogEventsFilter ( :: mtproto :: channel_admin_log_events_filter :: ChannelAdminLogEventsFilter ) , } impl ChannelAdminLogEventsFilter { pub fn ban ( & self ) -> bool { match self { & ChannelAdminLogEventsFilter :: ChannelAdminLogEventsFilter ( ref x ) => x . ban , } } pub fn delete ( & self ) -> bool { match self { & ChannelAdminLogEventsFilter :: ChannelAdminLogEventsFilter ( ref x ) => x . delete , } } pub fn demote ( & self ) -> bool { match self { & ChannelAdminLogEventsFilter :: ChannelAdminLogEventsFilter ( ref x ) => x . demote , } } pub fn edit ( & self ) -> bool { match self { & ChannelAdminLogEventsFilter :: ChannelAdminLogEventsFilter ( ref x ) => x . edit , } } pub fn info ( & self ) -> bool { match self { & ChannelAdminLogEventsFilter :: ChannelAdminLogEventsFilter ( ref x ) => x . info , } } pub fn invite ( & self ) -> bool { match self { & ChannelAdminLogEventsFilter :: ChannelAdminLogEventsFilter ( ref x ) => x . invite , } } pub fn join ( & self ) -> bool { match self { & ChannelAdminLogEventsFilter :: ChannelAdminLogEventsFilter ( ref x ) => x . join , } } pub fn kick ( & self ) -> bool { match self { & ChannelAdminLogEventsFilter :: ChannelAdminLogEventsFilter ( ref x ) => x . kick , } } pub fn leave ( & self ) -> bool { match self { & ChannelAdminLogEventsFilter :: ChannelAdminLogEventsFilter ( ref x ) => x . leave , } } pub fn pinned ( & self ) -> bool { match self { & ChannelAdminLogEventsFilter :: ChannelAdminLogEventsFilter ( ref x ) => x . pinned , } } pub fn promote ( & self ) -> bool { match self { & ChannelAdminLogEventsFilter :: ChannelAdminLogEventsFilter ( ref x ) => x . promote , } } pub fn settings ( & self ) -> bool { match self { & ChannelAdminLogEventsFilter :: ChannelAdminLogEventsFilter ( ref x ) => x . settings , } } pub fn unban ( & self ) -> bool { match self { & ChannelAdminLogEventsFilter :: ChannelAdminLogEventsFilter ( ref x ) => x . unban , } } pub fn unkick ( & self ) -> bool { match self { & ChannelAdminLogEventsFilter :: ChannelAdminLogEventsFilter ( ref x ) => x . unkick , } } } impl :: BoxedSerialize for ChannelAdminLogEventsFilter { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ChannelAdminLogEventsFilter :: ChannelAdminLogEventsFilter ( ref x ) => ( :: ConstructorNumber ( 0xea107ae4 ) , x ) , } } } impl :: BoxedDeserialize for ChannelAdminLogEventsFilter { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xea107ae4 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xea107ae4 ) => Ok ( ChannelAdminLogEventsFilter :: ChannelAdminLogEventsFilter ( _de . read_bare :: < :: mtproto :: channel_admin_log_events_filter :: ChannelAdminLogEventsFilter > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `ChannelAdminRights`\n\n```text\nchannelAdminRights#5d7ceba5 flags:# change_info:flags.0?true post_messages:flags.1?true edit_messages:flags.2?true delete_messages:flags.3?true ban_users:flags.4?true invite_users:flags.5?true invite_link:flags.6?true pin_messages:flags.7?true add_admins:flags.9?true = ChannelAdminRights;\n```\n" ] pub enum ChannelAdminRights { ChannelAdminRights ( :: mtproto :: channel_admin_rights :: ChannelAdminRights ) , } impl ChannelAdminRights { pub fn add_admins ( & self ) -> bool { match self { & ChannelAdminRights :: ChannelAdminRights ( ref x ) => x . add_admins , } } pub fn ban_users ( & self ) -> bool { match self { & ChannelAdminRights :: ChannelAdminRights ( ref x ) => x . ban_users , } } pub fn change_info ( & self ) -> bool { match self { & ChannelAdminRights :: ChannelAdminRights ( ref x ) => x . change_info , } } pub fn delete_messages ( & self ) -> bool { match self { & ChannelAdminRights :: ChannelAdminRights ( ref x ) => x . delete_messages , } } pub fn edit_messages ( & self ) -> bool { match self { & ChannelAdminRights :: ChannelAdminRights ( ref x ) => x . edit_messages , } } pub fn invite_link ( & self ) -> bool { match self { & ChannelAdminRights :: ChannelAdminRights ( ref x ) => x . invite_link , } } pub fn invite_users ( & self ) -> bool { match self { & ChannelAdminRights :: ChannelAdminRights ( ref x ) => x . invite_users , } } pub fn pin_messages ( & self ) -> bool { match self { & ChannelAdminRights :: ChannelAdminRights ( ref x ) => x . pin_messages , } } pub fn post_messages ( & self ) -> bool { match self { & ChannelAdminRights :: ChannelAdminRights ( ref x ) => x . post_messages , } } } impl :: BoxedSerialize for ChannelAdminRights { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ChannelAdminRights :: ChannelAdminRights ( ref x ) => ( :: ConstructorNumber ( 0x5d7ceba5 ) , x ) , } } } impl :: BoxedDeserialize for ChannelAdminRights { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x5d7ceba5 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x5d7ceba5 ) => Ok ( ChannelAdminRights :: ChannelAdminRights ( _de . read_bare :: < :: mtproto :: channel_admin_rights :: ChannelAdminRights > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `ChannelBannedRights`\n\n```text\nchannelBannedRights#58cf4249 flags:# view_messages:flags.0?true send_messages:flags.1?true send_media:flags.2?true send_stickers:flags.3?true send_gifs:flags.4?true send_games:flags.5?true send_inline:flags.6?true embed_links:flags.7?true until_date:int = ChannelBannedRights;\n```\n" ] pub enum ChannelBannedRights { ChannelBannedRights ( :: mtproto :: channel_banned_rights :: ChannelBannedRights ) , } impl ChannelBannedRights { pub fn embed_links ( & self ) -> bool { match self { & ChannelBannedRights :: ChannelBannedRights ( ref x ) => x . embed_links , } } pub fn send_games ( & self ) -> bool { match self { & ChannelBannedRights :: ChannelBannedRights ( ref x ) => x . send_games , } } pub fn send_gifs ( & self ) -> bool { match self { & ChannelBannedRights :: ChannelBannedRights ( ref x ) => x . send_gifs , } } pub fn send_inline ( & self ) -> bool { match self { & ChannelBannedRights :: ChannelBannedRights ( ref x ) => x . send_inline , } } pub fn send_media ( & self ) -> bool { match self { & ChannelBannedRights :: ChannelBannedRights ( ref x ) => x . send_media , } } pub fn send_messages ( & self ) -> bool { match self { & ChannelBannedRights :: ChannelBannedRights ( ref x ) => x . send_messages , } } pub fn send_stickers ( & self ) -> bool { match self { & ChannelBannedRights :: ChannelBannedRights ( ref x ) => x . send_stickers , } } pub fn until_date ( & self ) -> & :: mtproto :: int { match self { & ChannelBannedRights :: ChannelBannedRights ( ref x ) => & x . until_date , } } pub fn view_messages ( & self ) -> bool { match self { & ChannelBannedRights :: ChannelBannedRights ( ref x ) => x . view_messages , } } } impl :: BoxedSerialize for ChannelBannedRights { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ChannelBannedRights :: ChannelBannedRights ( ref x ) => ( :: ConstructorNumber ( 0x58cf4249 ) , x ) , } } } impl :: BoxedDeserialize for ChannelBannedRights { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x58cf4249 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x58cf4249 ) => Ok ( ChannelBannedRights :: ChannelBannedRights ( _de . read_bare :: < :: mtproto :: channel_banned_rights :: ChannelBannedRights > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `ChannelMessagesFilter`\n\n```text\nchannelMessagesFilterEmpty#94d42ee7 = ChannelMessagesFilter;\n\nchannelMessagesFilter#cd77d957 flags:# exclude_new_messages:flags.1?true ranges:Vector<MessageRange> = ChannelMessagesFilter;\n```\n" ] pub enum ChannelMessagesFilter { Empty , ChannelMessagesFilter ( :: mtproto :: channel_messages_filter :: ChannelMessagesFilter ) , } impl ChannelMessagesFilter { pub fn exclude_new_messages ( & self ) -> Option < bool > { match self { & ChannelMessagesFilter :: ChannelMessagesFilter ( ref x ) => Some ( x . exclude_new_messages ) , _ => None } } pub fn ranges ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: MessageRange > > { match self { & ChannelMessagesFilter :: ChannelMessagesFilter ( ref x ) => Some ( & x . ranges ) , _ => None } } } impl :: BoxedSerialize for ChannelMessagesFilter { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ChannelMessagesFilter :: Empty => ( :: ConstructorNumber ( 0x94d42ee7 ) , & ( ) ) , & ChannelMessagesFilter :: ChannelMessagesFilter ( ref x ) => ( :: ConstructorNumber ( 0xcd77d957 ) , x ) , } } } impl :: BoxedDeserialize for ChannelMessagesFilter { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x94d42ee7 ) , :: ConstructorNumber ( 0xcd77d957 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x94d42ee7 ) => Ok ( ChannelMessagesFilter :: Empty ) , :: ConstructorNumber ( 0xcd77d957 ) => Ok ( ChannelMessagesFilter :: ChannelMessagesFilter ( _de . read_bare :: < :: mtproto :: channel_messages_filter :: ChannelMessagesFilter > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } impl :: BoxedSerialize for Option < :: mtproto :: channel_messages_filter :: ChannelMessagesFilter > { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match * self { None => ( :: ConstructorNumber ( 0x94d42ee7 ) , & ( ) ) , Some ( ref x ) => ( :: ConstructorNumber ( 0xcd77d957 ) , x ) , } } } impl :: BoxedDeserialize for Option < :: mtproto :: channel_messages_filter :: ChannelMessagesFilter > { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x94d42ee7 ) , :: ConstructorNumber ( 0xcd77d957 ) ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x94d42ee7 ) => Ok ( None ) , :: ConstructorNumber ( 0xcd77d957 ) => Ok ( Some ( _de . read_bare :: < :: mtproto :: channel_messages_filter :: ChannelMessagesFilter > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `ChannelParticipant`\n\n```text\nchannelParticipant#15ebac1d user_id:int date:int = ChannelParticipant;\n\nchannelParticipantSelf#a3289a6d user_id:int inviter_id:int date:int = ChannelParticipant;\n\nchannelParticipantCreator#e3e2e1f9 user_id:int = ChannelParticipant;\n\nchannelParticipantAdmin#a82fa898 flags:# can_edit:flags.0?true user_id:int inviter_id:int promoted_by:int date:int admin_rights:ChannelAdminRights = ChannelParticipant;\n\nchannelParticipantBanned#222c1886 flags:# left:flags.0?true user_id:int kicked_by:int date:int banned_rights:ChannelBannedRights = ChannelParticipant;\n```\n" ] pub enum ChannelParticipant { ChannelParticipant ( :: mtproto :: channel_participant :: ChannelParticipant ) , Self_ ( :: mtproto :: channel_participant :: Self_ ) , Creator ( :: mtproto :: channel_participant :: Creator ) , Admin ( :: mtproto :: channel_participant :: Admin ) , Banned ( :: mtproto :: channel_participant :: Banned ) , } impl ChannelParticipant { pub fn admin_rights ( & self ) -> Option < & :: mtproto :: ChannelAdminRights > { match self { & ChannelParticipant :: Admin ( ref x ) => Some ( & x . admin_rights ) , _ => None } } pub fn banned_rights ( & self ) -> Option < & :: mtproto :: ChannelBannedRights > { match self { & ChannelParticipant :: Banned ( ref x ) => Some ( & x . banned_rights ) , _ => None } } pub fn can_edit ( & self ) -> Option < bool > { match self { & ChannelParticipant :: Admin ( ref x ) => Some ( x . can_edit ) , _ => None } } pub fn date ( & self ) -> Option < & :: mtproto :: int > { match self { & ChannelParticipant :: Admin ( ref x ) => Some ( & x . date ) , & ChannelParticipant :: Self_ ( ref x ) => Some ( & x . date ) , & ChannelParticipant :: ChannelParticipant ( ref x ) => Some ( & x . date ) , & ChannelParticipant :: Banned ( ref x ) => Some ( & x . date ) , _ => None } } pub fn inviter_id ( & self ) -> Option < & :: mtproto :: int > { match self { & ChannelParticipant :: Self_ ( ref x ) => Some ( & x . inviter_id ) , & ChannelParticipant :: Admin ( ref x ) => Some ( & x . inviter_id ) , _ => None } } pub fn kicked_by ( & self ) -> Option < & :: mtproto :: int > { match self { & ChannelParticipant :: Banned ( ref x ) => Some ( & x . kicked_by ) , _ => None } } pub fn left ( & self ) -> Option < bool > { match self { & ChannelParticipant :: Banned ( ref x ) => Some ( x . left ) , _ => None } } pub fn promoted_by ( & self ) -> Option < & :: mtproto :: int > { match self { & ChannelParticipant :: Admin ( ref x ) => Some ( & x . promoted_by ) , _ => None } } pub fn user_id ( & self ) -> & :: mtproto :: int { match self { & ChannelParticipant :: Self_ ( ref x ) => & x . user_id , & ChannelParticipant :: ChannelParticipant ( ref x ) => & x . user_id , & ChannelParticipant :: Creator ( ref x ) => & x . user_id , & ChannelParticipant :: Admin ( ref x ) => & x . user_id , & ChannelParticipant :: Banned ( ref x ) => & x . user_id , } } } impl :: BoxedSerialize for ChannelParticipant { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ChannelParticipant :: ChannelParticipant ( ref x ) => ( :: ConstructorNumber ( 0x15ebac1d ) , x ) , & ChannelParticipant :: Self_ ( ref x ) => ( :: ConstructorNumber ( 0xa3289a6d ) , x ) , & ChannelParticipant :: Creator ( ref x ) => ( :: ConstructorNumber ( 0xe3e2e1f9 ) , x ) , & ChannelParticipant :: Admin ( ref x ) => ( :: ConstructorNumber ( 0xa82fa898 ) , x ) , & ChannelParticipant :: Banned ( ref x ) => ( :: ConstructorNumber ( 0x222c1886 ) , x ) , } } } impl :: BoxedDeserialize for ChannelParticipant { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x15ebac1d ) , :: ConstructorNumber ( 0xa3289a6d ) , :: ConstructorNumber ( 0xe3e2e1f9 ) , :: ConstructorNumber ( 0xa82fa898 ) , :: ConstructorNumber ( 0x222c1886 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x15ebac1d ) => Ok ( ChannelParticipant :: ChannelParticipant ( _de . read_bare :: < :: mtproto :: channel_participant :: ChannelParticipant > ( ) ? ) ) , :: ConstructorNumber ( 0xa3289a6d ) => Ok ( ChannelParticipant :: Self_ ( _de . read_bare :: < :: mtproto :: channel_participant :: Self_ > ( ) ? ) ) , :: ConstructorNumber ( 0xe3e2e1f9 ) => Ok ( ChannelParticipant :: Creator ( _de . read_bare :: < :: mtproto :: channel_participant :: Creator > ( ) ? ) ) , :: ConstructorNumber ( 0xa82fa898 ) => Ok ( ChannelParticipant :: Admin ( _de . read_bare :: < :: mtproto :: channel_participant :: Admin > ( ) ? ) ) , :: ConstructorNumber ( 0x222c1886 ) => Ok ( ChannelParticipant :: Banned ( _de . read_bare :: < :: mtproto :: channel_participant :: Banned > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `ChannelParticipantsFilter`\n\n```text\nchannelParticipantsRecent#de3f3c79 = ChannelParticipantsFilter;\n\nchannelParticipantsAdmins#b4608969 = ChannelParticipantsFilter;\n\nchannelParticipantsKicked#a3b54985 q:string = ChannelParticipantsFilter;\n\nchannelParticipantsBots#b0d1865b = ChannelParticipantsFilter;\n\nchannelParticipantsBanned#1427a5e1 q:string = ChannelParticipantsFilter;\n\nchannelParticipantsSearch#656ac4b q:string = ChannelParticipantsFilter;\n```\n" ] pub enum ChannelParticipantsFilter { Recent , Admins , Kicked ( :: mtproto :: channel_participants :: Kicked ) , Bots , Banned ( :: mtproto :: channel_participants :: Banned ) , Search ( :: mtproto :: channel_participants :: Search ) , } impl ChannelParticipantsFilter { pub fn q ( & self ) -> Option < & :: mtproto :: string > { match self { & ChannelParticipantsFilter :: Banned ( ref x ) => Some ( & x . q ) , & ChannelParticipantsFilter :: Search ( ref x ) => Some ( & x . q ) , & ChannelParticipantsFilter :: Kicked ( ref x ) => Some ( & x . q ) , _ => None } } } impl :: BoxedSerialize for ChannelParticipantsFilter { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ChannelParticipantsFilter :: Recent => ( :: ConstructorNumber ( 0xde3f3c79 ) , & ( ) ) , & ChannelParticipantsFilter :: Admins => ( :: ConstructorNumber ( 0xb4608969 ) , & ( ) ) , & ChannelParticipantsFilter :: Kicked ( ref x ) => ( :: ConstructorNumber ( 0xa3b54985 ) , x ) , & ChannelParticipantsFilter :: Bots => ( :: ConstructorNumber ( 0xb0d1865b ) , & ( ) ) , & ChannelParticipantsFilter :: Banned ( ref x ) => ( :: ConstructorNumber ( 0x1427a5e1 ) , x ) , & ChannelParticipantsFilter :: Search ( ref x ) => ( :: ConstructorNumber ( 0x0656ac4b ) , x ) , } } } impl :: BoxedDeserialize for ChannelParticipantsFilter { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xde3f3c79 ) , :: ConstructorNumber ( 0xb4608969 ) , :: ConstructorNumber ( 0xa3b54985 ) , :: ConstructorNumber ( 0xb0d1865b ) , :: ConstructorNumber ( 0x1427a5e1 ) , :: ConstructorNumber ( 0x0656ac4b ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xde3f3c79 ) => Ok ( ChannelParticipantsFilter :: Recent ) , :: ConstructorNumber ( 0xb4608969 ) => Ok ( ChannelParticipantsFilter :: Admins ) , :: ConstructorNumber ( 0xa3b54985 ) => Ok ( ChannelParticipantsFilter :: Kicked ( _de . read_bare :: < :: mtproto :: channel_participants :: Kicked > ( ) ? ) ) , :: ConstructorNumber ( 0xb0d1865b ) => Ok ( ChannelParticipantsFilter :: Bots ) , :: ConstructorNumber ( 0x1427a5e1 ) => Ok ( ChannelParticipantsFilter :: Banned ( _de . read_bare :: < :: mtproto :: channel_participants :: Banned > ( ) ? ) ) , :: ConstructorNumber ( 0x0656ac4b ) => Ok ( ChannelParticipantsFilter :: Search ( _de . read_bare :: < :: mtproto :: channel_participants :: Search > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `Chat`\n\n```text\nchatEmpty#9ba2d800 id:int = Chat;\n\nchat#d91cdd54 flags:# creator:flags.0?true kicked:flags.1?true left:flags.2?true admins_enabled:flags.3?true admin:flags.4?true deactivated:flags.5?true id:int title:string photo:ChatPhoto participants_count:int date:int version:int migrated_to:flags.6?InputChannel = Chat;\n\nchatForbidden#7328bdb id:int title:string = Chat;\n\nchannel#450b7115 flags:# creator:flags.0?true left:flags.2?true editor:flags.3?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true democracy:flags.10?true signatures:flags.11?true min:flags.12?true id:int access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int version:int restriction_reason:flags.9?string admin_rights:flags.14?ChannelAdminRights banned_rights:flags.15?ChannelBannedRights participants_count:flags.17?int = Chat;\n\nchannelForbidden#289da732 flags:# broadcast:flags.5?true megagroup:flags.8?true id:int access_hash:long title:string until_date:flags.16?int = Chat;\n```\n" ] pub enum Chat { ChatEmpty ( :: mtproto :: chat :: ChatEmpty ) , Chat ( :: mtproto :: chat :: Chat ) , ChatForbidden ( :: mtproto :: chat :: ChatForbidden ) , Channel ( :: mtproto :: chat :: Channel ) , ChannelForbidden ( :: mtproto :: chat :: ChannelForbidden ) , } impl Chat { pub fn admin ( & self ) -> Option < bool > { match self { & Chat :: Chat ( ref x ) => Some ( x . admin ) , _ => None } } pub fn admin_rights ( & self ) -> Option < & :: mtproto :: ChannelAdminRights > { match self { & Chat :: Channel ( ref x ) => x . admin_rights . as_ref ( ) , _ => None } } pub fn admins_enabled ( & self ) -> Option < bool > { match self { & Chat :: Chat ( ref x ) => Some ( x . admins_enabled ) , _ => None } } pub fn banned_rights ( & self ) -> Option < & :: mtproto :: ChannelBannedRights > { match self { & Chat :: Channel ( ref x ) => x . banned_rights . as_ref ( ) , _ => None } } pub fn broadcast ( & self ) -> Option < bool > { match self { & Chat :: ChannelForbidden ( ref x ) => Some ( x . broadcast ) , & Chat :: Channel ( ref x ) => Some ( x . broadcast ) , _ => None } } pub fn creator ( & self ) -> Option < bool > { match self { & Chat :: Channel ( ref x ) => Some ( x . creator ) , & Chat :: Chat ( ref x ) => Some ( x . creator ) , _ => None } } pub fn date ( & self ) -> Option < & :: mtproto :: int > { match self { & Chat :: Channel ( ref x ) => Some ( & x . date ) , & Chat :: Chat ( ref x ) => Some ( & x . date ) , _ => None } } pub fn deactivated ( & self ) -> Option < bool > { match self { & Chat :: Chat ( ref x ) => Some ( x . deactivated ) , _ => None } } pub fn democracy ( & self ) -> Option < bool > { match self { & Chat :: Channel ( ref x ) => Some ( x . democracy ) , _ => None } } pub fn editor ( & self ) -> Option < bool > { match self { & Chat :: Channel ( ref x ) => Some ( x . editor ) , _ => None } } pub fn id ( & self ) -> & :: mtproto :: int { match self { & Chat :: ChatEmpty ( ref x ) => & x . id , & Chat :: Channel ( ref x ) => & x . id , & Chat :: ChannelForbidden ( ref x ) => & x . id , & Chat :: Chat ( ref x ) => & x . id , & Chat :: ChatForbidden ( ref x ) => & x . id , } } pub fn kicked ( & self ) -> Option < bool > { match self { & Chat :: Chat ( ref x ) => Some ( x . kicked ) , _ => None } } pub fn left ( & self ) -> Option < bool > { match self { & Chat :: Chat ( ref x ) => Some ( x . left ) , & Chat :: Channel ( ref x ) => Some ( x . left ) , _ => None } } pub fn megagroup ( & self ) -> Option < bool > { match self { & Chat :: Channel ( ref x ) => Some ( x . megagroup ) , & Chat :: ChannelForbidden ( ref x ) => Some ( x . megagroup ) , _ => None } } pub fn migrated_to ( & self ) -> Option < & :: mtproto :: InputChannel > { match self { & Chat :: Chat ( ref x ) => x . migrated_to . as_ref ( ) , _ => None } } pub fn min ( & self ) -> Option < bool > { match self { & Chat :: Channel ( ref x ) => Some ( x . min ) , _ => None } } pub fn photo ( & self ) -> Option < & :: mtproto :: ChatPhoto > { match self { & Chat :: Chat ( ref x ) => Some ( & x . photo ) , & Chat :: Channel ( ref x ) => Some ( & x . photo ) , _ => None } } pub fn restricted ( & self ) -> Option < bool > { match self { & Chat :: Channel ( ref x ) => Some ( x . restricted ) , _ => None } } pub fn restriction_reason ( & self ) -> Option < & :: mtproto :: string > { match self { & Chat :: Channel ( ref x ) => x . restriction_reason . as_ref ( ) , _ => None } } pub fn signatures ( & self ) -> Option < bool > { match self { & Chat :: Channel ( ref x ) => Some ( x . signatures ) , _ => None } } pub fn title ( & self ) -> Option < & :: mtproto :: string > { match self { & Chat :: ChatForbidden ( ref x ) => Some ( & x . title ) , & Chat :: Chat ( ref x ) => Some ( & x . title ) , & Chat :: ChannelForbidden ( ref x ) => Some ( & x . title ) , & Chat :: Channel ( ref x ) => Some ( & x . title ) , _ => None } } pub fn until_date ( & self ) -> Option < & :: mtproto :: int > { match self { & Chat :: ChannelForbidden ( ref x ) => x . until_date . as_ref ( ) , _ => None } } pub fn username ( & self ) -> Option < & :: mtproto :: string > { match self { & Chat :: Channel ( ref x ) => x . username . as_ref ( ) , _ => None } } pub fn verified ( & self ) -> Option < bool > { match self { & Chat :: Channel ( ref x ) => Some ( x . verified ) , _ => None } } pub fn version ( & self ) -> Option < & :: mtproto :: int > { match self { & Chat :: Chat ( ref x ) => Some ( & x . version ) , & Chat :: Channel ( ref x ) => Some ( & x . version ) , _ => None } } } impl :: BoxedSerialize for Chat { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Chat :: ChatEmpty ( ref x ) => ( :: ConstructorNumber ( 0x9ba2d800 ) , x ) , & Chat :: Chat ( ref x ) => ( :: ConstructorNumber ( 0xd91cdd54 ) , x ) , & Chat :: ChatForbidden ( ref x ) => ( :: ConstructorNumber ( 0x07328bdb ) , x ) , & Chat :: Channel ( ref x ) => ( :: ConstructorNumber ( 0x450b7115 ) , x ) , & Chat :: ChannelForbidden ( ref x ) => ( :: ConstructorNumber ( 0x289da732 ) , x ) , } } } impl :: BoxedDeserialize for Chat { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x9ba2d800 ) , :: ConstructorNumber ( 0xd91cdd54 ) , :: ConstructorNumber ( 0x07328bdb ) , :: ConstructorNumber ( 0x450b7115 ) , :: ConstructorNumber ( 0x289da732 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x9ba2d800 ) => Ok ( Chat :: ChatEmpty ( _de . read_bare :: < :: mtproto :: chat :: ChatEmpty > ( ) ? ) ) , :: ConstructorNumber ( 0xd91cdd54 ) => Ok ( Chat :: Chat ( _de . read_bare :: < :: mtproto :: chat :: Chat > ( ) ? ) ) , :: ConstructorNumber ( 0x07328bdb ) => Ok ( Chat :: ChatForbidden ( _de . read_bare :: < :: mtproto :: chat :: ChatForbidden > ( ) ? ) ) , :: ConstructorNumber ( 0x450b7115 ) => Ok ( Chat :: Channel ( _de . read_bare :: < :: mtproto :: chat :: Channel > ( ) ? ) ) , :: ConstructorNumber ( 0x289da732 ) => Ok ( Chat :: ChannelForbidden ( _de . read_bare :: < :: mtproto :: chat :: ChannelForbidden > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `ChatFull`\n\n```text\nchatFull#2e02a614 id:int participants:ChatParticipants chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:ExportedChatInvite bot_info:Vector<BotInfo> = ChatFull;\n\nchannelFull#76af5481 flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true id:int about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:ExportedChatInvite bot_info:Vector<BotInfo> migrated_from_chat_id:flags.4?int migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int = ChatFull;\n```\n" ] pub enum ChatFull { ChatFull ( :: mtproto :: chat_full :: ChatFull ) , ChannelFull ( :: mtproto :: chat_full :: ChannelFull ) , } impl ChatFull { pub fn about ( & self ) -> Option < & :: mtproto :: string > { match self { & ChatFull :: ChannelFull ( ref x ) => Some ( & x . about ) , _ => None } } pub fn admins_count ( & self ) -> Option < & :: mtproto :: int > { match self { & ChatFull :: ChannelFull ( ref x ) => x . admins_count . as_ref ( ) , _ => None } } pub fn available_min_id ( & self ) -> Option < & :: mtproto :: int > { match self { & ChatFull :: ChannelFull ( ref x ) => x . available_min_id . as_ref ( ) , _ => None } } pub fn banned_count ( & self ) -> Option < & :: mtproto :: int > { match self { & ChatFull :: ChannelFull ( ref x ) => x . banned_count . as_ref ( ) , _ => None } } pub fn bot_info ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: BotInfo > { match self { & ChatFull :: ChatFull ( ref x ) => & x . bot_info , & ChatFull :: ChannelFull ( ref x ) => & x . bot_info , } } pub fn can_set_stickers ( & self ) -> Option < bool > { match self { & ChatFull :: ChannelFull ( ref x ) => Some ( x . can_set_stickers ) , _ => None } } pub fn can_set_username ( & self ) -> Option < bool > { match self { & ChatFull :: ChannelFull ( ref x ) => Some ( x . can_set_username ) , _ => None } } pub fn can_view_participants ( & self ) -> Option < bool > { match self { & ChatFull :: ChannelFull ( ref x ) => Some ( x . can_view_participants ) , _ => None } } pub fn chat_photo ( & self ) -> & :: mtproto :: Photo { match self { & ChatFull :: ChatFull ( ref x ) => & x . chat_photo , & ChatFull :: ChannelFull ( ref x ) => & x . chat_photo , } } pub fn exported_invite ( & self ) -> & :: mtproto :: ExportedChatInvite { match self { & ChatFull :: ChannelFull ( ref x ) => & x . exported_invite , & ChatFull :: ChatFull ( ref x ) => & x . exported_invite , } } pub fn hidden_prehistory ( & self ) -> Option < bool > { match self { & ChatFull :: ChannelFull ( ref x ) => Some ( x . hidden_prehistory ) , _ => None } } pub fn id ( & self ) -> & :: mtproto :: int { match self { & ChatFull :: ChatFull ( ref x ) => & x . id , & ChatFull :: ChannelFull ( ref x ) => & x . id , } } pub fn kicked_count ( & self ) -> Option < & :: mtproto :: int > { match self { & ChatFull :: ChannelFull ( ref x ) => x . kicked_count . as_ref ( ) , _ => None } } pub fn migrated_from_chat_id ( & self ) -> Option < & :: mtproto :: int > { match self { & ChatFull :: ChannelFull ( ref x ) => x . migrated_from_chat_id . as_ref ( ) , _ => None } } pub fn migrated_from_max_id ( & self ) -> Option < & :: mtproto :: int > { match self { & ChatFull :: ChannelFull ( ref x ) => x . migrated_from_max_id . as_ref ( ) , _ => None } } pub fn notify_settings ( & self ) -> & :: mtproto :: PeerNotifySettings { match self { & ChatFull :: ChatFull ( ref x ) => & x . notify_settings , & ChatFull :: ChannelFull ( ref x ) => & x . notify_settings , } } pub fn participants ( & self ) -> Option < & :: mtproto :: ChatParticipants > { match self { & ChatFull :: ChatFull ( ref x ) => Some ( & x . participants ) , _ => None } } pub fn participants_count ( & self ) -> Option < & :: mtproto :: int > { match self { & ChatFull :: ChannelFull ( ref x ) => x . participants_count . as_ref ( ) , _ => None } } pub fn pinned_msg_id ( & self ) -> Option < & :: mtproto :: int > { match self { & ChatFull :: ChannelFull ( ref x ) => x . pinned_msg_id . as_ref ( ) , _ => None } } pub fn read_inbox_max_id ( & self ) -> Option < & :: mtproto :: int > { match self { & ChatFull :: ChannelFull ( ref x ) => Some ( & x . read_inbox_max_id ) , _ => None } } pub fn read_outbox_max_id ( & self ) -> Option < & :: mtproto :: int > { match self { & ChatFull :: ChannelFull ( ref x ) => Some ( & x . read_outbox_max_id ) , _ => None } } pub fn stickerset ( & self ) -> Option < & :: mtproto :: StickerSet > { match self { & ChatFull :: ChannelFull ( ref x ) => x . stickerset . as_ref ( ) , _ => None } } pub fn unread_count ( & self ) -> Option < & :: mtproto :: int > { match self { & ChatFull :: ChannelFull ( ref x ) => Some ( & x . unread_count ) , _ => None } } } impl :: BoxedSerialize for ChatFull { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ChatFull :: ChatFull ( ref x ) => ( :: ConstructorNumber ( 0x2e02a614 ) , x ) , & ChatFull :: ChannelFull ( ref x ) => ( :: ConstructorNumber ( 0x76af5481 ) , x ) , } } } impl :: BoxedDeserialize for ChatFull { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x2e02a614 ) , :: ConstructorNumber ( 0x76af5481 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x2e02a614 ) => Ok ( ChatFull :: ChatFull ( _de . read_bare :: < :: mtproto :: chat_full :: ChatFull > ( ) ? ) ) , :: ConstructorNumber ( 0x76af5481 ) => Ok ( ChatFull :: ChannelFull ( _de . read_bare :: < :: mtproto :: chat_full :: ChannelFull > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `ChatInvite`\n\n```text\nchatInviteAlready#5a686d7c chat:Chat = ChatInvite;\n\nchatInvite#db74f558 flags:# channel:flags.0?true broadcast:flags.1?true public:flags.2?true megagroup:flags.3?true title:string photo:ChatPhoto participants_count:int participants:flags.4?Vector<User> = ChatInvite;\n```\n" ] pub enum ChatInvite { Already ( :: mtproto :: chat_invite :: Already ) , ChatInvite ( :: mtproto :: chat_invite :: ChatInvite ) , } impl ChatInvite { pub fn broadcast ( & self ) -> Option < bool > { match self { & ChatInvite :: ChatInvite ( ref x ) => Some ( x . broadcast ) , _ => None } } pub fn channel ( & self ) -> Option < bool > { match self { & ChatInvite :: ChatInvite ( ref x ) => Some ( x . channel ) , _ => None } } pub fn chat ( & self ) -> Option < & :: mtproto :: Chat > { match self { & ChatInvite :: Already ( ref x ) => Some ( & x . chat ) , _ => None } } pub fn megagroup ( & self ) -> Option < bool > { match self { & ChatInvite :: ChatInvite ( ref x ) => Some ( x . megagroup ) , _ => None } } pub fn participants ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > { match self { & ChatInvite :: ChatInvite ( ref x ) => x . participants . as_ref ( ) , _ => None } } pub fn participants_count ( & self ) -> Option < & :: mtproto :: int > { match self { & ChatInvite :: ChatInvite ( ref x ) => Some ( & x . participants_count ) , _ => None } } pub fn photo ( & self ) -> Option < & :: mtproto :: ChatPhoto > { match self { & ChatInvite :: ChatInvite ( ref x ) => Some ( & x . photo ) , _ => None } } pub fn public ( & self ) -> Option < bool > { match self { & ChatInvite :: ChatInvite ( ref x ) => Some ( x . public ) , _ => None } } pub fn title ( & self ) -> Option < & :: mtproto :: string > { match self { & ChatInvite :: ChatInvite ( ref x ) => Some ( & x . title ) , _ => None } } } impl :: BoxedSerialize for ChatInvite { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ChatInvite :: Already ( ref x ) => ( :: ConstructorNumber ( 0x5a686d7c ) , x ) , & ChatInvite :: ChatInvite ( ref x ) => ( :: ConstructorNumber ( 0xdb74f558 ) , x ) , } } } impl :: BoxedDeserialize for ChatInvite { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x5a686d7c ) , :: ConstructorNumber ( 0xdb74f558 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x5a686d7c ) => Ok ( ChatInvite :: Already ( _de . read_bare :: < :: mtproto :: chat_invite :: Already > ( ) ? ) ) , :: ConstructorNumber ( 0xdb74f558 ) => Ok ( ChatInvite :: ChatInvite ( _de . read_bare :: < :: mtproto :: chat_invite :: ChatInvite > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `ChatParticipant`\n\n```text\nchatParticipant#c8d7493e user_id:int inviter_id:int date:int = ChatParticipant;\n\nchatParticipantCreator#da13538a user_id:int = ChatParticipant;\n\nchatParticipantAdmin#e2d6e436 user_id:int inviter_id:int date:int = ChatParticipant;\n```\n" ] pub enum ChatParticipant { ChatParticipant ( :: mtproto :: chat_participant :: ChatParticipant ) , Creator ( :: mtproto :: chat_participant :: Creator ) , Admin ( :: mtproto :: chat_participant :: Admin ) , } impl ChatParticipant { pub fn date ( & self ) -> Option < & :: mtproto :: int > { match self { & ChatParticipant :: ChatParticipant ( ref x ) => Some ( & x . date ) , & ChatParticipant :: Admin ( ref x ) => Some ( & x . date ) , _ => None } } pub fn inviter_id ( & self ) -> Option < & :: mtproto :: int > { match self { & ChatParticipant :: Admin ( ref x ) => Some ( & x . inviter_id ) , & ChatParticipant :: ChatParticipant ( ref x ) => Some ( & x . inviter_id ) , _ => None } } pub fn user_id ( & self ) -> & :: mtproto :: int { match self { & ChatParticipant :: ChatParticipant ( ref x ) => & x . user_id , & ChatParticipant :: Admin ( ref x ) => & x . user_id , & ChatParticipant :: Creator ( ref x ) => & x . user_id , } } } impl :: BoxedSerialize for ChatParticipant { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ChatParticipant :: ChatParticipant ( ref x ) => ( :: ConstructorNumber ( 0xc8d7493e ) , x ) , & ChatParticipant :: Creator ( ref x ) => ( :: ConstructorNumber ( 0xda13538a ) , x ) , & ChatParticipant :: Admin ( ref x ) => ( :: ConstructorNumber ( 0xe2d6e436 ) , x ) , } } } impl :: BoxedDeserialize for ChatParticipant { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xc8d7493e ) , :: ConstructorNumber ( 0xda13538a ) , :: ConstructorNumber ( 0xe2d6e436 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xc8d7493e ) => Ok ( ChatParticipant :: ChatParticipant ( _de . read_bare :: < :: mtproto :: chat_participant :: ChatParticipant > ( ) ? ) ) , :: ConstructorNumber ( 0xda13538a ) => Ok ( ChatParticipant :: Creator ( _de . read_bare :: < :: mtproto :: chat_participant :: Creator > ( ) ? ) ) , :: ConstructorNumber ( 0xe2d6e436 ) => Ok ( ChatParticipant :: Admin ( _de . read_bare :: < :: mtproto :: chat_participant :: Admin > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `ChatParticipants`\n\n```text\nchatParticipantsForbidden#fc900c2b flags:# chat_id:int self_participant:flags.0?ChatParticipant = ChatParticipants;\n\nchatParticipants#3f460fed chat_id:int participants:Vector<ChatParticipant> version:int = ChatParticipants;\n```\n" ] pub enum ChatParticipants { Forbidden ( :: mtproto :: chat_participants :: Forbidden ) , ChatParticipants ( :: mtproto :: chat_participants :: ChatParticipants ) , } impl ChatParticipants { pub fn chat_id ( & self ) -> & :: mtproto :: int { match self { & ChatParticipants :: Forbidden ( ref x ) => & x . chat_id , & ChatParticipants :: ChatParticipants ( ref x ) => & x . chat_id , } } pub fn participants ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: ChatParticipant > > { match self { & ChatParticipants :: ChatParticipants ( ref x ) => Some ( & x . participants ) , _ => None } } pub fn self_participant ( & self ) -> Option < & :: mtproto :: ChatParticipant > { match self { & ChatParticipants :: Forbidden ( ref x ) => x . self_participant . as_ref ( ) , _ => None } } pub fn version ( & self ) -> Option < & :: mtproto :: int > { match self { & ChatParticipants :: ChatParticipants ( ref x ) => Some ( & x . version ) , _ => None } } } impl :: BoxedSerialize for ChatParticipants { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ChatParticipants :: Forbidden ( ref x ) => ( :: ConstructorNumber ( 0xfc900c2b ) , x ) , & ChatParticipants :: ChatParticipants ( ref x ) => ( :: ConstructorNumber ( 0x3f460fed ) , x ) , } } } impl :: BoxedDeserialize for ChatParticipants { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xfc900c2b ) , :: ConstructorNumber ( 0x3f460fed ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xfc900c2b ) => Ok ( ChatParticipants :: Forbidden ( _de . read_bare :: < :: mtproto :: chat_participants :: Forbidden > ( ) ? ) ) , :: ConstructorNumber ( 0x3f460fed ) => Ok ( ChatParticipants :: ChatParticipants ( _de . read_bare :: < :: mtproto :: chat_participants :: ChatParticipants > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `ChatPhoto`\n\n```text\nchatPhotoEmpty#37c1011c = ChatPhoto;\n\nchatPhoto#6153276a photo_small:FileLocation photo_big:FileLocation = ChatPhoto;\n```\n" ] pub enum ChatPhoto { Empty , ChatPhoto ( :: mtproto :: chat_photo :: ChatPhoto ) , } impl ChatPhoto { pub fn photo_big ( & self ) -> Option < & :: mtproto :: FileLocation > { match self { & ChatPhoto :: ChatPhoto ( ref x ) => Some ( & x . photo_big ) , _ => None } } pub fn photo_small ( & self ) -> Option < & :: mtproto :: FileLocation > { match self { & ChatPhoto :: ChatPhoto ( ref x ) => Some ( & x . photo_small ) , _ => None } } } impl :: BoxedSerialize for ChatPhoto { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ChatPhoto :: Empty => ( :: ConstructorNumber ( 0x37c1011c ) , & ( ) ) , & ChatPhoto :: ChatPhoto ( ref x ) => ( :: ConstructorNumber ( 0x6153276a ) , x ) , } } } impl :: BoxedDeserialize for ChatPhoto { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x37c1011c ) , :: ConstructorNumber ( 0x6153276a ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x37c1011c ) => Ok ( ChatPhoto :: Empty ) , :: ConstructorNumber ( 0x6153276a ) => Ok ( ChatPhoto :: ChatPhoto ( _de . read_bare :: < :: mtproto :: chat_photo :: ChatPhoto > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } impl :: BoxedSerialize for Option < :: mtproto :: chat_photo :: ChatPhoto > { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match * self { None => ( :: ConstructorNumber ( 0x37c1011c ) , & ( ) ) , Some ( ref x ) => ( :: ConstructorNumber ( 0x6153276a ) , x ) , } } } impl :: BoxedDeserialize for Option < :: mtproto :: chat_photo :: ChatPhoto > { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x37c1011c ) , :: ConstructorNumber ( 0x6153276a ) ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x37c1011c ) => Ok ( None ) , :: ConstructorNumber ( 0x6153276a ) => Ok ( Some ( _de . read_bare :: < :: mtproto :: chat_photo :: ChatPhoto > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `Client_DH_Inner_Data`\n\n```text\nclient_DH_inner_data#6643b654 nonce:int128 server_nonce:int128 retry_id:long g_b:string = Client_DH_Inner_Data;\n```\n" ] pub enum ClientDHInnerData { ClientDHInnerData ( :: mtproto :: client_dh_inner_data :: ClientDHInnerData ) , } impl ClientDHInnerData { pub fn g_b ( & self ) -> & :: mtproto :: bytes { match self { & ClientDHInnerData :: ClientDHInnerData ( ref x ) => & x . g_b , } } pub fn nonce ( & self ) -> & :: mtproto :: int128 { match self { & ClientDHInnerData :: ClientDHInnerData ( ref x ) => & x . nonce , } } pub fn retry_id ( & self ) -> & :: mtproto :: long { match self { & ClientDHInnerData :: ClientDHInnerData ( ref x ) => & x . retry_id , } } pub fn server_nonce ( & self ) -> & :: mtproto :: int128 { match self { & ClientDHInnerData :: ClientDHInnerData ( ref x ) => & x . server_nonce , } } } impl :: BoxedSerialize for ClientDHInnerData { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ClientDHInnerData :: ClientDHInnerData ( ref x ) => ( :: ConstructorNumber ( 0x6643b654 ) , x ) , } } } impl :: BoxedDeserialize for ClientDHInnerData { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x6643b654 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x6643b654 ) => Ok ( ClientDHInnerData :: ClientDHInnerData ( _de . read_bare :: < :: mtproto :: client_dh_inner_data :: ClientDHInnerData > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `Config`\n\n```text\nconfig#9c840964 flags:# phonecalls_enabled:flags.1?true default_p2p_contacts:flags.3?true date:int expires:int test_mode:Bool this_dc:int dc_options:Vector<DcOption> chat_size_max:int megagroup_size_max:int forwarded_count_max:int online_update_period_ms:int offline_blur_timeout_ms:int offline_idle_timeout_ms:int online_cloud_timeout_ms:int notify_cloud_delay_ms:int notify_default_delay_ms:int chat_big_size:int push_chat_period_ms:int push_chat_limit:int saved_gifs_limit:int edit_time_limit:int rating_e_decay:int stickers_recent_limit:int stickers_faved_limit:int channels_read_media_period:int tmp_sessions:flags.0?int pinned_dialogs_count_max:int call_receive_timeout_ms:int call_ring_timeout_ms:int call_connect_timeout_ms:int call_packet_timeout_ms:int me_url_prefix:string suggested_lang_code:flags.2?string lang_pack_version:flags.2?int disabled_features:Vector<DisabledFeature> = Config;\n```\n" ] pub enum Config { Config ( :: mtproto :: config :: Config ) , } impl Config { pub fn call_connect_timeout_ms ( & self ) -> & :: mtproto :: int { match self { & Config :: Config ( ref x ) => & x . call_connect_timeout_ms , } } pub fn call_packet_timeout_ms ( & self ) -> & :: mtproto :: int { match self { & Config :: Config ( ref x ) => & x . call_packet_timeout_ms , } } pub fn call_receive_timeout_ms ( & self ) -> & :: mtproto :: int { match self { & Config :: Config ( ref x ) => & x . call_receive_timeout_ms , } } pub fn call_ring_timeout_ms ( & self ) -> & :: mtproto :: int { match self { & Config :: Config ( ref x ) => & x . call_ring_timeout_ms , } } pub fn channels_read_media_period ( & self ) -> & :: mtproto :: int { match self { & Config :: Config ( ref x ) => & x . channels_read_media_period , } } pub fn chat_big_size ( & self ) -> & :: mtproto :: int { match self { & Config :: Config ( ref x ) => & x . chat_big_size , } } pub fn chat_size_max ( & self ) -> & :: mtproto :: int { match self { & Config :: Config ( ref x ) => & x . chat_size_max , } } pub fn date ( & self ) -> & :: mtproto :: int { match self { & Config :: Config ( ref x ) => & x . date , } } pub fn dc_options ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: DcOption > { match self { & Config :: Config ( ref x ) => & x . dc_options , } } pub fn default_p2p_contacts ( & self ) -> bool { match self { & Config :: Config ( ref x ) => x . default_p2p_contacts , } } pub fn disabled_features ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: DisabledFeature > { match self { & Config :: Config ( ref x ) => & x . disabled_features , } } pub fn edit_time_limit ( & self ) -> & :: mtproto :: int { match self { & Config :: Config ( ref x ) => & x . edit_time_limit , } } pub fn expires ( & self ) -> & :: mtproto :: int { match self { & Config :: Config ( ref x ) => & x . expires , } } pub fn forwarded_count_max ( & self ) -> & :: mtproto :: int { match self { & Config :: Config ( ref x ) => & x . forwarded_count_max , } } pub fn lang_pack_version ( & self ) -> Option < & :: mtproto :: int > { match self { & Config :: Config ( ref x ) => x . lang_pack_version . as_ref ( ) , } } pub fn me_url_prefix ( & self ) -> & :: mtproto :: string { match self { & Config :: Config ( ref x ) => & x . me_url_prefix , } } pub fn megagroup_size_max ( & self ) -> & :: mtproto :: int { match self { & Config :: Config ( ref x ) => & x . megagroup_size_max , } } pub fn notify_cloud_delay_ms ( & self ) -> & :: mtproto :: int { match self { & Config :: Config ( ref x ) => & x . notify_cloud_delay_ms , } } pub fn notify_default_delay_ms ( & self ) -> & :: mtproto :: int { match self { & Config :: Config ( ref x ) => & x . notify_default_delay_ms , } } pub fn offline_blur_timeout_ms ( & self ) -> & :: mtproto :: int { match self { & Config :: Config ( ref x ) => & x . offline_blur_timeout_ms , } } pub fn offline_idle_timeout_ms ( & self ) -> & :: mtproto :: int { match self { & Config :: Config ( ref x ) => & x . offline_idle_timeout_ms , } } pub fn online_cloud_timeout_ms ( & self ) -> & :: mtproto :: int { match self { & Config :: Config ( ref x ) => & x . online_cloud_timeout_ms , } } pub fn online_update_period_ms ( & self ) -> & :: mtproto :: int { match self { & Config :: Config ( ref x ) => & x . online_update_period_ms , } } pub fn phonecalls_enabled ( & self ) -> bool { match self { & Config :: Config ( ref x ) => x . phonecalls_enabled , } } pub fn pinned_dialogs_count_max ( & self ) -> & :: mtproto :: int { match self { & Config :: Config ( ref x ) => & x . pinned_dialogs_count_max , } } pub fn push_chat_limit ( & self ) -> & :: mtproto :: int { match self { & Config :: Config ( ref x ) => & x . push_chat_limit , } } pub fn push_chat_period_ms ( & self ) -> & :: mtproto :: int { match self { & Config :: Config ( ref x ) => & x . push_chat_period_ms , } } pub fn rating_e_decay ( & self ) -> & :: mtproto :: int { match self { & Config :: Config ( ref x ) => & x . rating_e_decay , } } pub fn saved_gifs_limit ( & self ) -> & :: mtproto :: int { match self { & Config :: Config ( ref x ) => & x . saved_gifs_limit , } } pub fn stickers_faved_limit ( & self ) -> & :: mtproto :: int { match self { & Config :: Config ( ref x ) => & x . stickers_faved_limit , } } pub fn stickers_recent_limit ( & self ) -> & :: mtproto :: int { match self { & Config :: Config ( ref x ) => & x . stickers_recent_limit , } } pub fn suggested_lang_code ( & self ) -> Option < & :: mtproto :: string > { match self { & Config :: Config ( ref x ) => x . suggested_lang_code . as_ref ( ) , } } pub fn test_mode ( & self ) -> & :: mtproto :: Bool { match self { & Config :: Config ( ref x ) => & x . test_mode , } } pub fn this_dc ( & self ) -> & :: mtproto :: int { match self { & Config :: Config ( ref x ) => & x . this_dc , } } pub fn tmp_sessions ( & self ) -> Option < & :: mtproto :: int > { match self { & Config :: Config ( ref x ) => x . tmp_sessions . as_ref ( ) , } } } impl :: BoxedSerialize for Config { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Config :: Config ( ref x ) => ( :: ConstructorNumber ( 0x9c840964 ) , x ) , } } } impl :: BoxedDeserialize for Config { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x9c840964 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x9c840964 ) => Ok ( Config :: Config ( _de . read_bare :: < :: mtproto :: config :: Config > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `Contact`\n\n```text\ncontact#f911c994 user_id:int mutual:Bool = Contact;\n```\n" ] pub enum Contact { Contact ( :: mtproto :: contact :: Contact ) , } impl Contact { pub fn mutual ( & self ) -> & :: mtproto :: Bool { match self { & Contact :: Contact ( ref x ) => & x . mutual , } } pub fn user_id ( & self ) -> & :: mtproto :: int { match self { & Contact :: Contact ( ref x ) => & x . user_id , } } } impl :: BoxedSerialize for Contact { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Contact :: Contact ( ref x ) => ( :: ConstructorNumber ( 0xf911c994 ) , x ) , } } } impl :: BoxedDeserialize for Contact { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xf911c994 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xf911c994 ) => Ok ( Contact :: Contact ( _de . read_bare :: < :: mtproto :: contact :: Contact > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `ContactBlocked`\n\n```text\ncontactBlocked#561bc879 user_id:int date:int = ContactBlocked;\n```\n" ] pub enum ContactBlocked { ContactBlocked ( :: mtproto :: contact_blocked :: ContactBlocked ) , } impl ContactBlocked { pub fn date ( & self ) -> & :: mtproto :: int { match self { & ContactBlocked :: ContactBlocked ( ref x ) => & x . date , } } pub fn user_id ( & self ) -> & :: mtproto :: int { match self { & ContactBlocked :: ContactBlocked ( ref x ) => & x . user_id , } } } impl :: BoxedSerialize for ContactBlocked { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ContactBlocked :: ContactBlocked ( ref x ) => ( :: ConstructorNumber ( 0x561bc879 ) , x ) , } } } impl :: BoxedDeserialize for ContactBlocked { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x561bc879 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x561bc879 ) => Ok ( ContactBlocked :: ContactBlocked ( _de . read_bare :: < :: mtproto :: contact_blocked :: ContactBlocked > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `ContactLink`\n\n```text\ncontactLinkUnknown#5f4f9247 = ContactLink;\n\ncontactLinkNone#feedd3ad = ContactLink;\n\ncontactLinkHasPhone#268f3f59 = ContactLink;\n\ncontactLinkContact#d502c2d0 = ContactLink;\n```\n" ] pub enum ContactLink { Unknown , None , HasPhone , Contact , } impl :: BoxedSerialize for ContactLink { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ContactLink :: Unknown => ( :: ConstructorNumber ( 0x5f4f9247 ) , & ( ) ) , & ContactLink :: None => ( :: ConstructorNumber ( 0xfeedd3ad ) , & ( ) ) , & ContactLink :: HasPhone => ( :: ConstructorNumber ( 0x268f3f59 ) , & ( ) ) , & ContactLink :: Contact => ( :: ConstructorNumber ( 0xd502c2d0 ) , & ( ) ) , } } } impl :: BoxedDeserialize for ContactLink { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x5f4f9247 ) , :: ConstructorNumber ( 0xfeedd3ad ) , :: ConstructorNumber ( 0x268f3f59 ) , :: ConstructorNumber ( 0xd502c2d0 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x5f4f9247 ) => Ok ( ContactLink :: Unknown ) , :: ConstructorNumber ( 0xfeedd3ad ) => Ok ( ContactLink :: None ) , :: ConstructorNumber ( 0x268f3f59 ) => Ok ( ContactLink :: HasPhone ) , :: ConstructorNumber ( 0xd502c2d0 ) => Ok ( ContactLink :: Contact ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `ContactStatus`\n\n```text\ncontactStatus#d3680c61 user_id:int status:UserStatus = ContactStatus;\n```\n" ] pub enum ContactStatus { ContactStatus ( :: mtproto :: contact_status :: ContactStatus ) , } impl ContactStatus { pub fn status ( & self ) -> & :: mtproto :: UserStatus { match self { & ContactStatus :: ContactStatus ( ref x ) => & x . status , } } pub fn user_id ( & self ) -> & :: mtproto :: int { match self { & ContactStatus :: ContactStatus ( ref x ) => & x . user_id , } } } impl :: BoxedSerialize for ContactStatus { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ContactStatus :: ContactStatus ( ref x ) => ( :: ConstructorNumber ( 0xd3680c61 ) , x ) , } } } impl :: BoxedDeserialize for ContactStatus { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xd3680c61 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xd3680c61 ) => Ok ( ContactStatus :: ContactStatus ( _de . read_bare :: < :: mtproto :: contact_status :: ContactStatus > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `DataJSON`\n\n```text\ndataJSON#7d748d04 data:string = DataJSON;\n```\n" ] pub enum DataJSON { DataJSON ( :: mtproto :: data_json :: DataJSON ) , } impl DataJSON { pub fn data ( & self ) -> & :: mtproto :: string { match self { & DataJSON :: DataJSON ( ref x ) => & x . data , } } } impl :: BoxedSerialize for DataJSON { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & DataJSON :: DataJSON ( ref x ) => ( :: ConstructorNumber ( 0x7d748d04 ) , x ) , } } } impl :: BoxedDeserialize for DataJSON { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x7d748d04 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x7d748d04 ) => Ok ( DataJSON :: DataJSON ( _de . read_bare :: < :: mtproto :: data_json :: DataJSON > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `DcOption`\n\n```text\ndcOption#5d8c6cc flags:# ipv6:flags.0?true media_only:flags.1?true tcpo_only:flags.2?true cdn:flags.3?true static:flags.4?true id:int ip_address:string port:int = DcOption;\n```\n" ] pub enum DcOption { DcOption ( :: mtproto :: dc_option :: DcOption ) , } impl DcOption { pub fn cdn ( & self ) -> bool { match self { & DcOption :: DcOption ( ref x ) => x . cdn , } } pub fn id ( & self ) -> & :: mtproto :: int { match self { & DcOption :: DcOption ( ref x ) => & x . id , } } pub fn ip_address ( & self ) -> & :: mtproto :: string { match self { & DcOption :: DcOption ( ref x ) => & x . ip_address , } } pub fn ipv6 ( & self ) -> bool { match self { & DcOption :: DcOption ( ref x ) => x . ipv6 , } } pub fn media_only ( & self ) -> bool { match self { & DcOption :: DcOption ( ref x ) => x . media_only , } } pub fn port ( & self ) -> & :: mtproto :: int { match self { & DcOption :: DcOption ( ref x ) => & x . port , } } pub fn static_ ( & self ) -> bool { match self { & DcOption :: DcOption ( ref x ) => x . static_ , } } pub fn tcpo_only ( & self ) -> bool { match self { & DcOption :: DcOption ( ref x ) => x . tcpo_only , } } } impl :: BoxedSerialize for DcOption { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & DcOption :: DcOption ( ref x ) => ( :: ConstructorNumber ( 0x05d8c6cc ) , x ) , } } } impl :: BoxedDeserialize for DcOption { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x05d8c6cc ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x05d8c6cc ) => Ok ( DcOption :: DcOption ( _de . read_bare :: < :: mtproto :: dc_option :: DcOption > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `DestroyAuthKeyRes`\n\n```text\ndestroy_auth_key_ok#f660e1d4 = DestroyAuthKeyRes;\n\ndestroy_auth_key_none#0a9f2259 = DestroyAuthKeyRes;\n\ndestroy_auth_key_fail#ea109b13 = DestroyAuthKeyRes;\n```\n" ] pub enum DestroyAuthKeyRes { Ok , None , Fail , } impl :: BoxedSerialize for DestroyAuthKeyRes { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & DestroyAuthKeyRes :: Ok => ( :: ConstructorNumber ( 0xf660e1d4 ) , & ( ) ) , & DestroyAuthKeyRes :: None => ( :: ConstructorNumber ( 0x0a9f2259 ) , & ( ) ) , & DestroyAuthKeyRes :: Fail => ( :: ConstructorNumber ( 0xea109b13 ) , & ( ) ) , } } } impl :: BoxedDeserialize for DestroyAuthKeyRes { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xf660e1d4 ) , :: ConstructorNumber ( 0x0a9f2259 ) , :: ConstructorNumber ( 0xea109b13 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xf660e1d4 ) => Ok ( DestroyAuthKeyRes :: Ok ) , :: ConstructorNumber ( 0x0a9f2259 ) => Ok ( DestroyAuthKeyRes :: None ) , :: ConstructorNumber ( 0xea109b13 ) => Ok ( DestroyAuthKeyRes :: Fail ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `DestroySessionRes`\n\n```text\ndestroy_session_ok#e22045fc session_id:long = DestroySessionRes;\n\ndestroy_session_none#62d350c9 session_id:long = DestroySessionRes;\n```\n" ] pub enum DestroySessionRes { Ok ( :: mtproto :: destroy_session :: Ok ) , None ( :: mtproto :: destroy_session :: None ) , } impl DestroySessionRes { pub fn session_id ( & self ) -> & :: mtproto :: long { match self { & DestroySessionRes :: Ok ( ref x ) => & x . session_id , & DestroySessionRes :: None ( ref x ) => & x . session_id , } } } impl :: BoxedSerialize for DestroySessionRes { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & DestroySessionRes :: Ok ( ref x ) => ( :: ConstructorNumber ( 0xe22045fc ) , x ) , & DestroySessionRes :: None ( ref x ) => ( :: ConstructorNumber ( 0x62d350c9 ) , x ) , } } } impl :: BoxedDeserialize for DestroySessionRes { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xe22045fc ) , :: ConstructorNumber ( 0x62d350c9 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xe22045fc ) => Ok ( DestroySessionRes :: Ok ( _de . read_bare :: < :: mtproto :: destroy_session :: Ok > ( ) ? ) ) , :: ConstructorNumber ( 0x62d350c9 ) => Ok ( DestroySessionRes :: None ( _de . read_bare :: < :: mtproto :: destroy_session :: None > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `Dialog`\n\n```text\ndialog#e4def5db flags:# pinned:flags.2?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage = Dialog;\n```\n" ] pub enum Dialog { Dialog ( :: mtproto :: dialog :: Dialog ) , } impl Dialog { pub fn draft ( & self ) -> Option < & :: mtproto :: DraftMessage > { match self { & Dialog :: Dialog ( ref x ) => x . draft . as_ref ( ) , } } pub fn notify_settings ( & self ) -> & :: mtproto :: PeerNotifySettings { match self { & Dialog :: Dialog ( ref x ) => & x . notify_settings , } } pub fn peer ( & self ) -> & :: mtproto :: Peer { match self { & Dialog :: Dialog ( ref x ) => & x . peer , } } pub fn pinned ( & self ) -> bool { match self { & Dialog :: Dialog ( ref x ) => x . pinned , } } pub fn pts ( & self ) -> Option < & :: mtproto :: int > { match self { & Dialog :: Dialog ( ref x ) => x . pts . as_ref ( ) , } } pub fn read_inbox_max_id ( & self ) -> & :: mtproto :: int { match self { & Dialog :: Dialog ( ref x ) => & x . read_inbox_max_id , } } pub fn read_outbox_max_id ( & self ) -> & :: mtproto :: int { match self { & Dialog :: Dialog ( ref x ) => & x . read_outbox_max_id , } } pub fn top_message ( & self ) -> & :: mtproto :: int { match self { & Dialog :: Dialog ( ref x ) => & x . top_message , } } pub fn unread_count ( & self ) -> & :: mtproto :: int { match self { & Dialog :: Dialog ( ref x ) => & x . unread_count , } } pub fn unread_mentions_count ( & self ) -> & :: mtproto :: int { match self { & Dialog :: Dialog ( ref x ) => & x . unread_mentions_count , } } } impl :: BoxedSerialize for Dialog { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Dialog :: Dialog ( ref x ) => ( :: ConstructorNumber ( 0xe4def5db ) , x ) , } } } impl :: BoxedDeserialize for Dialog { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xe4def5db ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xe4def5db ) => Ok ( Dialog :: Dialog ( _de . read_bare :: < :: mtproto :: dialog :: Dialog > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `DisabledFeature`\n\n```text\ndisabledFeature#ae636f24 feature:string description:string = DisabledFeature;\n```\n" ] pub enum DisabledFeature { DisabledFeature ( :: mtproto :: disabled_feature :: DisabledFeature ) , } impl DisabledFeature { pub fn description ( & self ) -> & :: mtproto :: string { match self { & DisabledFeature :: DisabledFeature ( ref x ) => & x . description , } } pub fn feature ( & self ) -> & :: mtproto :: string { match self { & DisabledFeature :: DisabledFeature ( ref x ) => & x . feature , } } } impl :: BoxedSerialize for DisabledFeature { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & DisabledFeature :: DisabledFeature ( ref x ) => ( :: ConstructorNumber ( 0xae636f24 ) , x ) , } } } impl :: BoxedDeserialize for DisabledFeature { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xae636f24 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xae636f24 ) => Ok ( DisabledFeature :: DisabledFeature ( _de . read_bare :: < :: mtproto :: disabled_feature :: DisabledFeature > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `Document`\n\n```text\ndocumentEmpty#36f8c871 id:long = Document;\n\ndocument#87232bc7 id:long access_hash:long date:int mime_type:string size:int thumb:PhotoSize dc_id:int version:int attributes:Vector<DocumentAttribute> = Document;\n```\n" ] pub enum Document { Empty ( :: mtproto :: document :: Empty ) , Document ( :: mtproto :: document :: Document ) , } impl Document { pub fn access_hash ( & self ) -> Option < & :: mtproto :: long > { match self { & Document :: Document ( ref x ) => Some ( & x . access_hash ) , _ => None } } pub fn attributes ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: DocumentAttribute > > { match self { & Document :: Document ( ref x ) => Some ( & x . attributes ) , _ => None } } pub fn date ( & self ) -> Option < & :: mtproto :: int > { match self { & Document :: Document ( ref x ) => Some ( & x . date ) , _ => None } } pub fn dc_id ( & self ) -> Option < & :: mtproto :: int > { match self { & Document :: Document ( ref x ) => Some ( & x . dc_id ) , _ => None } } pub fn id ( & self ) -> & :: mtproto :: long { match self { & Document :: Empty ( ref x ) => & x . id , & Document :: Document ( ref x ) => & x . id , } } pub fn mime_type ( & self ) -> Option < & :: mtproto :: string > { match self { & Document :: Document ( ref x ) => Some ( & x . mime_type ) , _ => None } } pub fn size ( & self ) -> Option < & :: mtproto :: int > { match self { & Document :: Document ( ref x ) => Some ( & x . size ) , _ => None } } pub fn thumb ( & self ) -> Option < & :: mtproto :: PhotoSize > { match self { & Document :: Document ( ref x ) => Some ( & x . thumb ) , _ => None } } pub fn version ( & self ) -> Option < & :: mtproto :: int > { match self { & Document :: Document ( ref x ) => Some ( & x . version ) , _ => None } } } impl :: BoxedSerialize for Document { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Document :: Empty ( ref x ) => ( :: ConstructorNumber ( 0x36f8c871 ) , x ) , & Document :: Document ( ref x ) => ( :: ConstructorNumber ( 0x87232bc7 ) , x ) , } } } impl :: BoxedDeserialize for Document { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x36f8c871 ) , :: ConstructorNumber ( 0x87232bc7 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x36f8c871 ) => Ok ( Document :: Empty ( _de . read_bare :: < :: mtproto :: document :: Empty > ( ) ? ) ) , :: ConstructorNumber ( 0x87232bc7 ) => Ok ( Document :: Document ( _de . read_bare :: < :: mtproto :: document :: Document > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `DocumentAttribute`\n\n```text\ndocumentAttributeImageSize#6c37c15c w:int h:int = DocumentAttribute;\n\ndocumentAttributeAnimated#11b58939 = DocumentAttribute;\n\ndocumentAttributeSticker#6319d612 flags:# mask:flags.1?true alt:string stickerset:InputStickerSet mask_coords:flags.0?MaskCoords = DocumentAttribute;\n\ndocumentAttributeVideo#ef02ce6 flags:# round_message:flags.0?true duration:int w:int h:int = DocumentAttribute;\n\ndocumentAttributeAudio#9852f9c6 flags:# voice:flags.10?true duration:int title:flags.0?string performer:flags.1?string waveform:flags.2?bytes = DocumentAttribute;\n\ndocumentAttributeFilename#15590068 file_name:string = DocumentAttribute;\n\ndocumentAttributeHasStickers#9801d2f7 = DocumentAttribute;\n```\n" ] pub enum DocumentAttribute { ImageSize ( :: mtproto :: document_attribute :: ImageSize ) , Animated , Sticker ( :: mtproto :: document_attribute :: Sticker ) , Video ( :: mtproto :: document_attribute :: Video ) , Audio ( :: mtproto :: document_attribute :: Audio ) , Filename ( :: mtproto :: document_attribute :: Filename ) , HasStickers , } impl DocumentAttribute { pub fn alt ( & self ) -> Option < & :: mtproto :: string > { match self { & DocumentAttribute :: Sticker ( ref x ) => Some ( & x . alt ) , _ => None } } pub fn duration ( & self ) -> Option < & :: mtproto :: int > { match self { & DocumentAttribute :: Audio ( ref x ) => Some ( & x . duration ) , & DocumentAttribute :: Video ( ref x ) => Some ( & x . duration ) , _ => None } } pub fn file_name ( & self ) -> Option < & :: mtproto :: string > { match self { & DocumentAttribute :: Filename ( ref x ) => Some ( & x . file_name ) , _ => None } } pub fn h ( & self ) -> Option < & :: mtproto :: int > { match self { & DocumentAttribute :: ImageSize ( ref x ) => Some ( & x . h ) , & DocumentAttribute :: Video ( ref x ) => Some ( & x . h ) , _ => None } } pub fn mask ( & self ) -> Option < bool > { match self { & DocumentAttribute :: Sticker ( ref x ) => Some ( x . mask ) , _ => None } } pub fn mask_coords ( & self ) -> Option < & :: mtproto :: MaskCoords > { match self { & DocumentAttribute :: Sticker ( ref x ) => x . mask_coords . as_ref ( ) , _ => None } } pub fn performer ( & self ) -> Option < & :: mtproto :: string > { match self { & DocumentAttribute :: Audio ( ref x ) => x . performer . as_ref ( ) , _ => None } } pub fn round_message ( & self ) -> Option < bool > { match self { & DocumentAttribute :: Video ( ref x ) => Some ( x . round_message ) , _ => None } } pub fn stickerset ( & self ) -> Option < & :: mtproto :: InputStickerSet > { match self { & DocumentAttribute :: Sticker ( ref x ) => Some ( & x . stickerset ) , _ => None } } pub fn title ( & self ) -> Option < & :: mtproto :: string > { match self { & DocumentAttribute :: Audio ( ref x ) => x . title . as_ref ( ) , _ => None } } pub fn voice ( & self ) -> Option < bool > { match self { & DocumentAttribute :: Audio ( ref x ) => Some ( x . voice ) , _ => None } } pub fn w ( & self ) -> Option < & :: mtproto :: int > { match self { & DocumentAttribute :: Video ( ref x ) => Some ( & x . w ) , & DocumentAttribute :: ImageSize ( ref x ) => Some ( & x . w ) , _ => None } } pub fn waveform ( & self ) -> Option < & :: mtproto :: bytes > { match self { & DocumentAttribute :: Audio ( ref x ) => x . waveform . as_ref ( ) , _ => None } } } impl :: BoxedSerialize for DocumentAttribute { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & DocumentAttribute :: ImageSize ( ref x ) => ( :: ConstructorNumber ( 0x6c37c15c ) , x ) , & DocumentAttribute :: Animated => ( :: ConstructorNumber ( 0x11b58939 ) , & ( ) ) , & DocumentAttribute :: Sticker ( ref x ) => ( :: ConstructorNumber ( 0x6319d612 ) , x ) , & DocumentAttribute :: Video ( ref x ) => ( :: ConstructorNumber ( 0x0ef02ce6 ) , x ) , & DocumentAttribute :: Audio ( ref x ) => ( :: ConstructorNumber ( 0x9852f9c6 ) , x ) , & DocumentAttribute :: Filename ( ref x ) => ( :: ConstructorNumber ( 0x15590068 ) , x ) , & DocumentAttribute :: HasStickers => ( :: ConstructorNumber ( 0x9801d2f7 ) , & ( ) ) , } } } impl :: BoxedDeserialize for DocumentAttribute { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x6c37c15c ) , :: ConstructorNumber ( 0x11b58939 ) , :: ConstructorNumber ( 0x6319d612 ) , :: ConstructorNumber ( 0x0ef02ce6 ) , :: ConstructorNumber ( 0x9852f9c6 ) , :: ConstructorNumber ( 0x15590068 ) , :: ConstructorNumber ( 0x9801d2f7 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x6c37c15c ) => Ok ( DocumentAttribute :: ImageSize ( _de . read_bare :: < :: mtproto :: document_attribute :: ImageSize > ( ) ? ) ) , :: ConstructorNumber ( 0x11b58939 ) => Ok ( DocumentAttribute :: Animated ) , :: ConstructorNumber ( 0x6319d612 ) => Ok ( DocumentAttribute :: Sticker ( _de . read_bare :: < :: mtproto :: document_attribute :: Sticker > ( ) ? ) ) , :: ConstructorNumber ( 0x0ef02ce6 ) => Ok ( DocumentAttribute :: Video ( _de . read_bare :: < :: mtproto :: document_attribute :: Video > ( ) ? ) ) , :: ConstructorNumber ( 0x9852f9c6 ) => Ok ( DocumentAttribute :: Audio ( _de . read_bare :: < :: mtproto :: document_attribute :: Audio > ( ) ? ) ) , :: ConstructorNumber ( 0x15590068 ) => Ok ( DocumentAttribute :: Filename ( _de . read_bare :: < :: mtproto :: document_attribute :: Filename > ( ) ? ) ) , :: ConstructorNumber ( 0x9801d2f7 ) => Ok ( DocumentAttribute :: HasStickers ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `DraftMessage`\n\n```text\ndraftMessageEmpty#ba4baec5 = DraftMessage;\n\ndraftMessage#fd8e711f flags:# no_webpage:flags.1?true reply_to_msg_id:flags.0?int message:string entities:flags.3?Vector<MessageEntity> date:int = DraftMessage;\n```\n" ] pub enum DraftMessage { Empty , DraftMessage ( :: mtproto :: draft_message :: DraftMessage ) , } impl DraftMessage { pub fn date ( & self ) -> Option < & :: mtproto :: int > { match self { & DraftMessage :: DraftMessage ( ref x ) => Some ( & x . date ) , _ => None } } pub fn entities ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: MessageEntity > > { match self { & DraftMessage :: DraftMessage ( ref x ) => x . entities . as_ref ( ) , _ => None } } pub fn message ( & self ) -> Option < & :: mtproto :: string > { match self { & DraftMessage :: DraftMessage ( ref x ) => Some ( & x . message ) , _ => None } } pub fn no_webpage ( & self ) -> Option < bool > { match self { & DraftMessage :: DraftMessage ( ref x ) => Some ( x . no_webpage ) , _ => None } } pub fn reply_to_msg_id ( & self ) -> Option < & :: mtproto :: int > { match self { & DraftMessage :: DraftMessage ( ref x ) => x . reply_to_msg_id . as_ref ( ) , _ => None } } } impl :: BoxedSerialize for DraftMessage { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & DraftMessage :: Empty => ( :: ConstructorNumber ( 0xba4baec5 ) , & ( ) ) , & DraftMessage :: DraftMessage ( ref x ) => ( :: ConstructorNumber ( 0xfd8e711f ) , x ) , } } } impl :: BoxedDeserialize for DraftMessage { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xba4baec5 ) , :: ConstructorNumber ( 0xfd8e711f ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xba4baec5 ) => Ok ( DraftMessage :: Empty ) , :: ConstructorNumber ( 0xfd8e711f ) => Ok ( DraftMessage :: DraftMessage ( _de . read_bare :: < :: mtproto :: draft_message :: DraftMessage > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } impl :: BoxedSerialize for Option < :: mtproto :: draft_message :: DraftMessage > { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match * self { None => ( :: ConstructorNumber ( 0xba4baec5 ) , & ( ) ) , Some ( ref x ) => ( :: ConstructorNumber ( 0xfd8e711f ) , x ) , } } } impl :: BoxedDeserialize for Option < :: mtproto :: draft_message :: DraftMessage > { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xba4baec5 ) , :: ConstructorNumber ( 0xfd8e711f ) ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xba4baec5 ) => Ok ( None ) , :: ConstructorNumber ( 0xfd8e711f ) => Ok ( Some ( _de . read_bare :: < :: mtproto :: draft_message :: DraftMessage > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `EncryptedChat`\n\n```text\nencryptedChatEmpty#ab7ec0a0 id:int = EncryptedChat;\n\nencryptedChatWaiting#3bf703dc id:int access_hash:long date:int admin_id:int participant_id:int = EncryptedChat;\n\nencryptedChatRequested#c878527e id:int access_hash:long date:int admin_id:int participant_id:int g_a:bytes = EncryptedChat;\n\nencryptedChat#fa56ce36 id:int access_hash:long date:int admin_id:int participant_id:int g_a_or_b:bytes key_fingerprint:long = EncryptedChat;\n\nencryptedChatDiscarded#13d6dd27 id:int = EncryptedChat;\n```\n" ] pub enum EncryptedChat { Empty ( :: mtproto :: encrypted_chat :: Empty ) , Waiting ( :: mtproto :: encrypted_chat :: Waiting ) , Requested ( :: mtproto :: encrypted_chat :: Requested ) , EncryptedChat ( :: mtproto :: encrypted_chat :: EncryptedChat ) , Discarded ( :: mtproto :: encrypted_chat :: Discarded ) , } impl EncryptedChat { pub fn access_hash ( & self ) -> Option < & :: mtproto :: long > { match self { & EncryptedChat :: Waiting ( ref x ) => Some ( & x . access_hash ) , & EncryptedChat :: EncryptedChat ( ref x ) => Some ( & x . access_hash ) , & EncryptedChat :: Requested ( ref x ) => Some ( & x . access_hash ) , _ => None } } pub fn admin_id ( & self ) -> Option < & :: mtproto :: int > { match self { & EncryptedChat :: EncryptedChat ( ref x ) => Some ( & x . admin_id ) , & EncryptedChat :: Waiting ( ref x ) => Some ( & x . admin_id ) , & EncryptedChat :: Requested ( ref x ) => Some ( & x . admin_id ) , _ => None } } pub fn date ( & self ) -> Option < & :: mtproto :: int > { match self { & EncryptedChat :: Requested ( ref x ) => Some ( & x . date ) , & EncryptedChat :: Waiting ( ref x ) => Some ( & x . date ) , & EncryptedChat :: EncryptedChat ( ref x ) => Some ( & x . date ) , _ => None } } pub fn g_a ( & self ) -> Option < & :: mtproto :: bytes > { match self { & EncryptedChat :: Requested ( ref x ) => Some ( & x . g_a ) , _ => None } } pub fn g_a_or_b ( & self ) -> Option < & :: mtproto :: bytes > { match self { & EncryptedChat :: EncryptedChat ( ref x ) => Some ( & x . g_a_or_b ) , _ => None } } pub fn id ( & self ) -> & :: mtproto :: int { match self { & EncryptedChat :: Requested ( ref x ) => & x . id , & EncryptedChat :: EncryptedChat ( ref x ) => & x . id , & EncryptedChat :: Waiting ( ref x ) => & x . id , & EncryptedChat :: Empty ( ref x ) => & x . id , & EncryptedChat :: Discarded ( ref x ) => & x . id , } } pub fn key_fingerprint ( & self ) -> Option < & :: mtproto :: long > { match self { & EncryptedChat :: EncryptedChat ( ref x ) => Some ( & x . key_fingerprint ) , _ => None } } pub fn participant_id ( & self ) -> Option < & :: mtproto :: int > { match self { & EncryptedChat :: EncryptedChat ( ref x ) => Some ( & x . participant_id ) , & EncryptedChat :: Waiting ( ref x ) => Some ( & x . participant_id ) , & EncryptedChat :: Requested ( ref x ) => Some ( & x . participant_id ) , _ => None } } } impl :: BoxedSerialize for EncryptedChat { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & EncryptedChat :: Empty ( ref x ) => ( :: ConstructorNumber ( 0xab7ec0a0 ) , x ) , & EncryptedChat :: Waiting ( ref x ) => ( :: ConstructorNumber ( 0x3bf703dc ) , x ) , & EncryptedChat :: Requested ( ref x ) => ( :: ConstructorNumber ( 0xc878527e ) , x ) , & EncryptedChat :: EncryptedChat ( ref x ) => ( :: ConstructorNumber ( 0xfa56ce36 ) , x ) , & EncryptedChat :: Discarded ( ref x ) => ( :: ConstructorNumber ( 0x13d6dd27 ) , x ) , } } } impl :: BoxedDeserialize for EncryptedChat { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xab7ec0a0 ) , :: ConstructorNumber ( 0x3bf703dc ) , :: ConstructorNumber ( 0xc878527e ) , :: ConstructorNumber ( 0xfa56ce36 ) , :: ConstructorNumber ( 0x13d6dd27 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xab7ec0a0 ) => Ok ( EncryptedChat :: Empty ( _de . read_bare :: < :: mtproto :: encrypted_chat :: Empty > ( ) ? ) ) , :: ConstructorNumber ( 0x3bf703dc ) => Ok ( EncryptedChat :: Waiting ( _de . read_bare :: < :: mtproto :: encrypted_chat :: Waiting > ( ) ? ) ) , :: ConstructorNumber ( 0xc878527e ) => Ok ( EncryptedChat :: Requested ( _de . read_bare :: < :: mtproto :: encrypted_chat :: Requested > ( ) ? ) ) , :: ConstructorNumber ( 0xfa56ce36 ) => Ok ( EncryptedChat :: EncryptedChat ( _de . read_bare :: < :: mtproto :: encrypted_chat :: EncryptedChat > ( ) ? ) ) , :: ConstructorNumber ( 0x13d6dd27 ) => Ok ( EncryptedChat :: Discarded ( _de . read_bare :: < :: mtproto :: encrypted_chat :: Discarded > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `EncryptedFile`\n\n```text\nencryptedFileEmpty#c21f497e = EncryptedFile;\n\nencryptedFile#4a70994c id:long access_hash:long size:int dc_id:int key_fingerprint:int = EncryptedFile;\n```\n" ] pub enum EncryptedFile { Empty , EncryptedFile ( :: mtproto :: encrypted_file :: EncryptedFile ) , } impl EncryptedFile { pub fn access_hash ( & self ) -> Option < & :: mtproto :: long > { match self { & EncryptedFile :: EncryptedFile ( ref x ) => Some ( & x . access_hash ) , _ => None } } pub fn dc_id ( & self ) -> Option < & :: mtproto :: int > { match self { & EncryptedFile :: EncryptedFile ( ref x ) => Some ( & x . dc_id ) , _ => None } } pub fn id ( & self ) -> Option < & :: mtproto :: long > { match self { & EncryptedFile :: EncryptedFile ( ref x ) => Some ( & x . id ) , _ => None } } pub fn key_fingerprint ( & self ) -> Option < & :: mtproto :: int > { match self { & EncryptedFile :: EncryptedFile ( ref x ) => Some ( & x . key_fingerprint ) , _ => None } } pub fn size ( & self ) -> Option < & :: mtproto :: int > { match self { & EncryptedFile :: EncryptedFile ( ref x ) => Some ( & x . size ) , _ => None } } } impl :: BoxedSerialize for EncryptedFile { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & EncryptedFile :: Empty => ( :: ConstructorNumber ( 0xc21f497e ) , & ( ) ) , & EncryptedFile :: EncryptedFile ( ref x ) => ( :: ConstructorNumber ( 0x4a70994c ) , x ) , } } } impl :: BoxedDeserialize for EncryptedFile { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xc21f497e ) , :: ConstructorNumber ( 0x4a70994c ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xc21f497e ) => Ok ( EncryptedFile :: Empty ) , :: ConstructorNumber ( 0x4a70994c ) => Ok ( EncryptedFile :: EncryptedFile ( _de . read_bare :: < :: mtproto :: encrypted_file :: EncryptedFile > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } impl :: BoxedSerialize for Option < :: mtproto :: encrypted_file :: EncryptedFile > { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match * self { None => ( :: ConstructorNumber ( 0xc21f497e ) , & ( ) ) , Some ( ref x ) => ( :: ConstructorNumber ( 0x4a70994c ) , x ) , } } } impl :: BoxedDeserialize for Option < :: mtproto :: encrypted_file :: EncryptedFile > { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xc21f497e ) , :: ConstructorNumber ( 0x4a70994c ) ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xc21f497e ) => Ok ( None ) , :: ConstructorNumber ( 0x4a70994c ) => Ok ( Some ( _de . read_bare :: < :: mtproto :: encrypted_file :: EncryptedFile > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `EncryptedMessage`\n\n```text\nencryptedMessage#ed18c118 random_id:long chat_id:int date:int bytes:bytes file:EncryptedFile = EncryptedMessage;\n\nencryptedMessageService#23734b06 random_id:long chat_id:int date:int bytes:bytes = EncryptedMessage;\n```\n" ] pub enum EncryptedMessage { EncryptedMessage ( :: mtproto :: encrypted_message :: EncryptedMessage ) , Service ( :: mtproto :: encrypted_message :: Service ) , } impl EncryptedMessage { pub fn bytes ( & self ) -> & :: mtproto :: bytes { match self { & EncryptedMessage :: EncryptedMessage ( ref x ) => & x . bytes , & EncryptedMessage :: Service ( ref x ) => & x . bytes , } } pub fn chat_id ( & self ) -> & :: mtproto :: int { match self { & EncryptedMessage :: EncryptedMessage ( ref x ) => & x . chat_id , & EncryptedMessage :: Service ( ref x ) => & x . chat_id , } } pub fn date ( & self ) -> & :: mtproto :: int { match self { & EncryptedMessage :: EncryptedMessage ( ref x ) => & x . date , & EncryptedMessage :: Service ( ref x ) => & x . date , } } pub fn file ( & self ) -> Option < & :: mtproto :: EncryptedFile > { match self { & EncryptedMessage :: EncryptedMessage ( ref x ) => Some ( & x . file ) , _ => None } } pub fn random_id ( & self ) -> & :: mtproto :: long { match self { & EncryptedMessage :: EncryptedMessage ( ref x ) => & x . random_id , & EncryptedMessage :: Service ( ref x ) => & x . random_id , } } } impl :: BoxedSerialize for EncryptedMessage { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & EncryptedMessage :: EncryptedMessage ( ref x ) => ( :: ConstructorNumber ( 0xed18c118 ) , x ) , & EncryptedMessage :: Service ( ref x ) => ( :: ConstructorNumber ( 0x23734b06 ) , x ) , } } } impl :: BoxedDeserialize for EncryptedMessage { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xed18c118 ) , :: ConstructorNumber ( 0x23734b06 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xed18c118 ) => Ok ( EncryptedMessage :: EncryptedMessage ( _de . read_bare :: < :: mtproto :: encrypted_message :: EncryptedMessage > ( ) ? ) ) , :: ConstructorNumber ( 0x23734b06 ) => Ok ( EncryptedMessage :: Service ( _de . read_bare :: < :: mtproto :: encrypted_message :: Service > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `Error`\n\n```text\nerror#c4b9f9bb code:int text:string = Error;\n```\n" ] pub enum Error { Error ( :: mtproto :: error :: Error ) , } impl Error { pub fn code ( & self ) -> & :: mtproto :: int { match self { & Error :: Error ( ref x ) => & x . code , } } pub fn text ( & self ) -> & :: mtproto :: string { match self { & Error :: Error ( ref x ) => & x . text , } } } impl :: BoxedSerialize for Error { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Error :: Error ( ref x ) => ( :: ConstructorNumber ( 0xc4b9f9bb ) , x ) , } } } impl :: BoxedDeserialize for Error { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xc4b9f9bb ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xc4b9f9bb ) => Ok ( Error :: Error ( _de . read_bare :: < :: mtproto :: error :: Error > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `ExportedChatInvite`\n\n```text\nchatInviteEmpty#69df3769 = ExportedChatInvite;\n\nchatInviteExported#fc2e05bc link:string = ExportedChatInvite;\n```\n" ] pub enum ExportedChatInvite { Empty , Exported ( :: mtproto :: chat_invite :: Exported ) , } impl ExportedChatInvite { pub fn link ( & self ) -> Option < & :: mtproto :: string > { match self { & ExportedChatInvite :: Exported ( ref x ) => Some ( & x . link ) , _ => None } } } impl :: BoxedSerialize for ExportedChatInvite { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ExportedChatInvite :: Empty => ( :: ConstructorNumber ( 0x69df3769 ) , & ( ) ) , & ExportedChatInvite :: Exported ( ref x ) => ( :: ConstructorNumber ( 0xfc2e05bc ) , x ) , } } } impl :: BoxedDeserialize for ExportedChatInvite { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x69df3769 ) , :: ConstructorNumber ( 0xfc2e05bc ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x69df3769 ) => Ok ( ExportedChatInvite :: Empty ) , :: ConstructorNumber ( 0xfc2e05bc ) => Ok ( ExportedChatInvite :: Exported ( _de . read_bare :: < :: mtproto :: chat_invite :: Exported > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } impl :: BoxedSerialize for Option < :: mtproto :: chat_invite :: Exported > { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match * self { None => ( :: ConstructorNumber ( 0x69df3769 ) , & ( ) ) , Some ( ref x ) => ( :: ConstructorNumber ( 0xfc2e05bc ) , x ) , } } } impl :: BoxedDeserialize for Option < :: mtproto :: chat_invite :: Exported > { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x69df3769 ) , :: ConstructorNumber ( 0xfc2e05bc ) ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x69df3769 ) => Ok ( None ) , :: ConstructorNumber ( 0xfc2e05bc ) => Ok ( Some ( _de . read_bare :: < :: mtproto :: chat_invite :: Exported > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `ExportedMessageLink`\n\n```text\nexportedMessageLink#1f486803 link:string = ExportedMessageLink;\n```\n" ] pub enum ExportedMessageLink { ExportedMessageLink ( :: mtproto :: exported_message_link :: ExportedMessageLink ) , } impl ExportedMessageLink { pub fn link ( & self ) -> & :: mtproto :: string { match self { & ExportedMessageLink :: ExportedMessageLink ( ref x ) => & x . link , } } } impl :: BoxedSerialize for ExportedMessageLink { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ExportedMessageLink :: ExportedMessageLink ( ref x ) => ( :: ConstructorNumber ( 0x1f486803 ) , x ) , } } } impl :: BoxedDeserialize for ExportedMessageLink { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x1f486803 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x1f486803 ) => Ok ( ExportedMessageLink :: ExportedMessageLink ( _de . read_bare :: < :: mtproto :: exported_message_link :: ExportedMessageLink > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `FileLocation`\n\n```text\nfileLocationUnavailable#7c596b46 volume_id:long local_id:int secret:long = FileLocation;\n\nfileLocation#53d69076 dc_id:int volume_id:long local_id:int secret:long = FileLocation;\n```\n" ] pub enum FileLocation { Unavailable ( :: mtproto :: file_location :: Unavailable ) , FileLocation ( :: mtproto :: file_location :: FileLocation ) , } impl FileLocation { pub fn dc_id ( & self ) -> Option < & :: mtproto :: int > { match self { & FileLocation :: FileLocation ( ref x ) => Some ( & x . dc_id ) , _ => None } } pub fn local_id ( & self ) -> & :: mtproto :: int { match self { & FileLocation :: Unavailable ( ref x ) => & x . local_id , & FileLocation :: FileLocation ( ref x ) => & x . local_id , } } pub fn secret ( & self ) -> & :: mtproto :: long { match self { & FileLocation :: FileLocation ( ref x ) => & x . secret , & FileLocation :: Unavailable ( ref x ) => & x . secret , } } pub fn volume_id ( & self ) -> & :: mtproto :: long { match self { & FileLocation :: Unavailable ( ref x ) => & x . volume_id , & FileLocation :: FileLocation ( ref x ) => & x . volume_id , } } } impl :: BoxedSerialize for FileLocation { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & FileLocation :: Unavailable ( ref x ) => ( :: ConstructorNumber ( 0x7c596b46 ) , x ) , & FileLocation :: FileLocation ( ref x ) => ( :: ConstructorNumber ( 0x53d69076 ) , x ) , } } } impl :: BoxedDeserialize for FileLocation { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x7c596b46 ) , :: ConstructorNumber ( 0x53d69076 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x7c596b46 ) => Ok ( FileLocation :: Unavailable ( _de . read_bare :: < :: mtproto :: file_location :: Unavailable > ( ) ? ) ) , :: ConstructorNumber ( 0x53d69076 ) => Ok ( FileLocation :: FileLocation ( _de . read_bare :: < :: mtproto :: file_location :: FileLocation > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `FoundGif`\n\n```text\nfoundGif#162ecc1f url:string thumb_url:string content_url:string content_type:string w:int h:int = FoundGif;\n\nfoundGifCached#9c750409 url:string photo:Photo document:Document = FoundGif;\n```\n" ] pub enum FoundGif { FoundGif ( :: mtproto :: found_gif :: FoundGif ) , Cached ( :: mtproto :: found_gif :: Cached ) , } impl FoundGif { pub fn content_type ( & self ) -> Option < & :: mtproto :: string > { match self { & FoundGif :: FoundGif ( ref x ) => Some ( & x . content_type ) , _ => None } } pub fn content_url ( & self ) -> Option < & :: mtproto :: string > { match self { & FoundGif :: FoundGif ( ref x ) => Some ( & x . content_url ) , _ => None } } pub fn document ( & self ) -> Option < & :: mtproto :: Document > { match self { & FoundGif :: Cached ( ref x ) => Some ( & x . document ) , _ => None } } pub fn h ( & self ) -> Option < & :: mtproto :: int > { match self { & FoundGif :: FoundGif ( ref x ) => Some ( & x . h ) , _ => None } } pub fn photo ( & self ) -> Option < & :: mtproto :: Photo > { match self { & FoundGif :: Cached ( ref x ) => Some ( & x . photo ) , _ => None } } pub fn thumb_url ( & self ) -> Option < & :: mtproto :: string > { match self { & FoundGif :: FoundGif ( ref x ) => Some ( & x . thumb_url ) , _ => None } } pub fn url ( & self ) -> & :: mtproto :: string { match self { & FoundGif :: FoundGif ( ref x ) => & x . url , & FoundGif :: Cached ( ref x ) => & x . url , } } pub fn w ( & self ) -> Option < & :: mtproto :: int > { match self { & FoundGif :: FoundGif ( ref x ) => Some ( & x . w ) , _ => None } } } impl :: BoxedSerialize for FoundGif { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & FoundGif :: FoundGif ( ref x ) => ( :: ConstructorNumber ( 0x162ecc1f ) , x ) , & FoundGif :: Cached ( ref x ) => ( :: ConstructorNumber ( 0x9c750409 ) , x ) , } } } impl :: BoxedDeserialize for FoundGif { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x162ecc1f ) , :: ConstructorNumber ( 0x9c750409 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x162ecc1f ) => Ok ( FoundGif :: FoundGif ( _de . read_bare :: < :: mtproto :: found_gif :: FoundGif > ( ) ? ) ) , :: ConstructorNumber ( 0x9c750409 ) => Ok ( FoundGif :: Cached ( _de . read_bare :: < :: mtproto :: found_gif :: Cached > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `FutureSalt`\n\n```text\nfuture_salt#0949d9dc valid_since:int valid_until:int salt:long = FutureSalt;\n```\n" ] pub enum FutureSalt { FutureSalt ( :: mtproto :: future_salt :: FutureSalt ) , } impl FutureSalt { pub fn salt ( & self ) -> & :: mtproto :: long { match self { & FutureSalt :: FutureSalt ( ref x ) => & x . salt , } } pub fn valid_since ( & self ) -> & :: mtproto :: int { match self { & FutureSalt :: FutureSalt ( ref x ) => & x . valid_since , } } pub fn valid_until ( & self ) -> & :: mtproto :: int { match self { & FutureSalt :: FutureSalt ( ref x ) => & x . valid_until , } } } impl :: BoxedSerialize for FutureSalt { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & FutureSalt :: FutureSalt ( ref x ) => ( :: ConstructorNumber ( 0x0949d9dc ) , x ) , } } } impl :: BoxedDeserialize for FutureSalt { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x0949d9dc ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x0949d9dc ) => Ok ( FutureSalt :: FutureSalt ( _de . read_bare :: < :: mtproto :: future_salt :: FutureSalt > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `FutureSalts`\n\n```text\nfuture_salts#ae500895 req_msg_id:long now:int salts:vector<future_salt> = FutureSalts;\n```\n" ] pub enum FutureSalts { FutureSalts ( :: mtproto :: future_salts :: FutureSalts ) , } impl FutureSalts { pub fn now ( & self ) -> & :: mtproto :: int { match self { & FutureSalts :: FutureSalts ( ref x ) => & x . now , } } pub fn req_msg_id ( & self ) -> & :: mtproto :: long { match self { & FutureSalts :: FutureSalts ( ref x ) => & x . req_msg_id , } } pub fn salts ( & self ) -> & :: mtproto :: vector < :: mtproto :: Bare , :: mtproto :: future_salt :: FutureSalt > { match self { & FutureSalts :: FutureSalts ( ref x ) => & x . salts , } } } impl :: BoxedSerialize for FutureSalts { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & FutureSalts :: FutureSalts ( ref x ) => ( :: ConstructorNumber ( 0xae500895 ) , x ) , } } } impl :: BoxedDeserialize for FutureSalts { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xae500895 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xae500895 ) => Ok ( FutureSalts :: FutureSalts ( _de . read_bare :: < :: mtproto :: future_salts :: FutureSalts > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `Game`\n\n```text\ngame#bdf9653b flags:# id:long access_hash:long short_name:string title:string description:string photo:Photo document:flags.0?Document = Game;\n```\n" ] pub enum Game { Game ( :: mtproto :: game :: Game ) , } impl Game { pub fn access_hash ( & self ) -> & :: mtproto :: long { match self { & Game :: Game ( ref x ) => & x . access_hash , } } pub fn description ( & self ) -> & :: mtproto :: string { match self { & Game :: Game ( ref x ) => & x . description , } } pub fn document ( & self ) -> Option < & :: mtproto :: Document > { match self { & Game :: Game ( ref x ) => x . document . as_ref ( ) , } } pub fn id ( & self ) -> & :: mtproto :: long { match self { & Game :: Game ( ref x ) => & x . id , } } pub fn photo ( & self ) -> & :: mtproto :: Photo { match self { & Game :: Game ( ref x ) => & x . photo , } } pub fn short_name ( & self ) -> & :: mtproto :: string { match self { & Game :: Game ( ref x ) => & x . short_name , } } pub fn title ( & self ) -> & :: mtproto :: string { match self { & Game :: Game ( ref x ) => & x . title , } } } impl :: BoxedSerialize for Game { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Game :: Game ( ref x ) => ( :: ConstructorNumber ( 0xbdf9653b ) , x ) , } } } impl :: BoxedDeserialize for Game { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xbdf9653b ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xbdf9653b ) => Ok ( Game :: Game ( _de . read_bare :: < :: mtproto :: game :: Game > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `GeoPoint`\n\n```text\ngeoPointEmpty#1117dd5f = GeoPoint;\n\ngeoPoint#2049d70c long:double lat:double = GeoPoint;\n```\n" ] pub enum GeoPoint { Empty , GeoPoint ( :: mtproto :: geo_point :: GeoPoint ) , } impl GeoPoint { pub fn lat ( & self ) -> Option < & :: mtproto :: double > { match self { & GeoPoint :: GeoPoint ( ref x ) => Some ( & x . lat ) , _ => None } } pub fn long ( & self ) -> Option < & :: mtproto :: double > { match self { & GeoPoint :: GeoPoint ( ref x ) => Some ( & x . long ) , _ => None } } } impl :: BoxedSerialize for GeoPoint { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & GeoPoint :: Empty => ( :: ConstructorNumber ( 0x1117dd5f ) , & ( ) ) , & GeoPoint :: GeoPoint ( ref x ) => ( :: ConstructorNumber ( 0x2049d70c ) , x ) , } } } impl :: BoxedDeserialize for GeoPoint { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x1117dd5f ) , :: ConstructorNumber ( 0x2049d70c ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x1117dd5f ) => Ok ( GeoPoint :: Empty ) , :: ConstructorNumber ( 0x2049d70c ) => Ok ( GeoPoint :: GeoPoint ( _de . read_bare :: < :: mtproto :: geo_point :: GeoPoint > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } impl :: BoxedSerialize for Option < :: mtproto :: geo_point :: GeoPoint > { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match * self { None => ( :: ConstructorNumber ( 0x1117dd5f ) , & ( ) ) , Some ( ref x ) => ( :: ConstructorNumber ( 0x2049d70c ) , x ) , } } } impl :: BoxedDeserialize for Option < :: mtproto :: geo_point :: GeoPoint > { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x1117dd5f ) , :: ConstructorNumber ( 0x2049d70c ) ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x1117dd5f ) => Ok ( None ) , :: ConstructorNumber ( 0x2049d70c ) => Ok ( Some ( _de . read_bare :: < :: mtproto :: geo_point :: GeoPoint > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `HighScore`\n\n```text\nhighScore#58fffcd0 pos:int user_id:int score:int = HighScore;\n```\n" ] pub enum HighScore { HighScore ( :: mtproto :: high_score :: HighScore ) , } impl HighScore { pub fn pos ( & self ) -> & :: mtproto :: int { match self { & HighScore :: HighScore ( ref x ) => & x . pos , } } pub fn score ( & self ) -> & :: mtproto :: int { match self { & HighScore :: HighScore ( ref x ) => & x . score , } } pub fn user_id ( & self ) -> & :: mtproto :: int { match self { & HighScore :: HighScore ( ref x ) => & x . user_id , } } } impl :: BoxedSerialize for HighScore { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & HighScore :: HighScore ( ref x ) => ( :: ConstructorNumber ( 0x58fffcd0 ) , x ) , } } } impl :: BoxedDeserialize for HighScore { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x58fffcd0 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x58fffcd0 ) => Ok ( HighScore :: HighScore ( _de . read_bare :: < :: mtproto :: high_score :: HighScore > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `HttpWait`\n\n```text\nhttp_wait#9299359f max_delay:int wait_after:int max_wait:int = HttpWait;\n```\n" ] pub enum HttpWait { HttpWait ( :: mtproto :: http_wait :: HttpWait ) , } impl HttpWait { pub fn max_delay ( & self ) -> & :: mtproto :: int { match self { & HttpWait :: HttpWait ( ref x ) => & x . max_delay , } } pub fn max_wait ( & self ) -> & :: mtproto :: int { match self { & HttpWait :: HttpWait ( ref x ) => & x . max_wait , } } pub fn wait_after ( & self ) -> & :: mtproto :: int { match self { & HttpWait :: HttpWait ( ref x ) => & x . wait_after , } } } impl :: BoxedSerialize for HttpWait { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & HttpWait :: HttpWait ( ref x ) => ( :: ConstructorNumber ( 0x9299359f ) , x ) , } } } impl :: BoxedDeserialize for HttpWait { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x9299359f ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x9299359f ) => Ok ( HttpWait :: HttpWait ( _de . read_bare :: < :: mtproto :: http_wait :: HttpWait > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `ImportedContact`\n\n```text\nimportedContact#d0028438 user_id:int client_id:long = ImportedContact;\n```\n" ] pub enum ImportedContact { ImportedContact ( :: mtproto :: imported_contact :: ImportedContact ) , } impl ImportedContact { pub fn client_id ( & self ) -> & :: mtproto :: long { match self { & ImportedContact :: ImportedContact ( ref x ) => & x . client_id , } } pub fn user_id ( & self ) -> & :: mtproto :: int { match self { & ImportedContact :: ImportedContact ( ref x ) => & x . user_id , } } } impl :: BoxedSerialize for ImportedContact { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ImportedContact :: ImportedContact ( ref x ) => ( :: ConstructorNumber ( 0xd0028438 ) , x ) , } } } impl :: BoxedDeserialize for ImportedContact { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xd0028438 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xd0028438 ) => Ok ( ImportedContact :: ImportedContact ( _de . read_bare :: < :: mtproto :: imported_contact :: ImportedContact > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `InlineBotSwitchPM`\n\n```text\ninlineBotSwitchPM#3c20629f text:string start_param:string = InlineBotSwitchPM;\n```\n" ] pub enum InlineBotSwitchPM { InlineBotSwitchPM ( :: mtproto :: inline_bot_switch_pm :: InlineBotSwitchPM ) , } impl InlineBotSwitchPM { pub fn start_param ( & self ) -> & :: mtproto :: string { match self { & InlineBotSwitchPM :: InlineBotSwitchPM ( ref x ) => & x . start_param , } } pub fn text ( & self ) -> & :: mtproto :: string { match self { & InlineBotSwitchPM :: InlineBotSwitchPM ( ref x ) => & x . text , } } } impl :: BoxedSerialize for InlineBotSwitchPM { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InlineBotSwitchPM :: InlineBotSwitchPM ( ref x ) => ( :: ConstructorNumber ( 0x3c20629f ) , x ) , } } } impl :: BoxedDeserialize for InlineBotSwitchPM { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x3c20629f ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x3c20629f ) => Ok ( InlineBotSwitchPM :: InlineBotSwitchPM ( _de . read_bare :: < :: mtproto :: inline_bot_switch_pm :: InlineBotSwitchPM > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `InputAppEvent`\n\n```text\ninputAppEvent#770656a8 time:double type:string peer:long data:string = InputAppEvent;\n```\n" ] pub enum InputAppEvent { InputAppEvent ( :: mtproto :: input_app_event :: InputAppEvent ) , } impl InputAppEvent { pub fn data ( & self ) -> & :: mtproto :: string { match self { & InputAppEvent :: InputAppEvent ( ref x ) => & x . data , } } pub fn peer ( & self ) -> & :: mtproto :: long { match self { & InputAppEvent :: InputAppEvent ( ref x ) => & x . peer , } } pub fn time ( & self ) -> & :: mtproto :: double { match self { & InputAppEvent :: InputAppEvent ( ref x ) => & x . time , } } pub fn type_ ( & self ) -> & :: mtproto :: string { match self { & InputAppEvent :: InputAppEvent ( ref x ) => & x . type_ , } } } impl :: BoxedSerialize for InputAppEvent { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputAppEvent :: InputAppEvent ( ref x ) => ( :: ConstructorNumber ( 0x770656a8 ) , x ) , } } } impl :: BoxedDeserialize for InputAppEvent { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x770656a8 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x770656a8 ) => Ok ( InputAppEvent :: InputAppEvent ( _de . read_bare :: < :: mtproto :: input_app_event :: InputAppEvent > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `InputBotInlineMessage`\n\n```text\ninputBotInlineMessageMediaAuto#292fed13 flags:# caption:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\n\ninputBotInlineMessageText#3dcd7a87 flags:# no_webpage:flags.0?true message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\n\ninputBotInlineMessageMediaGeo#c1b15d65 flags:# geo_point:InputGeoPoint period:int reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\n\ninputBotInlineMessageMediaVenue#aaafadc8 flags:# geo_point:InputGeoPoint title:string address:string provider:string venue_id:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\n\ninputBotInlineMessageMediaContact#2daf01a7 flags:# phone_number:string first_name:string last_name:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\n\ninputBotInlineMessageGame#4b425864 flags:# reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\n```\n" ] pub enum InputBotInlineMessage { MediaAuto ( :: mtproto :: input_bot_inline_message :: MediaAuto ) , Text ( :: mtproto :: input_bot_inline_message :: Text ) , MediaGeo ( :: mtproto :: input_bot_inline_message :: MediaGeo ) , MediaVenue ( :: mtproto :: input_bot_inline_message :: MediaVenue ) , MediaContact ( :: mtproto :: input_bot_inline_message :: MediaContact ) , Game ( :: mtproto :: input_bot_inline_message :: Game ) , } impl InputBotInlineMessage { pub fn address ( & self ) -> Option < & :: mtproto :: string > { match self { & InputBotInlineMessage :: MediaVenue ( ref x ) => Some ( & x . address ) , _ => None } } pub fn caption ( & self ) -> Option < & :: mtproto :: string > { match self { & InputBotInlineMessage :: MediaAuto ( ref x ) => Some ( & x . caption ) , _ => None } } pub fn entities ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: MessageEntity > > { match self { & InputBotInlineMessage :: Text ( ref x ) => x . entities . as_ref ( ) , _ => None } } pub fn first_name ( & self ) -> Option < & :: mtproto :: string > { match self { & InputBotInlineMessage :: MediaContact ( ref x ) => Some ( & x . first_name ) , _ => None } } pub fn geo_point ( & self ) -> Option < & :: mtproto :: InputGeoPoint > { match self { & InputBotInlineMessage :: MediaGeo ( ref x ) => Some ( & x . geo_point ) , & InputBotInlineMessage :: MediaVenue ( ref x ) => Some ( & x . geo_point ) , _ => None } } pub fn last_name ( & self ) -> Option < & :: mtproto :: string > { match self { & InputBotInlineMessage :: MediaContact ( ref x ) => Some ( & x . last_name ) , _ => None } } pub fn message ( & self ) -> Option < & :: mtproto :: string > { match self { & InputBotInlineMessage :: Text ( ref x ) => Some ( & x . message ) , _ => None } } pub fn no_webpage ( & self ) -> Option < bool > { match self { & InputBotInlineMessage :: Text ( ref x ) => Some ( x . no_webpage ) , _ => None } } pub fn period ( & self ) -> Option < & :: mtproto :: int > { match self { & InputBotInlineMessage :: MediaGeo ( ref x ) => Some ( & x . period ) , _ => None } } pub fn phone_number ( & self ) -> Option < & :: mtproto :: string > { match self { & InputBotInlineMessage :: MediaContact ( ref x ) => Some ( & x . phone_number ) , _ => None } } pub fn provider ( & self ) -> Option < & :: mtproto :: string > { match self { & InputBotInlineMessage :: MediaVenue ( ref x ) => Some ( & x . provider ) , _ => None } } pub fn reply_markup ( & self ) -> Option < & :: mtproto :: ReplyMarkup > { match self { & InputBotInlineMessage :: Game ( ref x ) => x . reply_markup . as_ref ( ) , & InputBotInlineMessage :: MediaGeo ( ref x ) => x . reply_markup . as_ref ( ) , & InputBotInlineMessage :: MediaVenue ( ref x ) => x . reply_markup . as_ref ( ) , & InputBotInlineMessage :: MediaAuto ( ref x ) => x . reply_markup . as_ref ( ) , & InputBotInlineMessage :: MediaContact ( ref x ) => x . reply_markup . as_ref ( ) , & InputBotInlineMessage :: Text ( ref x ) => x . reply_markup . as_ref ( ) , } } pub fn title ( & self ) -> Option < & :: mtproto :: string > { match self { & InputBotInlineMessage :: MediaVenue ( ref x ) => Some ( & x . title ) , _ => None } } pub fn venue_id ( & self ) -> Option < & :: mtproto :: string > { match self { & InputBotInlineMessage :: MediaVenue ( ref x ) => Some ( & x . venue_id ) , _ => None } } } impl :: BoxedSerialize for InputBotInlineMessage { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputBotInlineMessage :: MediaAuto ( ref x ) => ( :: ConstructorNumber ( 0x292fed13 ) , x ) , & InputBotInlineMessage :: Text ( ref x ) => ( :: ConstructorNumber ( 0x3dcd7a87 ) , x ) , & InputBotInlineMessage :: MediaGeo ( ref x ) => ( :: ConstructorNumber ( 0xc1b15d65 ) , x ) , & InputBotInlineMessage :: MediaVenue ( ref x ) => ( :: ConstructorNumber ( 0xaaafadc8 ) , x ) , & InputBotInlineMessage :: MediaContact ( ref x ) => ( :: ConstructorNumber ( 0x2daf01a7 ) , x ) , & InputBotInlineMessage :: Game ( ref x ) => ( :: ConstructorNumber ( 0x4b425864 ) , x ) , } } } impl :: BoxedDeserialize for InputBotInlineMessage { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x292fed13 ) , :: ConstructorNumber ( 0x3dcd7a87 ) , :: ConstructorNumber ( 0xc1b15d65 ) , :: ConstructorNumber ( 0xaaafadc8 ) , :: ConstructorNumber ( 0x2daf01a7 ) , :: ConstructorNumber ( 0x4b425864 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x292fed13 ) => Ok ( InputBotInlineMessage :: MediaAuto ( _de . read_bare :: < :: mtproto :: input_bot_inline_message :: MediaAuto > ( ) ? ) ) , :: ConstructorNumber ( 0x3dcd7a87 ) => Ok ( InputBotInlineMessage :: Text ( _de . read_bare :: < :: mtproto :: input_bot_inline_message :: Text > ( ) ? ) ) , :: ConstructorNumber ( 0xc1b15d65 ) => Ok ( InputBotInlineMessage :: MediaGeo ( _de . read_bare :: < :: mtproto :: input_bot_inline_message :: MediaGeo > ( ) ? ) ) , :: ConstructorNumber ( 0xaaafadc8 ) => Ok ( InputBotInlineMessage :: MediaVenue ( _de . read_bare :: < :: mtproto :: input_bot_inline_message :: MediaVenue > ( ) ? ) ) , :: ConstructorNumber ( 0x2daf01a7 ) => Ok ( InputBotInlineMessage :: MediaContact ( _de . read_bare :: < :: mtproto :: input_bot_inline_message :: MediaContact > ( ) ? ) ) , :: ConstructorNumber ( 0x4b425864 ) => Ok ( InputBotInlineMessage :: Game ( _de . read_bare :: < :: mtproto :: input_bot_inline_message :: Game > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `InputBotInlineMessageID`\n\n```text\ninputBotInlineMessageID#890c3d89 dc_id:int id:long access_hash:long = InputBotInlineMessageID;\n```\n" ] pub enum InputBotInlineMessageID { InputBotInlineMessageID ( :: mtproto :: input_bot_inline_message_id :: InputBotInlineMessageID ) , } impl InputBotInlineMessageID { pub fn access_hash ( & self ) -> & :: mtproto :: long { match self { & InputBotInlineMessageID :: InputBotInlineMessageID ( ref x ) => & x . access_hash , } } pub fn dc_id ( & self ) -> & :: mtproto :: int { match self { & InputBotInlineMessageID :: InputBotInlineMessageID ( ref x ) => & x . dc_id , } } pub fn id ( & self ) -> & :: mtproto :: long { match self { & InputBotInlineMessageID :: InputBotInlineMessageID ( ref x ) => & x . id , } } } impl :: BoxedSerialize for InputBotInlineMessageID { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputBotInlineMessageID :: InputBotInlineMessageID ( ref x ) => ( :: ConstructorNumber ( 0x890c3d89 ) , x ) , } } } impl :: BoxedDeserialize for InputBotInlineMessageID { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x890c3d89 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x890c3d89 ) => Ok ( InputBotInlineMessageID :: InputBotInlineMessageID ( _de . read_bare :: < :: mtproto :: input_bot_inline_message_id :: InputBotInlineMessageID > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `InputBotInlineResult`\n\n```text\ninputBotInlineResult#2cbbe15a flags:# id:string type:string title:flags.1?string description:flags.2?string url:flags.3?string thumb_url:flags.4?string content_url:flags.5?string content_type:flags.5?string w:flags.6?int h:flags.6?int duration:flags.7?int send_message:InputBotInlineMessage = InputBotInlineResult;\n\ninputBotInlineResultPhoto#a8d864a7 id:string type:string photo:InputPhoto send_message:InputBotInlineMessage = InputBotInlineResult;\n\ninputBotInlineResultDocument#fff8fdc4 flags:# id:string type:string title:flags.1?string description:flags.2?string document:InputDocument send_message:InputBotInlineMessage = InputBotInlineResult;\n\ninputBotInlineResultGame#4fa417f2 id:string short_name:string send_message:InputBotInlineMessage = InputBotInlineResult;\n```\n" ] pub enum InputBotInlineResult { InputBotInlineResult ( :: mtproto :: input_bot_inline_result :: InputBotInlineResult ) , Photo ( :: mtproto :: input_bot_inline_result :: Photo ) , Document ( :: mtproto :: input_bot_inline_result :: Document ) , Game ( :: mtproto :: input_bot_inline_result :: Game ) , } impl InputBotInlineResult { pub fn content_type ( & self ) -> Option < & :: mtproto :: string > { match self { & InputBotInlineResult :: InputBotInlineResult ( ref x ) => x . content_type . as_ref ( ) , _ => None } } pub fn content_url ( & self ) -> Option < & :: mtproto :: string > { match self { & InputBotInlineResult :: InputBotInlineResult ( ref x ) => x . content_url . as_ref ( ) , _ => None } } pub fn description ( & self ) -> Option < & :: mtproto :: string > { match self { & InputBotInlineResult :: InputBotInlineResult ( ref x ) => x . description . as_ref ( ) , & InputBotInlineResult :: Document ( ref x ) => x . description . as_ref ( ) , _ => None } } pub fn document ( & self ) -> Option < & :: mtproto :: InputDocument > { match self { & InputBotInlineResult :: Document ( ref x ) => Some ( & x . document ) , _ => None } } pub fn duration ( & self ) -> Option < & :: mtproto :: int > { match self { & InputBotInlineResult :: InputBotInlineResult ( ref x ) => x . duration . as_ref ( ) , _ => None } } pub fn h ( & self ) -> Option < & :: mtproto :: int > { match self { & InputBotInlineResult :: InputBotInlineResult ( ref x ) => x . h . as_ref ( ) , _ => None } } pub fn id ( & self ) -> & :: mtproto :: string { match self { & InputBotInlineResult :: InputBotInlineResult ( ref x ) => & x . id , & InputBotInlineResult :: Photo ( ref x ) => & x . id , & InputBotInlineResult :: Game ( ref x ) => & x . id , & InputBotInlineResult :: Document ( ref x ) => & x . id , } } pub fn photo ( & self ) -> Option < & :: mtproto :: InputPhoto > { match self { & InputBotInlineResult :: Photo ( ref x ) => Some ( & x . photo ) , _ => None } } pub fn send_message ( & self ) -> & :: mtproto :: InputBotInlineMessage { match self { & InputBotInlineResult :: Document ( ref x ) => & x . send_message , & InputBotInlineResult :: Photo ( ref x ) => & x . send_message , & InputBotInlineResult :: Game ( ref x ) => & x . send_message , & InputBotInlineResult :: InputBotInlineResult ( ref x ) => & x . send_message , } } pub fn short_name ( & self ) -> Option < & :: mtproto :: string > { match self { & InputBotInlineResult :: Game ( ref x ) => Some ( & x . short_name ) , _ => None } } pub fn thumb_url ( & self ) -> Option < & :: mtproto :: string > { match self { & InputBotInlineResult :: InputBotInlineResult ( ref x ) => x . thumb_url . as_ref ( ) , _ => None } } pub fn title ( & self ) -> Option < & :: mtproto :: string > { match self { & InputBotInlineResult :: InputBotInlineResult ( ref x ) => x . title . as_ref ( ) , & InputBotInlineResult :: Document ( ref x ) => x . title . as_ref ( ) , _ => None } } pub fn type_ ( & self ) -> Option < & :: mtproto :: string > { match self { & InputBotInlineResult :: Photo ( ref x ) => Some ( & x . type_ ) , & InputBotInlineResult :: InputBotInlineResult ( ref x ) => Some ( & x . type_ ) , & InputBotInlineResult :: Document ( ref x ) => Some ( & x . type_ ) , _ => None } } pub fn url ( & self ) -> Option < & :: mtproto :: string > { match self { & InputBotInlineResult :: InputBotInlineResult ( ref x ) => x . url . as_ref ( ) , _ => None } } pub fn w ( & self ) -> Option < & :: mtproto :: int > { match self { & InputBotInlineResult :: InputBotInlineResult ( ref x ) => x . w . as_ref ( ) , _ => None } } } impl :: BoxedSerialize for InputBotInlineResult { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputBotInlineResult :: InputBotInlineResult ( ref x ) => ( :: ConstructorNumber ( 0x2cbbe15a ) , x ) , & InputBotInlineResult :: Photo ( ref x ) => ( :: ConstructorNumber ( 0xa8d864a7 ) , x ) , & InputBotInlineResult :: Document ( ref x ) => ( :: ConstructorNumber ( 0xfff8fdc4 ) , x ) , & InputBotInlineResult :: Game ( ref x ) => ( :: ConstructorNumber ( 0x4fa417f2 ) , x ) , } } } impl :: BoxedDeserialize for InputBotInlineResult { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x2cbbe15a ) , :: ConstructorNumber ( 0xa8d864a7 ) , :: ConstructorNumber ( 0xfff8fdc4 ) , :: ConstructorNumber ( 0x4fa417f2 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x2cbbe15a ) => Ok ( InputBotInlineResult :: InputBotInlineResult ( _de . read_bare :: < :: mtproto :: input_bot_inline_result :: InputBotInlineResult > ( ) ? ) ) , :: ConstructorNumber ( 0xa8d864a7 ) => Ok ( InputBotInlineResult :: Photo ( _de . read_bare :: < :: mtproto :: input_bot_inline_result :: Photo > ( ) ? ) ) , :: ConstructorNumber ( 0xfff8fdc4 ) => Ok ( InputBotInlineResult :: Document ( _de . read_bare :: < :: mtproto :: input_bot_inline_result :: Document > ( ) ? ) ) , :: ConstructorNumber ( 0x4fa417f2 ) => Ok ( InputBotInlineResult :: Game ( _de . read_bare :: < :: mtproto :: input_bot_inline_result :: Game > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `InputChannel`\n\n```text\ninputChannelEmpty#ee8c1e86 = InputChannel;\n\ninputChannel#afeb712e channel_id:int access_hash:long = InputChannel;\n```\n" ] pub enum InputChannel { Empty , InputChannel ( :: mtproto :: input_channel :: InputChannel ) , } impl InputChannel { pub fn access_hash ( & self ) -> Option < & :: mtproto :: long > { match self { & InputChannel :: InputChannel ( ref x ) => Some ( & x . access_hash ) , _ => None } } pub fn channel_id ( & self ) -> Option < & :: mtproto :: int > { match self { & InputChannel :: InputChannel ( ref x ) => Some ( & x . channel_id ) , _ => None } } } impl :: BoxedSerialize for InputChannel { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputChannel :: Empty => ( :: ConstructorNumber ( 0xee8c1e86 ) , & ( ) ) , & InputChannel :: InputChannel ( ref x ) => ( :: ConstructorNumber ( 0xafeb712e ) , x ) , } } } impl :: BoxedDeserialize for InputChannel { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xee8c1e86 ) , :: ConstructorNumber ( 0xafeb712e ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xee8c1e86 ) => Ok ( InputChannel :: Empty ) , :: ConstructorNumber ( 0xafeb712e ) => Ok ( InputChannel :: InputChannel ( _de . read_bare :: < :: mtproto :: input_channel :: InputChannel > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } impl :: BoxedSerialize for Option < :: mtproto :: input_channel :: InputChannel > { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match * self { None => ( :: ConstructorNumber ( 0xee8c1e86 ) , & ( ) ) , Some ( ref x ) => ( :: ConstructorNumber ( 0xafeb712e ) , x ) , } } } impl :: BoxedDeserialize for Option < :: mtproto :: input_channel :: InputChannel > { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xee8c1e86 ) , :: ConstructorNumber ( 0xafeb712e ) ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xee8c1e86 ) => Ok ( None ) , :: ConstructorNumber ( 0xafeb712e ) => Ok ( Some ( _de . read_bare :: < :: mtproto :: input_channel :: InputChannel > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `InputChatPhoto`\n\n```text\ninputChatPhotoEmpty#1ca48f57 = InputChatPhoto;\n\ninputChatUploadedPhoto#927c55b4 file:InputFile = InputChatPhoto;\n\ninputChatPhoto#8953ad37 id:InputPhoto = InputChatPhoto;\n```\n" ] pub enum InputChatPhoto { PhotoEmpty , UploadedPhoto ( :: mtproto :: input_chat :: UploadedPhoto ) , Photo ( :: mtproto :: input_chat :: Photo ) , } impl InputChatPhoto { pub fn file ( & self ) -> Option < & :: mtproto :: InputFile > { match self { & InputChatPhoto :: UploadedPhoto ( ref x ) => Some ( & x . file ) , _ => None } } pub fn id ( & self ) -> Option < & :: mtproto :: InputPhoto > { match self { & InputChatPhoto :: Photo ( ref x ) => Some ( & x . id ) , _ => None } } } impl :: BoxedSerialize for InputChatPhoto { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputChatPhoto :: PhotoEmpty => ( :: ConstructorNumber ( 0x1ca48f57 ) , & ( ) ) , & InputChatPhoto :: UploadedPhoto ( ref x ) => ( :: ConstructorNumber ( 0x927c55b4 ) , x ) , & InputChatPhoto :: Photo ( ref x ) => ( :: ConstructorNumber ( 0x8953ad37 ) , x ) , } } } impl :: BoxedDeserialize for InputChatPhoto { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x1ca48f57 ) , :: ConstructorNumber ( 0x927c55b4 ) , :: ConstructorNumber ( 0x8953ad37 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x1ca48f57 ) => Ok ( InputChatPhoto :: PhotoEmpty ) , :: ConstructorNumber ( 0x927c55b4 ) => Ok ( InputChatPhoto :: UploadedPhoto ( _de . read_bare :: < :: mtproto :: input_chat :: UploadedPhoto > ( ) ? ) ) , :: ConstructorNumber ( 0x8953ad37 ) => Ok ( InputChatPhoto :: Photo ( _de . read_bare :: < :: mtproto :: input_chat :: Photo > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `InputContact`\n\n```text\ninputPhoneContact#f392b7f4 client_id:long phone:string first_name:string last_name:string = InputContact;\n```\n" ] pub enum InputContact { InputPhoneContact ( :: mtproto :: input_phone_contact :: InputPhoneContact ) , } impl InputContact { pub fn client_id ( & self ) -> & :: mtproto :: long { match self { & InputContact :: InputPhoneContact ( ref x ) => & x . client_id , } } pub fn first_name ( & self ) -> & :: mtproto :: string { match self { & InputContact :: InputPhoneContact ( ref x ) => & x . first_name , } } pub fn last_name ( & self ) -> & :: mtproto :: string { match self { & InputContact :: InputPhoneContact ( ref x ) => & x . last_name , } } pub fn phone ( & self ) -> & :: mtproto :: string { match self { & InputContact :: InputPhoneContact ( ref x ) => & x . phone , } } } impl :: BoxedSerialize for InputContact { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputContact :: InputPhoneContact ( ref x ) => ( :: ConstructorNumber ( 0xf392b7f4 ) , x ) , } } } impl :: BoxedDeserialize for InputContact { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xf392b7f4 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xf392b7f4 ) => Ok ( InputContact :: InputPhoneContact ( _de . read_bare :: < :: mtproto :: input_phone_contact :: InputPhoneContact > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `InputDocument`\n\n```text\ninputDocumentEmpty#72f0eaae = InputDocument;\n\ninputDocument#18798952 id:long access_hash:long = InputDocument;\n```\n" ] pub enum InputDocument { Empty , InputDocument ( :: mtproto :: input_document :: InputDocument ) , } impl InputDocument { pub fn access_hash ( & self ) -> Option < & :: mtproto :: long > { match self { & InputDocument :: InputDocument ( ref x ) => Some ( & x . access_hash ) , _ => None } } pub fn id ( & self ) -> Option < & :: mtproto :: long > { match self { & InputDocument :: InputDocument ( ref x ) => Some ( & x . id ) , _ => None } } } impl :: BoxedSerialize for InputDocument { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputDocument :: Empty => ( :: ConstructorNumber ( 0x72f0eaae ) , & ( ) ) , & InputDocument :: InputDocument ( ref x ) => ( :: ConstructorNumber ( 0x18798952 ) , x ) , } } } impl :: BoxedDeserialize for InputDocument { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x72f0eaae ) , :: ConstructorNumber ( 0x18798952 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x72f0eaae ) => Ok ( InputDocument :: Empty ) , :: ConstructorNumber ( 0x18798952 ) => Ok ( InputDocument :: InputDocument ( _de . read_bare :: < :: mtproto :: input_document :: InputDocument > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } impl :: BoxedSerialize for Option < :: mtproto :: input_document :: InputDocument > { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match * self { None => ( :: ConstructorNumber ( 0x72f0eaae ) , & ( ) ) , Some ( ref x ) => ( :: ConstructorNumber ( 0x18798952 ) , x ) , } } } impl :: BoxedDeserialize for Option < :: mtproto :: input_document :: InputDocument > { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x72f0eaae ) , :: ConstructorNumber ( 0x18798952 ) ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x72f0eaae ) => Ok ( None ) , :: ConstructorNumber ( 0x18798952 ) => Ok ( Some ( _de . read_bare :: < :: mtproto :: input_document :: InputDocument > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `InputEncryptedChat`\n\n```text\ninputEncryptedChat#f141b5e1 chat_id:int access_hash:long = InputEncryptedChat;\n```\n" ] pub enum InputEncryptedChat { InputEncryptedChat ( :: mtproto :: input_encrypted_chat :: InputEncryptedChat ) , } impl InputEncryptedChat { pub fn access_hash ( & self ) -> & :: mtproto :: long { match self { & InputEncryptedChat :: InputEncryptedChat ( ref x ) => & x . access_hash , } } pub fn chat_id ( & self ) -> & :: mtproto :: int { match self { & InputEncryptedChat :: InputEncryptedChat ( ref x ) => & x . chat_id , } } } impl :: BoxedSerialize for InputEncryptedChat { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputEncryptedChat :: InputEncryptedChat ( ref x ) => ( :: ConstructorNumber ( 0xf141b5e1 ) , x ) , } } } impl :: BoxedDeserialize for InputEncryptedChat { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xf141b5e1 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xf141b5e1 ) => Ok ( InputEncryptedChat :: InputEncryptedChat ( _de . read_bare :: < :: mtproto :: input_encrypted_chat :: InputEncryptedChat > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `InputEncryptedFile`\n\n```text\ninputEncryptedFileEmpty#1837c364 = InputEncryptedFile;\n\ninputEncryptedFileUploaded#64bd0306 id:long parts:int md5_checksum:string key_fingerprint:int = InputEncryptedFile;\n\ninputEncryptedFile#5a17b5e5 id:long access_hash:long = InputEncryptedFile;\n\ninputEncryptedFileBigUploaded#2dc173c8 id:long parts:int key_fingerprint:int = InputEncryptedFile;\n```\n" ] pub enum InputEncryptedFile { Empty , Uploaded ( :: mtproto :: input_encrypted_file :: Uploaded ) , InputEncryptedFile ( :: mtproto :: input_encrypted_file :: InputEncryptedFile ) , BigUploaded ( :: mtproto :: input_encrypted_file :: BigUploaded ) , } impl InputEncryptedFile { pub fn access_hash ( & self ) -> Option < & :: mtproto :: long > { match self { & InputEncryptedFile :: InputEncryptedFile ( ref x ) => Some ( & x . access_hash ) , _ => None } } pub fn id ( & self ) -> Option < & :: mtproto :: long > { match self { & InputEncryptedFile :: Uploaded ( ref x ) => Some ( & x . id ) , & InputEncryptedFile :: BigUploaded ( ref x ) => Some ( & x . id ) , & InputEncryptedFile :: InputEncryptedFile ( ref x ) => Some ( & x . id ) , _ => None } } pub fn key_fingerprint ( & self ) -> Option < & :: mtproto :: int > { match self { & InputEncryptedFile :: Uploaded ( ref x ) => Some ( & x . key_fingerprint ) , & InputEncryptedFile :: BigUploaded ( ref x ) => Some ( & x . key_fingerprint ) , _ => None } } pub fn md5_checksum ( & self ) -> Option < & :: mtproto :: string > { match self { & InputEncryptedFile :: Uploaded ( ref x ) => Some ( & x . md5_checksum ) , _ => None } } pub fn parts ( & self ) -> Option < & :: mtproto :: int > { match self { & InputEncryptedFile :: Uploaded ( ref x ) => Some ( & x . parts ) , & InputEncryptedFile :: BigUploaded ( ref x ) => Some ( & x . parts ) , _ => None } } } impl :: BoxedSerialize for InputEncryptedFile { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputEncryptedFile :: Empty => ( :: ConstructorNumber ( 0x1837c364 ) , & ( ) ) , & InputEncryptedFile :: Uploaded ( ref x ) => ( :: ConstructorNumber ( 0x64bd0306 ) , x ) , & InputEncryptedFile :: InputEncryptedFile ( ref x ) => ( :: ConstructorNumber ( 0x5a17b5e5 ) , x ) , & InputEncryptedFile :: BigUploaded ( ref x ) => ( :: ConstructorNumber ( 0x2dc173c8 ) , x ) , } } } impl :: BoxedDeserialize for InputEncryptedFile { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x1837c364 ) , :: ConstructorNumber ( 0x64bd0306 ) , :: ConstructorNumber ( 0x5a17b5e5 ) , :: ConstructorNumber ( 0x2dc173c8 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x1837c364 ) => Ok ( InputEncryptedFile :: Empty ) , :: ConstructorNumber ( 0x64bd0306 ) => Ok ( InputEncryptedFile :: Uploaded ( _de . read_bare :: < :: mtproto :: input_encrypted_file :: Uploaded > ( ) ? ) ) , :: ConstructorNumber ( 0x5a17b5e5 ) => Ok ( InputEncryptedFile :: InputEncryptedFile ( _de . read_bare :: < :: mtproto :: input_encrypted_file :: InputEncryptedFile > ( ) ? ) ) , :: ConstructorNumber ( 0x2dc173c8 ) => Ok ( InputEncryptedFile :: BigUploaded ( _de . read_bare :: < :: mtproto :: input_encrypted_file :: BigUploaded > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `InputFile`\n\n```text\ninputFile#f52ff27f id:long parts:int name:string md5_checksum:string = InputFile;\n\ninputFileBig#fa4f0bb5 id:long parts:int name:string = InputFile;\n```\n" ] pub enum InputFile { InputFile ( :: mtproto :: input_file :: InputFile ) , Big ( :: mtproto :: input_file :: Big ) , } impl InputFile { pub fn id ( & self ) -> & :: mtproto :: long { match self { & InputFile :: InputFile ( ref x ) => & x . id , & InputFile :: Big ( ref x ) => & x . id , } } pub fn md5_checksum ( & self ) -> Option < & :: mtproto :: string > { match self { & InputFile :: InputFile ( ref x ) => Some ( & x . md5_checksum ) , _ => None } } pub fn name ( & self ) -> & :: mtproto :: string { match self { & InputFile :: Big ( ref x ) => & x . name , & InputFile :: InputFile ( ref x ) => & x . name , } } pub fn parts ( & self ) -> & :: mtproto :: int { match self { & InputFile :: Big ( ref x ) => & x . parts , & InputFile :: InputFile ( ref x ) => & x . parts , } } } impl :: BoxedSerialize for InputFile { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputFile :: InputFile ( ref x ) => ( :: ConstructorNumber ( 0xf52ff27f ) , x ) , & InputFile :: Big ( ref x ) => ( :: ConstructorNumber ( 0xfa4f0bb5 ) , x ) , } } } impl :: BoxedDeserialize for InputFile { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xf52ff27f ) , :: ConstructorNumber ( 0xfa4f0bb5 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xf52ff27f ) => Ok ( InputFile :: InputFile ( _de . read_bare :: < :: mtproto :: input_file :: InputFile > ( ) ? ) ) , :: ConstructorNumber ( 0xfa4f0bb5 ) => Ok ( InputFile :: Big ( _de . read_bare :: < :: mtproto :: input_file :: Big > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `InputFileLocation`\n\n```text\ninputFileLocation#14637196 volume_id:long local_id:int secret:long = InputFileLocation;\n\ninputEncryptedFileLocation#f5235d55 id:long access_hash:long = InputFileLocation;\n\ninputDocumentFileLocation#430f0724 id:long access_hash:long version:int = InputFileLocation;\n```\n" ] pub enum InputFileLocation { FileLocation ( :: mtproto :: input :: FileLocation ) , EncryptedFileLocation ( :: mtproto :: input :: EncryptedFileLocation ) , DocumentFileLocation ( :: mtproto :: input :: DocumentFileLocation ) , } impl InputFileLocation { pub fn access_hash ( & self ) -> Option < & :: mtproto :: long > { match self { & InputFileLocation :: DocumentFileLocation ( ref x ) => Some ( & x . access_hash ) , & InputFileLocation :: EncryptedFileLocation ( ref x ) => Some ( & x . access_hash ) , _ => None } } pub fn id ( & self ) -> Option < & :: mtproto :: long > { match self { & InputFileLocation :: DocumentFileLocation ( ref x ) => Some ( & x . id ) , & InputFileLocation :: EncryptedFileLocation ( ref x ) => Some ( & x . id ) , _ => None } } pub fn local_id ( & self ) -> Option < & :: mtproto :: int > { match self { & InputFileLocation :: FileLocation ( ref x ) => Some ( & x . local_id ) , _ => None } } pub fn secret ( & self ) -> Option < & :: mtproto :: long > { match self { & InputFileLocation :: FileLocation ( ref x ) => Some ( & x . secret ) , _ => None } } pub fn version ( & self ) -> Option < & :: mtproto :: int > { match self { & InputFileLocation :: DocumentFileLocation ( ref x ) => Some ( & x . version ) , _ => None } } pub fn volume_id ( & self ) -> Option < & :: mtproto :: long > { match self { & InputFileLocation :: FileLocation ( ref x ) => Some ( & x . volume_id ) , _ => None } } } impl :: BoxedSerialize for InputFileLocation { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputFileLocation :: FileLocation ( ref x ) => ( :: ConstructorNumber ( 0x14637196 ) , x ) , & InputFileLocation :: EncryptedFileLocation ( ref x ) => ( :: ConstructorNumber ( 0xf5235d55 ) , x ) , & InputFileLocation :: DocumentFileLocation ( ref x ) => ( :: ConstructorNumber ( 0x430f0724 ) , x ) , } } } impl :: BoxedDeserialize for InputFileLocation { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x14637196 ) , :: ConstructorNumber ( 0xf5235d55 ) , :: ConstructorNumber ( 0x430f0724 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x14637196 ) => Ok ( InputFileLocation :: FileLocation ( _de . read_bare :: < :: mtproto :: input :: FileLocation > ( ) ? ) ) , :: ConstructorNumber ( 0xf5235d55 ) => Ok ( InputFileLocation :: EncryptedFileLocation ( _de . read_bare :: < :: mtproto :: input :: EncryptedFileLocation > ( ) ? ) ) , :: ConstructorNumber ( 0x430f0724 ) => Ok ( InputFileLocation :: DocumentFileLocation ( _de . read_bare :: < :: mtproto :: input :: DocumentFileLocation > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `InputGame`\n\n```text\ninputGameID#32c3e77 id:long access_hash:long = InputGame;\n\ninputGameShortName#c331e80a bot_id:InputUser short_name:string = InputGame;\n```\n" ] pub enum InputGame { ID ( :: mtproto :: input_game :: ID ) , ShortName ( :: mtproto :: input_game :: ShortName ) , } impl InputGame { pub fn access_hash ( & self ) -> Option < & :: mtproto :: long > { match self { & InputGame :: ID ( ref x ) => Some ( & x . access_hash ) , _ => None } } pub fn bot_id ( & self ) -> Option < & :: mtproto :: InputUser > { match self { & InputGame :: ShortName ( ref x ) => Some ( & x . bot_id ) , _ => None } } pub fn id ( & self ) -> Option < & :: mtproto :: long > { match self { & InputGame :: ID ( ref x ) => Some ( & x . id ) , _ => None } } pub fn short_name ( & self ) -> Option < & :: mtproto :: string > { match self { & InputGame :: ShortName ( ref x ) => Some ( & x . short_name ) , _ => None } } } impl :: BoxedSerialize for InputGame { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputGame :: ID ( ref x ) => ( :: ConstructorNumber ( 0x032c3e77 ) , x ) , & InputGame :: ShortName ( ref x ) => ( :: ConstructorNumber ( 0xc331e80a ) , x ) , } } } impl :: BoxedDeserialize for InputGame { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x032c3e77 ) , :: ConstructorNumber ( 0xc331e80a ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x032c3e77 ) => Ok ( InputGame :: ID ( _de . read_bare :: < :: mtproto :: input_game :: ID > ( ) ? ) ) , :: ConstructorNumber ( 0xc331e80a ) => Ok ( InputGame :: ShortName ( _de . read_bare :: < :: mtproto :: input_game :: ShortName > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `InputGeoPoint`\n\n```text\ninputGeoPointEmpty#e4c123d6 = InputGeoPoint;\n\ninputGeoPoint#f3b7acc9 lat:double long:double = InputGeoPoint;\n```\n" ] pub enum InputGeoPoint { Empty , InputGeoPoint ( :: mtproto :: input_geo_point :: InputGeoPoint ) , } impl InputGeoPoint { pub fn lat ( & self ) -> Option < & :: mtproto :: double > { match self { & InputGeoPoint :: InputGeoPoint ( ref x ) => Some ( & x . lat ) , _ => None } } pub fn long ( & self ) -> Option < & :: mtproto :: double > { match self { & InputGeoPoint :: InputGeoPoint ( ref x ) => Some ( & x . long ) , _ => None } } } impl :: BoxedSerialize for InputGeoPoint { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputGeoPoint :: Empty => ( :: ConstructorNumber ( 0xe4c123d6 ) , & ( ) ) , & InputGeoPoint :: InputGeoPoint ( ref x ) => ( :: ConstructorNumber ( 0xf3b7acc9 ) , x ) , } } } impl :: BoxedDeserialize for InputGeoPoint { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xe4c123d6 ) , :: ConstructorNumber ( 0xf3b7acc9 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xe4c123d6 ) => Ok ( InputGeoPoint :: Empty ) , :: ConstructorNumber ( 0xf3b7acc9 ) => Ok ( InputGeoPoint :: InputGeoPoint ( _de . read_bare :: < :: mtproto :: input_geo_point :: InputGeoPoint > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } impl :: BoxedSerialize for Option < :: mtproto :: input_geo_point :: InputGeoPoint > { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match * self { None => ( :: ConstructorNumber ( 0xe4c123d6 ) , & ( ) ) , Some ( ref x ) => ( :: ConstructorNumber ( 0xf3b7acc9 ) , x ) , } } } impl :: BoxedDeserialize for Option < :: mtproto :: input_geo_point :: InputGeoPoint > { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xe4c123d6 ) , :: ConstructorNumber ( 0xf3b7acc9 ) ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xe4c123d6 ) => Ok ( None ) , :: ConstructorNumber ( 0xf3b7acc9 ) => Ok ( Some ( _de . read_bare :: < :: mtproto :: input_geo_point :: InputGeoPoint > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `InputMedia`\n\n```text\ninputMediaEmpty#9664f57f = InputMedia;\n\ninputMediaUploadedPhoto#2f37e231 flags:# file:InputFile caption:string stickers:flags.0?Vector<InputDocument> ttl_seconds:flags.1?int = InputMedia;\n\ninputMediaPhoto#81fa373a flags:# id:InputPhoto caption:string ttl_seconds:flags.0?int = InputMedia;\n\ninputMediaGeoPoint#f9c44144 geo_point:InputGeoPoint = InputMedia;\n\ninputMediaContact#a6e45987 phone_number:string first_name:string last_name:string = InputMedia;\n\ninputMediaUploadedDocument#e39621fd flags:# nosound_video:flags.3?true file:InputFile thumb:flags.2?InputFile mime_type:string attributes:Vector<DocumentAttribute> caption:string stickers:flags.0?Vector<InputDocument> ttl_seconds:flags.1?int = InputMedia;\n\ninputMediaDocument#5acb668e flags:# id:InputDocument caption:string ttl_seconds:flags.0?int = InputMedia;\n\ninputMediaVenue#c13d1c11 geo_point:InputGeoPoint title:string address:string provider:string venue_id:string venue_type:string = InputMedia;\n\ninputMediaGifExternal#4843b0fd url:string q:string = InputMedia;\n\ninputMediaPhotoExternal#922aec1 flags:# url:string caption:string ttl_seconds:flags.0?int = InputMedia;\n\ninputMediaDocumentExternal#b6f74335 flags:# url:string caption:string ttl_seconds:flags.0?int = InputMedia;\n\ninputMediaGame#d33f43f3 id:InputGame = InputMedia;\n\ninputMediaInvoice#f4e096c3 flags:# title:string description:string photo:flags.0?InputWebDocument invoice:Invoice payload:bytes provider:string provider_data:DataJSON start_param:string = InputMedia;\n\ninputMediaGeoLive#7b1a118f geo_point:InputGeoPoint period:int = InputMedia;\n```\n" ] pub enum InputMedia { Empty , UploadedPhoto ( :: mtproto :: input_media :: UploadedPhoto ) , Photo ( :: mtproto :: input_media :: Photo ) , GeoPoint ( :: mtproto :: input_media :: GeoPoint ) , Contact ( :: mtproto :: input_media :: Contact ) , UploadedDocument ( :: mtproto :: input_media :: UploadedDocument ) , Document ( :: mtproto :: input_media :: Document ) , Venue ( :: mtproto :: input_media :: Venue ) , GifExternal ( :: mtproto :: input_media :: GifExternal ) , PhotoExternal ( :: mtproto :: input_media :: PhotoExternal ) , DocumentExternal ( :: mtproto :: input_media :: DocumentExternal ) , Game ( :: mtproto :: input_media :: Game ) , Invoice ( :: mtproto :: input_media :: Invoice ) , GeoLive ( :: mtproto :: input_media :: GeoLive ) , } impl InputMedia { pub fn address ( & self ) -> Option < & :: mtproto :: string > { match self { & InputMedia :: Venue ( ref x ) => Some ( & x . address ) , _ => None } } pub fn attributes ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: DocumentAttribute > > { match self { & InputMedia :: UploadedDocument ( ref x ) => Some ( & x . attributes ) , _ => None } } pub fn caption ( & self ) -> Option < & :: mtproto :: string > { match self { & InputMedia :: Photo ( ref x ) => Some ( & x . caption ) , & InputMedia :: Document ( ref x ) => Some ( & x . caption ) , & InputMedia :: DocumentExternal ( ref x ) => Some ( & x . caption ) , & InputMedia :: UploadedPhoto ( ref x ) => Some ( & x . caption ) , & InputMedia :: UploadedDocument ( ref x ) => Some ( & x . caption ) , & InputMedia :: PhotoExternal ( ref x ) => Some ( & x . caption ) , _ => None } } pub fn description ( & self ) -> Option < & :: mtproto :: string > { match self { & InputMedia :: Invoice ( ref x ) => Some ( & x . description ) , _ => None } } pub fn file ( & self ) -> Option < & :: mtproto :: InputFile > { match self { & InputMedia :: UploadedPhoto ( ref x ) => Some ( & x . file ) , & InputMedia :: UploadedDocument ( ref x ) => Some ( & x . file ) , _ => None } } pub fn first_name ( & self ) -> Option < & :: mtproto :: string > { match self { & InputMedia :: Contact ( ref x ) => Some ( & x . first_name ) , _ => None } } pub fn geo_point ( & self ) -> Option < & :: mtproto :: InputGeoPoint > { match self { & InputMedia :: GeoLive ( ref x ) => Some ( & x . geo_point ) , & InputMedia :: GeoPoint ( ref x ) => Some ( & x . geo_point ) , & InputMedia :: Venue ( ref x ) => Some ( & x . geo_point ) , _ => None } } pub fn invoice ( & self ) -> Option < & :: mtproto :: Invoice > { match self { & InputMedia :: Invoice ( ref x ) => Some ( & x . invoice ) , _ => None } } pub fn last_name ( & self ) -> Option < & :: mtproto :: string > { match self { & InputMedia :: Contact ( ref x ) => Some ( & x . last_name ) , _ => None } } pub fn mime_type ( & self ) -> Option < & :: mtproto :: string > { match self { & InputMedia :: UploadedDocument ( ref x ) => Some ( & x . mime_type ) , _ => None } } pub fn nosound_video ( & self ) -> Option < bool > { match self { & InputMedia :: UploadedDocument ( ref x ) => Some ( x . nosound_video ) , _ => None } } pub fn payload ( & self ) -> Option < & :: mtproto :: bytes > { match self { & InputMedia :: Invoice ( ref x ) => Some ( & x . payload ) , _ => None } } pub fn period ( & self ) -> Option < & :: mtproto :: int > { match self { & InputMedia :: GeoLive ( ref x ) => Some ( & x . period ) , _ => None } } pub fn phone_number ( & self ) -> Option < & :: mtproto :: string > { match self { & InputMedia :: Contact ( ref x ) => Some ( & x . phone_number ) , _ => None } } pub fn photo ( & self ) -> Option < & :: mtproto :: InputWebDocument > { match self { & InputMedia :: Invoice ( ref x ) => x . photo . as_ref ( ) , _ => None } } pub fn provider ( & self ) -> Option < & :: mtproto :: string > { match self { & InputMedia :: Venue ( ref x ) => Some ( & x . provider ) , & InputMedia :: Invoice ( ref x ) => Some ( & x . provider ) , _ => None } } pub fn provider_data ( & self ) -> Option < & :: mtproto :: DataJSON > { match self { & InputMedia :: Invoice ( ref x ) => Some ( & x . provider_data ) , _ => None } } pub fn q ( & self ) -> Option < & :: mtproto :: string > { match self { & InputMedia :: GifExternal ( ref x ) => Some ( & x . q ) , _ => None } } pub fn start_param ( & self ) -> Option < & :: mtproto :: string > { match self { & InputMedia :: Invoice ( ref x ) => Some ( & x . start_param ) , _ => None } } pub fn stickers ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputDocument > > { match self { & InputMedia :: UploadedDocument ( ref x ) => x . stickers . as_ref ( ) , & InputMedia :: UploadedPhoto ( ref x ) => x . stickers . as_ref ( ) , _ => None } } pub fn thumb ( & self ) -> Option < & :: mtproto :: InputFile > { match self { & InputMedia :: UploadedDocument ( ref x ) => x . thumb . as_ref ( ) , _ => None } } pub fn title ( & self ) -> Option < & :: mtproto :: string > { match self { & InputMedia :: Invoice ( ref x ) => Some ( & x . title ) , & InputMedia :: Venue ( ref x ) => Some ( & x . title ) , _ => None } } pub fn ttl_seconds ( & self ) -> Option < & :: mtproto :: int > { match self { & InputMedia :: Photo ( ref x ) => x . ttl_seconds . as_ref ( ) , & InputMedia :: Document ( ref x ) => x . ttl_seconds . as_ref ( ) , & InputMedia :: UploadedDocument ( ref x ) => x . ttl_seconds . as_ref ( ) , & InputMedia :: DocumentExternal ( ref x ) => x . ttl_seconds . as_ref ( ) , & InputMedia :: PhotoExternal ( ref x ) => x . ttl_seconds . as_ref ( ) , & InputMedia :: UploadedPhoto ( ref x ) => x . ttl_seconds . as_ref ( ) , _ => None } } pub fn url ( & self ) -> Option < & :: mtproto :: string > { match self { & InputMedia :: PhotoExternal ( ref x ) => Some ( & x . url ) , & InputMedia :: GifExternal ( ref x ) => Some ( & x . url ) , & InputMedia :: DocumentExternal ( ref x ) => Some ( & x . url ) , _ => None } } pub fn venue_id ( & self ) -> Option < & :: mtproto :: string > { match self { & InputMedia :: Venue ( ref x ) => Some ( & x . venue_id ) , _ => None } } pub fn venue_type ( & self ) -> Option < & :: mtproto :: string > { match self { & InputMedia :: Venue ( ref x ) => Some ( & x . venue_type ) , _ => None } } } impl :: BoxedSerialize for InputMedia { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputMedia :: Empty => ( :: ConstructorNumber ( 0x9664f57f ) , & ( ) ) , & InputMedia :: UploadedPhoto ( ref x ) => ( :: ConstructorNumber ( 0x2f37e231 ) , x ) , & InputMedia :: Photo ( ref x ) => ( :: ConstructorNumber ( 0x81fa373a ) , x ) , & InputMedia :: GeoPoint ( ref x ) => ( :: ConstructorNumber ( 0xf9c44144 ) , x ) , & InputMedia :: Contact ( ref x ) => ( :: ConstructorNumber ( 0xa6e45987 ) , x ) , & InputMedia :: UploadedDocument ( ref x ) => ( :: ConstructorNumber ( 0xe39621fd ) , x ) , & InputMedia :: Document ( ref x ) => ( :: ConstructorNumber ( 0x5acb668e ) , x ) , & InputMedia :: Venue ( ref x ) => ( :: ConstructorNumber ( 0xc13d1c11 ) , x ) , & InputMedia :: GifExternal ( ref x ) => ( :: ConstructorNumber ( 0x4843b0fd ) , x ) , & InputMedia :: PhotoExternal ( ref x ) => ( :: ConstructorNumber ( 0x0922aec1 ) , x ) , & InputMedia :: DocumentExternal ( ref x ) => ( :: ConstructorNumber ( 0xb6f74335 ) , x ) , & InputMedia :: Game ( ref x ) => ( :: ConstructorNumber ( 0xd33f43f3 ) , x ) , & InputMedia :: Invoice ( ref x ) => ( :: ConstructorNumber ( 0xf4e096c3 ) , x ) , & InputMedia :: GeoLive ( ref x ) => ( :: ConstructorNumber ( 0x7b1a118f ) , x ) , } } } impl :: BoxedDeserialize for InputMedia { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x9664f57f ) , :: ConstructorNumber ( 0x2f37e231 ) , :: ConstructorNumber ( 0x81fa373a ) , :: ConstructorNumber ( 0xf9c44144 ) , :: ConstructorNumber ( 0xa6e45987 ) , :: ConstructorNumber ( 0xe39621fd ) , :: ConstructorNumber ( 0x5acb668e ) , :: ConstructorNumber ( 0xc13d1c11 ) , :: ConstructorNumber ( 0x4843b0fd ) , :: ConstructorNumber ( 0x0922aec1 ) , :: ConstructorNumber ( 0xb6f74335 ) , :: ConstructorNumber ( 0xd33f43f3 ) , :: ConstructorNumber ( 0xf4e096c3 ) , :: ConstructorNumber ( 0x7b1a118f ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x9664f57f ) => Ok ( InputMedia :: Empty ) , :: ConstructorNumber ( 0x2f37e231 ) => Ok ( InputMedia :: UploadedPhoto ( _de . read_bare :: < :: mtproto :: input_media :: UploadedPhoto > ( ) ? ) ) , :: ConstructorNumber ( 0x81fa373a ) => Ok ( InputMedia :: Photo ( _de . read_bare :: < :: mtproto :: input_media :: Photo > ( ) ? ) ) , :: ConstructorNumber ( 0xf9c44144 ) => Ok ( InputMedia :: GeoPoint ( _de . read_bare :: < :: mtproto :: input_media :: GeoPoint > ( ) ? ) ) , :: ConstructorNumber ( 0xa6e45987 ) => Ok ( InputMedia :: Contact ( _de . read_bare :: < :: mtproto :: input_media :: Contact > ( ) ? ) ) , :: ConstructorNumber ( 0xe39621fd ) => Ok ( InputMedia :: UploadedDocument ( _de . read_bare :: < :: mtproto :: input_media :: UploadedDocument > ( ) ? ) ) , :: ConstructorNumber ( 0x5acb668e ) => Ok ( InputMedia :: Document ( _de . read_bare :: < :: mtproto :: input_media :: Document > ( ) ? ) ) , :: ConstructorNumber ( 0xc13d1c11 ) => Ok ( InputMedia :: Venue ( _de . read_bare :: < :: mtproto :: input_media :: Venue > ( ) ? ) ) , :: ConstructorNumber ( 0x4843b0fd ) => Ok ( InputMedia :: GifExternal ( _de . read_bare :: < :: mtproto :: input_media :: GifExternal > ( ) ? ) ) , :: ConstructorNumber ( 0x0922aec1 ) => Ok ( InputMedia :: PhotoExternal ( _de . read_bare :: < :: mtproto :: input_media :: PhotoExternal > ( ) ? ) ) , :: ConstructorNumber ( 0xb6f74335 ) => Ok ( InputMedia :: DocumentExternal ( _de . read_bare :: < :: mtproto :: input_media :: DocumentExternal > ( ) ? ) ) , :: ConstructorNumber ( 0xd33f43f3 ) => Ok ( InputMedia :: Game ( _de . read_bare :: < :: mtproto :: input_media :: Game > ( ) ? ) ) , :: ConstructorNumber ( 0xf4e096c3 ) => Ok ( InputMedia :: Invoice ( _de . read_bare :: < :: mtproto :: input_media :: Invoice > ( ) ? ) ) , :: ConstructorNumber ( 0x7b1a118f ) => Ok ( InputMedia :: GeoLive ( _de . read_bare :: < :: mtproto :: input_media :: GeoLive > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `InputNotifyPeer`\n\n```text\ninputNotifyPeer#b8bc5b0c peer:InputPeer = InputNotifyPeer;\n\ninputNotifyUsers#193b4417 = InputNotifyPeer;\n\ninputNotifyChats#4a95e84e = InputNotifyPeer;\n\ninputNotifyAll#a429b886 = InputNotifyPeer;\n```\n" ] pub enum InputNotifyPeer { Peer ( :: mtproto :: input_notify :: Peer ) , Users , Chats , All , } impl InputNotifyPeer { pub fn peer ( & self ) -> Option < & :: mtproto :: InputPeer > { match self { & InputNotifyPeer :: Peer ( ref x ) => Some ( & x . peer ) , _ => None } } } impl :: BoxedSerialize for InputNotifyPeer { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputNotifyPeer :: Peer ( ref x ) => ( :: ConstructorNumber ( 0xb8bc5b0c ) , x ) , & InputNotifyPeer :: Users => ( :: ConstructorNumber ( 0x193b4417 ) , & ( ) ) , & InputNotifyPeer :: Chats => ( :: ConstructorNumber ( 0x4a95e84e ) , & ( ) ) , & InputNotifyPeer :: All => ( :: ConstructorNumber ( 0xa429b886 ) , & ( ) ) , } } } impl :: BoxedDeserialize for InputNotifyPeer { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xb8bc5b0c ) , :: ConstructorNumber ( 0x193b4417 ) , :: ConstructorNumber ( 0x4a95e84e ) , :: ConstructorNumber ( 0xa429b886 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xb8bc5b0c ) => Ok ( InputNotifyPeer :: Peer ( _de . read_bare :: < :: mtproto :: input_notify :: Peer > ( ) ? ) ) , :: ConstructorNumber ( 0x193b4417 ) => Ok ( InputNotifyPeer :: Users ) , :: ConstructorNumber ( 0x4a95e84e ) => Ok ( InputNotifyPeer :: Chats ) , :: ConstructorNumber ( 0xa429b886 ) => Ok ( InputNotifyPeer :: All ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `InputPaymentCredentials`\n\n```text\ninputPaymentCredentialsSaved#c10eb2cf id:string tmp_password:bytes = InputPaymentCredentials;\n\ninputPaymentCredentials#3417d728 flags:# save:flags.0?true data:DataJSON = InputPaymentCredentials;\n\ninputPaymentCredentialsApplePay#aa1c39f payment_data:DataJSON = InputPaymentCredentials;\n\ninputPaymentCredentialsAndroidPay#795667a6 payment_token:DataJSON = InputPaymentCredentials;\n```\n" ] pub enum InputPaymentCredentials { Saved ( :: mtproto :: input_payment_credentials :: Saved ) , InputPaymentCredentials ( :: mtproto :: input_payment_credentials :: InputPaymentCredentials ) , ApplePay ( :: mtproto :: input_payment_credentials :: ApplePay ) , AndroidPay ( :: mtproto :: input_payment_credentials :: AndroidPay ) , } impl InputPaymentCredentials { pub fn data ( & self ) -> Option < & :: mtproto :: DataJSON > { match self { & InputPaymentCredentials :: InputPaymentCredentials ( ref x ) => Some ( & x . data ) , _ => None } } pub fn id ( & self ) -> Option < & :: mtproto :: string > { match self { & InputPaymentCredentials :: Saved ( ref x ) => Some ( & x . id ) , _ => None } } pub fn payment_data ( & self ) -> Option < & :: mtproto :: DataJSON > { match self { & InputPaymentCredentials :: ApplePay ( ref x ) => Some ( & x . payment_data ) , _ => None } } pub fn payment_token ( & self ) -> Option < & :: mtproto :: DataJSON > { match self { & InputPaymentCredentials :: AndroidPay ( ref x ) => Some ( & x . payment_token ) , _ => None } } pub fn save ( & self ) -> Option < bool > { match self { & InputPaymentCredentials :: InputPaymentCredentials ( ref x ) => Some ( x . save ) , _ => None } } pub fn tmp_password ( & self ) -> Option < & :: mtproto :: bytes > { match self { & InputPaymentCredentials :: Saved ( ref x ) => Some ( & x . tmp_password ) , _ => None } } } impl :: BoxedSerialize for InputPaymentCredentials { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputPaymentCredentials :: Saved ( ref x ) => ( :: ConstructorNumber ( 0xc10eb2cf ) , x ) , & InputPaymentCredentials :: InputPaymentCredentials ( ref x ) => ( :: ConstructorNumber ( 0x3417d728 ) , x ) , & InputPaymentCredentials :: ApplePay ( ref x ) => ( :: ConstructorNumber ( 0x0aa1c39f ) , x ) , & InputPaymentCredentials :: AndroidPay ( ref x ) => ( :: ConstructorNumber ( 0x795667a6 ) , x ) , } } } impl :: BoxedDeserialize for InputPaymentCredentials { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xc10eb2cf ) , :: ConstructorNumber ( 0x3417d728 ) , :: ConstructorNumber ( 0x0aa1c39f ) , :: ConstructorNumber ( 0x795667a6 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xc10eb2cf ) => Ok ( InputPaymentCredentials :: Saved ( _de . read_bare :: < :: mtproto :: input_payment_credentials :: Saved > ( ) ? ) ) , :: ConstructorNumber ( 0x3417d728 ) => Ok ( InputPaymentCredentials :: InputPaymentCredentials ( _de . read_bare :: < :: mtproto :: input_payment_credentials :: InputPaymentCredentials > ( ) ? ) ) , :: ConstructorNumber ( 0x0aa1c39f ) => Ok ( InputPaymentCredentials :: ApplePay ( _de . read_bare :: < :: mtproto :: input_payment_credentials :: ApplePay > ( ) ? ) ) , :: ConstructorNumber ( 0x795667a6 ) => Ok ( InputPaymentCredentials :: AndroidPay ( _de . read_bare :: < :: mtproto :: input_payment_credentials :: AndroidPay > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `InputPeer`\n\n```text\ninputPeerEmpty#7f3b18ea = InputPeer;\n\ninputPeerSelf#7da07ec9 = InputPeer;\n\ninputPeerChat#179be863 chat_id:int = InputPeer;\n\ninputPeerUser#7b8e7de6 user_id:int access_hash:long = InputPeer;\n\ninputPeerChannel#20adaef8 channel_id:int access_hash:long = InputPeer;\n```\n" ] pub enum InputPeer { Empty , Self_ , Chat ( :: mtproto :: input_peer :: Chat ) , User ( :: mtproto :: input_peer :: User ) , Channel ( :: mtproto :: input_peer :: Channel ) , } impl InputPeer { pub fn access_hash ( & self ) -> Option < & :: mtproto :: long > { match self { & InputPeer :: User ( ref x ) => Some ( & x . access_hash ) , & InputPeer :: Channel ( ref x ) => Some ( & x . access_hash ) , _ => None } } pub fn channel_id ( & self ) -> Option < & :: mtproto :: int > { match self { & InputPeer :: Channel ( ref x ) => Some ( & x . channel_id ) , _ => None } } pub fn chat_id ( & self ) -> Option < & :: mtproto :: int > { match self { & InputPeer :: Chat ( ref x ) => Some ( & x . chat_id ) , _ => None } } pub fn user_id ( & self ) -> Option < & :: mtproto :: int > { match self { & InputPeer :: User ( ref x ) => Some ( & x . user_id ) , _ => None } } } impl :: BoxedSerialize for InputPeer { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputPeer :: Empty => ( :: ConstructorNumber ( 0x7f3b18ea ) , & ( ) ) , & InputPeer :: Self_ => ( :: ConstructorNumber ( 0x7da07ec9 ) , & ( ) ) , & InputPeer :: Chat ( ref x ) => ( :: ConstructorNumber ( 0x179be863 ) , x ) , & InputPeer :: User ( ref x ) => ( :: ConstructorNumber ( 0x7b8e7de6 ) , x ) , & InputPeer :: Channel ( ref x ) => ( :: ConstructorNumber ( 0x20adaef8 ) , x ) , } } } impl :: BoxedDeserialize for InputPeer { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x7f3b18ea ) , :: ConstructorNumber ( 0x7da07ec9 ) , :: ConstructorNumber ( 0x179be863 ) , :: ConstructorNumber ( 0x7b8e7de6 ) , :: ConstructorNumber ( 0x20adaef8 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x7f3b18ea ) => Ok ( InputPeer :: Empty ) , :: ConstructorNumber ( 0x7da07ec9 ) => Ok ( InputPeer :: Self_ ) , :: ConstructorNumber ( 0x179be863 ) => Ok ( InputPeer :: Chat ( _de . read_bare :: < :: mtproto :: input_peer :: Chat > ( ) ? ) ) , :: ConstructorNumber ( 0x7b8e7de6 ) => Ok ( InputPeer :: User ( _de . read_bare :: < :: mtproto :: input_peer :: User > ( ) ? ) ) , :: ConstructorNumber ( 0x20adaef8 ) => Ok ( InputPeer :: Channel ( _de . read_bare :: < :: mtproto :: input_peer :: Channel > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `InputPeerNotifyEvents`\n\n```text\ninputPeerNotifyEventsEmpty#f03064d8 = InputPeerNotifyEvents;\n\ninputPeerNotifyEventsAll#e86a2c74 = InputPeerNotifyEvents;\n```\n" ] pub enum InputPeerNotifyEvents { Empty , All , } impl :: BoxedSerialize for InputPeerNotifyEvents { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputPeerNotifyEvents :: Empty => ( :: ConstructorNumber ( 0xf03064d8 ) , & ( ) ) , & InputPeerNotifyEvents :: All => ( :: ConstructorNumber ( 0xe86a2c74 ) , & ( ) ) , } } } impl :: BoxedDeserialize for InputPeerNotifyEvents { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xf03064d8 ) , :: ConstructorNumber ( 0xe86a2c74 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xf03064d8 ) => Ok ( InputPeerNotifyEvents :: Empty ) , :: ConstructorNumber ( 0xe86a2c74 ) => Ok ( InputPeerNotifyEvents :: All ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `InputPeerNotifySettings`\n\n```text\ninputPeerNotifySettings#38935eb2 flags:# show_previews:flags.0?true silent:flags.1?true mute_until:int sound:string = InputPeerNotifySettings;\n```\n" ] pub enum InputPeerNotifySettings { InputPeerNotifySettings ( :: mtproto :: input_peer_notify_settings :: InputPeerNotifySettings ) , } impl InputPeerNotifySettings { pub fn mute_until ( & self ) -> & :: mtproto :: int { match self { & InputPeerNotifySettings :: InputPeerNotifySettings ( ref x ) => & x . mute_until , } } pub fn show_previews ( & self ) -> bool { match self { & InputPeerNotifySettings :: InputPeerNotifySettings ( ref x ) => x . show_previews , } } pub fn silent ( & self ) -> bool { match self { & InputPeerNotifySettings :: InputPeerNotifySettings ( ref x ) => x . silent , } } pub fn sound ( & self ) -> & :: mtproto :: string { match self { & InputPeerNotifySettings :: InputPeerNotifySettings ( ref x ) => & x . sound , } } } impl :: BoxedSerialize for InputPeerNotifySettings { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputPeerNotifySettings :: InputPeerNotifySettings ( ref x ) => ( :: ConstructorNumber ( 0x38935eb2 ) , x ) , } } } impl :: BoxedDeserialize for InputPeerNotifySettings { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x38935eb2 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x38935eb2 ) => Ok ( InputPeerNotifySettings :: InputPeerNotifySettings ( _de . read_bare :: < :: mtproto :: input_peer_notify_settings :: InputPeerNotifySettings > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `InputPhoneCall`\n\n```text\ninputPhoneCall#1e36fded id:long access_hash:long = InputPhoneCall;\n```\n" ] pub enum InputPhoneCall { InputPhoneCall ( :: mtproto :: input_phone_call :: InputPhoneCall ) , } impl InputPhoneCall { pub fn access_hash ( & self ) -> & :: mtproto :: long { match self { & InputPhoneCall :: InputPhoneCall ( ref x ) => & x . access_hash , } } pub fn id ( & self ) -> & :: mtproto :: long { match self { & InputPhoneCall :: InputPhoneCall ( ref x ) => & x . id , } } } impl :: BoxedSerialize for InputPhoneCall { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputPhoneCall :: InputPhoneCall ( ref x ) => ( :: ConstructorNumber ( 0x1e36fded ) , x ) , } } } impl :: BoxedDeserialize for InputPhoneCall { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x1e36fded ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x1e36fded ) => Ok ( InputPhoneCall :: InputPhoneCall ( _de . read_bare :: < :: mtproto :: input_phone_call :: InputPhoneCall > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `InputPhoto`\n\n```text\ninputPhotoEmpty#1cd7bf0d = InputPhoto;\n\ninputPhoto#fb95c6c4 id:long access_hash:long = InputPhoto;\n```\n" ] pub enum InputPhoto { Empty , InputPhoto ( :: mtproto :: input_photo :: InputPhoto ) , } impl InputPhoto { pub fn access_hash ( & self ) -> Option < & :: mtproto :: long > { match self { & InputPhoto :: InputPhoto ( ref x ) => Some ( & x . access_hash ) , _ => None } } pub fn id ( & self ) -> Option < & :: mtproto :: long > { match self { & InputPhoto :: InputPhoto ( ref x ) => Some ( & x . id ) , _ => None } } } impl :: BoxedSerialize for InputPhoto { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputPhoto :: Empty => ( :: ConstructorNumber ( 0x1cd7bf0d ) , & ( ) ) , & InputPhoto :: InputPhoto ( ref x ) => ( :: ConstructorNumber ( 0xfb95c6c4 ) , x ) , } } } impl :: BoxedDeserialize for InputPhoto { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x1cd7bf0d ) , :: ConstructorNumber ( 0xfb95c6c4 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x1cd7bf0d ) => Ok ( InputPhoto :: Empty ) , :: ConstructorNumber ( 0xfb95c6c4 ) => Ok ( InputPhoto :: InputPhoto ( _de . read_bare :: < :: mtproto :: input_photo :: InputPhoto > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } impl :: BoxedSerialize for Option < :: mtproto :: input_photo :: InputPhoto > { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match * self { None => ( :: ConstructorNumber ( 0x1cd7bf0d ) , & ( ) ) , Some ( ref x ) => ( :: ConstructorNumber ( 0xfb95c6c4 ) , x ) , } } } impl :: BoxedDeserialize for Option < :: mtproto :: input_photo :: InputPhoto > { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x1cd7bf0d ) , :: ConstructorNumber ( 0xfb95c6c4 ) ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x1cd7bf0d ) => Ok ( None ) , :: ConstructorNumber ( 0xfb95c6c4 ) => Ok ( Some ( _de . read_bare :: < :: mtproto :: input_photo :: InputPhoto > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `InputPrivacyKey`\n\n```text\ninputPrivacyKeyStatusTimestamp#4f96cb18 = InputPrivacyKey;\n\ninputPrivacyKeyChatInvite#bdfb0426 = InputPrivacyKey;\n\ninputPrivacyKeyPhoneCall#fabadc5f = InputPrivacyKey;\n```\n" ] pub enum InputPrivacyKey { StatusTimestamp , ChatInvite , PhoneCall , } impl :: BoxedSerialize for InputPrivacyKey { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputPrivacyKey :: StatusTimestamp => ( :: ConstructorNumber ( 0x4f96cb18 ) , & ( ) ) , & InputPrivacyKey :: ChatInvite => ( :: ConstructorNumber ( 0xbdfb0426 ) , & ( ) ) , & InputPrivacyKey :: PhoneCall => ( :: ConstructorNumber ( 0xfabadc5f ) , & ( ) ) , } } } impl :: BoxedDeserialize for InputPrivacyKey { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x4f96cb18 ) , :: ConstructorNumber ( 0xbdfb0426 ) , :: ConstructorNumber ( 0xfabadc5f ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x4f96cb18 ) => Ok ( InputPrivacyKey :: StatusTimestamp ) , :: ConstructorNumber ( 0xbdfb0426 ) => Ok ( InputPrivacyKey :: ChatInvite ) , :: ConstructorNumber ( 0xfabadc5f ) => Ok ( InputPrivacyKey :: PhoneCall ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `InputPrivacyRule`\n\n```text\ninputPrivacyValueAllowContacts#d09e07b = InputPrivacyRule;\n\ninputPrivacyValueAllowAll#184b35ce = InputPrivacyRule;\n\ninputPrivacyValueAllowUsers#131cc67f users:Vector<InputUser> = InputPrivacyRule;\n\ninputPrivacyValueDisallowContacts#ba52007 = InputPrivacyRule;\n\ninputPrivacyValueDisallowAll#d66b66c9 = InputPrivacyRule;\n\ninputPrivacyValueDisallowUsers#90110467 users:Vector<InputUser> = InputPrivacyRule;\n```\n" ] pub enum InputPrivacyRule { AllowContacts , AllowAll , AllowUsers ( :: mtproto :: input_privacy_value :: AllowUsers ) , DisallowContacts , DisallowAll , DisallowUsers ( :: mtproto :: input_privacy_value :: DisallowUsers ) , } impl InputPrivacyRule { pub fn users ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputUser > > { match self { & InputPrivacyRule :: AllowUsers ( ref x ) => Some ( & x . users ) , & InputPrivacyRule :: DisallowUsers ( ref x ) => Some ( & x . users ) , _ => None } } } impl :: BoxedSerialize for InputPrivacyRule { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputPrivacyRule :: AllowContacts => ( :: ConstructorNumber ( 0x0d09e07b ) , & ( ) ) , & InputPrivacyRule :: AllowAll => ( :: ConstructorNumber ( 0x184b35ce ) , & ( ) ) , & InputPrivacyRule :: AllowUsers ( ref x ) => ( :: ConstructorNumber ( 0x131cc67f ) , x ) , & InputPrivacyRule :: DisallowContacts => ( :: ConstructorNumber ( 0x0ba52007 ) , & ( ) ) , & InputPrivacyRule :: DisallowAll => ( :: ConstructorNumber ( 0xd66b66c9 ) , & ( ) ) , & InputPrivacyRule :: DisallowUsers ( ref x ) => ( :: ConstructorNumber ( 0x90110467 ) , x ) , } } } impl :: BoxedDeserialize for InputPrivacyRule { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x0d09e07b ) , :: ConstructorNumber ( 0x184b35ce ) , :: ConstructorNumber ( 0x131cc67f ) , :: ConstructorNumber ( 0x0ba52007 ) , :: ConstructorNumber ( 0xd66b66c9 ) , :: ConstructorNumber ( 0x90110467 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x0d09e07b ) => Ok ( InputPrivacyRule :: AllowContacts ) , :: ConstructorNumber ( 0x184b35ce ) => Ok ( InputPrivacyRule :: AllowAll ) , :: ConstructorNumber ( 0x131cc67f ) => Ok ( InputPrivacyRule :: AllowUsers ( _de . read_bare :: < :: mtproto :: input_privacy_value :: AllowUsers > ( ) ? ) ) , :: ConstructorNumber ( 0x0ba52007 ) => Ok ( InputPrivacyRule :: DisallowContacts ) , :: ConstructorNumber ( 0xd66b66c9 ) => Ok ( InputPrivacyRule :: DisallowAll ) , :: ConstructorNumber ( 0x90110467 ) => Ok ( InputPrivacyRule :: DisallowUsers ( _de . read_bare :: < :: mtproto :: input_privacy_value :: DisallowUsers > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `InputSingleMedia`\n\n```text\ninputSingleMedia#5eaa7809 media:InputMedia random_id:long = InputSingleMedia;\n```\n" ] pub enum InputSingleMedia { InputSingleMedia ( :: mtproto :: input_single_media :: InputSingleMedia ) , } impl InputSingleMedia { pub fn media ( & self ) -> & :: mtproto :: InputMedia { match self { & InputSingleMedia :: InputSingleMedia ( ref x ) => & x . media , } } pub fn random_id ( & self ) -> & :: mtproto :: long { match self { & InputSingleMedia :: InputSingleMedia ( ref x ) => & x . random_id , } } } impl :: BoxedSerialize for InputSingleMedia { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputSingleMedia :: InputSingleMedia ( ref x ) => ( :: ConstructorNumber ( 0x5eaa7809 ) , x ) , } } } impl :: BoxedDeserialize for InputSingleMedia { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x5eaa7809 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x5eaa7809 ) => Ok ( InputSingleMedia :: InputSingleMedia ( _de . read_bare :: < :: mtproto :: input_single_media :: InputSingleMedia > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `InputStickerSet`\n\n```text\ninputStickerSetEmpty#ffb62b95 = InputStickerSet;\n\ninputStickerSetID#9de7a269 id:long access_hash:long = InputStickerSet;\n\ninputStickerSetShortName#861cc8a0 short_name:string = InputStickerSet;\n```\n" ] pub enum InputStickerSet { Empty , ID ( :: mtproto :: input_sticker_set :: ID ) , ShortName ( :: mtproto :: input_sticker_set :: ShortName ) , } impl InputStickerSet { pub fn access_hash ( & self ) -> Option < & :: mtproto :: long > { match self { & InputStickerSet :: ID ( ref x ) => Some ( & x . access_hash ) , _ => None } } pub fn id ( & self ) -> Option < & :: mtproto :: long > { match self { & InputStickerSet :: ID ( ref x ) => Some ( & x . id ) , _ => None } } pub fn short_name ( & self ) -> Option < & :: mtproto :: string > { match self { & InputStickerSet :: ShortName ( ref x ) => Some ( & x . short_name ) , _ => None } } } impl :: BoxedSerialize for InputStickerSet { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputStickerSet :: Empty => ( :: ConstructorNumber ( 0xffb62b95 ) , & ( ) ) , & InputStickerSet :: ID ( ref x ) => ( :: ConstructorNumber ( 0x9de7a269 ) , x ) , & InputStickerSet :: ShortName ( ref x ) => ( :: ConstructorNumber ( 0x861cc8a0 ) , x ) , } } } impl :: BoxedDeserialize for InputStickerSet { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xffb62b95 ) , :: ConstructorNumber ( 0x9de7a269 ) , :: ConstructorNumber ( 0x861cc8a0 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xffb62b95 ) => Ok ( InputStickerSet :: Empty ) , :: ConstructorNumber ( 0x9de7a269 ) => Ok ( InputStickerSet :: ID ( _de . read_bare :: < :: mtproto :: input_sticker_set :: ID > ( ) ? ) ) , :: ConstructorNumber ( 0x861cc8a0 ) => Ok ( InputStickerSet :: ShortName ( _de . read_bare :: < :: mtproto :: input_sticker_set :: ShortName > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `InputStickerSetItem`\n\n```text\ninputStickerSetItem#ffa0a496 flags:# document:InputDocument emoji:string mask_coords:flags.0?MaskCoords = InputStickerSetItem;\n```\n" ] pub enum InputStickerSetItem { InputStickerSetItem ( :: mtproto :: input_sticker_set_item :: InputStickerSetItem ) , } impl InputStickerSetItem { pub fn document ( & self ) -> & :: mtproto :: InputDocument { match self { & InputStickerSetItem :: InputStickerSetItem ( ref x ) => & x . document , } } pub fn emoji ( & self ) -> & :: mtproto :: string { match self { & InputStickerSetItem :: InputStickerSetItem ( ref x ) => & x . emoji , } } pub fn mask_coords ( & self ) -> Option < & :: mtproto :: MaskCoords > { match self { & InputStickerSetItem :: InputStickerSetItem ( ref x ) => x . mask_coords . as_ref ( ) , } } } impl :: BoxedSerialize for InputStickerSetItem { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputStickerSetItem :: InputStickerSetItem ( ref x ) => ( :: ConstructorNumber ( 0xffa0a496 ) , x ) , } } } impl :: BoxedDeserialize for InputStickerSetItem { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xffa0a496 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xffa0a496 ) => Ok ( InputStickerSetItem :: InputStickerSetItem ( _de . read_bare :: < :: mtproto :: input_sticker_set_item :: InputStickerSetItem > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `InputStickeredMedia`\n\n```text\ninputStickeredMediaPhoto#4a992157 id:InputPhoto = InputStickeredMedia;\n\ninputStickeredMediaDocument#438865b id:InputDocument = InputStickeredMedia;\n```\n" ] pub enum InputStickeredMedia { Photo ( :: mtproto :: input_stickered_media :: Photo ) , Document ( :: mtproto :: input_stickered_media :: Document ) , } impl :: BoxedSerialize for InputStickeredMedia { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputStickeredMedia :: Photo ( ref x ) => ( :: ConstructorNumber ( 0x4a992157 ) , x ) , & InputStickeredMedia :: Document ( ref x ) => ( :: ConstructorNumber ( 0x0438865b ) , x ) , } } } impl :: BoxedDeserialize for InputStickeredMedia { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x4a992157 ) , :: ConstructorNumber ( 0x0438865b ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x4a992157 ) => Ok ( InputStickeredMedia :: Photo ( _de . read_bare :: < :: mtproto :: input_stickered_media :: Photo > ( ) ? ) ) , :: ConstructorNumber ( 0x0438865b ) => Ok ( InputStickeredMedia :: Document ( _de . read_bare :: < :: mtproto :: input_stickered_media :: Document > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `InputUser`\n\n```text\ninputUserEmpty#b98886cf = InputUser;\n\ninputUserSelf#f7c1b13f = InputUser;\n\ninputUser#d8292816 user_id:int access_hash:long = InputUser;\n```\n" ] pub enum InputUser { Empty , Self_ , InputUser ( :: mtproto :: input_user :: InputUser ) , } impl InputUser { pub fn access_hash ( & self ) -> Option < & :: mtproto :: long > { match self { & InputUser :: InputUser ( ref x ) => Some ( & x . access_hash ) , _ => None } } pub fn user_id ( & self ) -> Option < & :: mtproto :: int > { match self { & InputUser :: InputUser ( ref x ) => Some ( & x . user_id ) , _ => None } } } impl :: BoxedSerialize for InputUser { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputUser :: Empty => ( :: ConstructorNumber ( 0xb98886cf ) , & ( ) ) , & InputUser :: Self_ => ( :: ConstructorNumber ( 0xf7c1b13f ) , & ( ) ) , & InputUser :: InputUser ( ref x ) => ( :: ConstructorNumber ( 0xd8292816 ) , x ) , } } } impl :: BoxedDeserialize for InputUser { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xb98886cf ) , :: ConstructorNumber ( 0xf7c1b13f ) , :: ConstructorNumber ( 0xd8292816 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xb98886cf ) => Ok ( InputUser :: Empty ) , :: ConstructorNumber ( 0xf7c1b13f ) => Ok ( InputUser :: Self_ ) , :: ConstructorNumber ( 0xd8292816 ) => Ok ( InputUser :: InputUser ( _de . read_bare :: < :: mtproto :: input_user :: InputUser > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `InputWebDocument`\n\n```text\ninputWebDocument#9bed434d url:string size:int mime_type:string attributes:Vector<DocumentAttribute> = InputWebDocument;\n```\n" ] pub enum InputWebDocument { InputWebDocument ( :: mtproto :: input_web_document :: InputWebDocument ) , } impl InputWebDocument { pub fn attributes ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: DocumentAttribute > { match self { & InputWebDocument :: InputWebDocument ( ref x ) => & x . attributes , } } pub fn mime_type ( & self ) -> & :: mtproto :: string { match self { & InputWebDocument :: InputWebDocument ( ref x ) => & x . mime_type , } } pub fn size ( & self ) -> & :: mtproto :: int { match self { & InputWebDocument :: InputWebDocument ( ref x ) => & x . size , } } pub fn url ( & self ) -> & :: mtproto :: string { match self { & InputWebDocument :: InputWebDocument ( ref x ) => & x . url , } } } impl :: BoxedSerialize for InputWebDocument { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputWebDocument :: InputWebDocument ( ref x ) => ( :: ConstructorNumber ( 0x9bed434d ) , x ) , } } } impl :: BoxedDeserialize for InputWebDocument { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x9bed434d ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x9bed434d ) => Ok ( InputWebDocument :: InputWebDocument ( _de . read_bare :: < :: mtproto :: input_web_document :: InputWebDocument > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `InputWebFileLocation`\n\n```text\ninputWebFileLocation#c239d686 url:string access_hash:long = InputWebFileLocation;\n```\n" ] pub enum InputWebFileLocation { InputWebFileLocation ( :: mtproto :: input_web_file_location :: InputWebFileLocation ) , } impl InputWebFileLocation { pub fn access_hash ( & self ) -> & :: mtproto :: long { match self { & InputWebFileLocation :: InputWebFileLocation ( ref x ) => & x . access_hash , } } pub fn url ( & self ) -> & :: mtproto :: string { match self { & InputWebFileLocation :: InputWebFileLocation ( ref x ) => & x . url , } } } impl :: BoxedSerialize for InputWebFileLocation { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputWebFileLocation :: InputWebFileLocation ( ref x ) => ( :: ConstructorNumber ( 0xc239d686 ) , x ) , } } } impl :: BoxedDeserialize for InputWebFileLocation { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xc239d686 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xc239d686 ) => Ok ( InputWebFileLocation :: InputWebFileLocation ( _de . read_bare :: < :: mtproto :: input_web_file_location :: InputWebFileLocation > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `Invoice`\n\n```text\ninvoice#c30aa358 flags:# test:flags.0?true name_requested:flags.1?true phone_requested:flags.2?true email_requested:flags.3?true shipping_address_requested:flags.4?true flexible:flags.5?true phone_to_provider:flags.6?true email_to_provider:flags.7?true currency:string prices:Vector<LabeledPrice> = Invoice;\n```\n" ] pub enum Invoice { Invoice ( :: mtproto :: invoice :: Invoice ) , } impl Invoice { pub fn currency ( & self ) -> & :: mtproto :: string { match self { & Invoice :: Invoice ( ref x ) => & x . currency , } } pub fn email_requested ( & self ) -> bool { match self { & Invoice :: Invoice ( ref x ) => x . email_requested , } } pub fn email_to_provider ( & self ) -> bool { match self { & Invoice :: Invoice ( ref x ) => x . email_to_provider , } } pub fn flexible ( & self ) -> bool { match self { & Invoice :: Invoice ( ref x ) => x . flexible , } } pub fn name_requested ( & self ) -> bool { match self { & Invoice :: Invoice ( ref x ) => x . name_requested , } } pub fn phone_requested ( & self ) -> bool { match self { & Invoice :: Invoice ( ref x ) => x . phone_requested , } } pub fn phone_to_provider ( & self ) -> bool { match self { & Invoice :: Invoice ( ref x ) => x . phone_to_provider , } } pub fn prices ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: LabeledPrice > { match self { & Invoice :: Invoice ( ref x ) => & x . prices , } } pub fn shipping_address_requested ( & self ) -> bool { match self { & Invoice :: Invoice ( ref x ) => x . shipping_address_requested , } } pub fn test ( & self ) -> bool { match self { & Invoice :: Invoice ( ref x ) => x . test , } } } impl :: BoxedSerialize for Invoice { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Invoice :: Invoice ( ref x ) => ( :: ConstructorNumber ( 0xc30aa358 ) , x ) , } } } impl :: BoxedDeserialize for Invoice { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xc30aa358 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xc30aa358 ) => Ok ( Invoice :: Invoice ( _de . read_bare :: < :: mtproto :: invoice :: Invoice > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `KeyboardButton`\n\n```text\nkeyboardButton#a2fa4880 text:string = KeyboardButton;\n\nkeyboardButtonUrl#258aff05 text:string url:string = KeyboardButton;\n\nkeyboardButtonCallback#683a5e46 text:string data:bytes = KeyboardButton;\n\nkeyboardButtonRequestPhone#b16a6c29 text:string = KeyboardButton;\n\nkeyboardButtonRequestGeoLocation#fc796b3f text:string = KeyboardButton;\n\nkeyboardButtonSwitchInline#568a748 flags:# same_peer:flags.0?true text:string query:string = KeyboardButton;\n\nkeyboardButtonGame#50f41ccf text:string = KeyboardButton;\n\nkeyboardButtonBuy#afd93fbb text:string = KeyboardButton;\n```\n" ] pub enum KeyboardButton { KeyboardButton ( :: mtproto :: keyboard_button :: KeyboardButton ) , Url ( :: mtproto :: keyboard_button :: Url ) , Callback ( :: mtproto :: keyboard_button :: Callback ) , RequestPhone ( :: mtproto :: keyboard_button :: RequestPhone ) , RequestGeoLocation ( :: mtproto :: keyboard_button :: RequestGeoLocation ) , SwitchInline ( :: mtproto :: keyboard_button :: SwitchInline ) , Game ( :: mtproto :: keyboard_button :: Game ) , Buy ( :: mtproto :: keyboard_button :: Buy ) , } impl KeyboardButton { pub fn data ( & self ) -> Option < & :: mtproto :: bytes > { match self { & KeyboardButton :: Callback ( ref x ) => Some ( & x . data ) , _ => None } } pub fn query ( & self ) -> Option < & :: mtproto :: string > { match self { & KeyboardButton :: SwitchInline ( ref x ) => Some ( & x . query ) , _ => None } } pub fn same_peer ( & self ) -> Option < bool > { match self { & KeyboardButton :: SwitchInline ( ref x ) => Some ( x . same_peer ) , _ => None } } pub fn text ( & self ) -> & :: mtproto :: string { match self { & KeyboardButton :: SwitchInline ( ref x ) => & x . text , & KeyboardButton :: RequestPhone ( ref x ) => & x . text , & KeyboardButton :: Game ( ref x ) => & x . text , & KeyboardButton :: RequestGeoLocation ( ref x ) => & x . text , & KeyboardButton :: KeyboardButton ( ref x ) => & x . text , & KeyboardButton :: Url ( ref x ) => & x . text , & KeyboardButton :: Buy ( ref x ) => & x . text , & KeyboardButton :: Callback ( ref x ) => & x . text , } } pub fn url ( & self ) -> Option < & :: mtproto :: string > { match self { & KeyboardButton :: Url ( ref x ) => Some ( & x . url ) , _ => None } } } impl :: BoxedSerialize for KeyboardButton { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & KeyboardButton :: KeyboardButton ( ref x ) => ( :: ConstructorNumber ( 0xa2fa4880 ) , x ) , & KeyboardButton :: Url ( ref x ) => ( :: ConstructorNumber ( 0x258aff05 ) , x ) , & KeyboardButton :: Callback ( ref x ) => ( :: ConstructorNumber ( 0x683a5e46 ) , x ) , & KeyboardButton :: RequestPhone ( ref x ) => ( :: ConstructorNumber ( 0xb16a6c29 ) , x ) , & KeyboardButton :: RequestGeoLocation ( ref x ) => ( :: ConstructorNumber ( 0xfc796b3f ) , x ) , & KeyboardButton :: SwitchInline ( ref x ) => ( :: ConstructorNumber ( 0x0568a748 ) , x ) , & KeyboardButton :: Game ( ref x ) => ( :: ConstructorNumber ( 0x50f41ccf ) , x ) , & KeyboardButton :: Buy ( ref x ) => ( :: ConstructorNumber ( 0xafd93fbb ) , x ) , } } } impl :: BoxedDeserialize for KeyboardButton { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xa2fa4880 ) , :: ConstructorNumber ( 0x258aff05 ) , :: ConstructorNumber ( 0x683a5e46 ) , :: ConstructorNumber ( 0xb16a6c29 ) , :: ConstructorNumber ( 0xfc796b3f ) , :: ConstructorNumber ( 0x0568a748 ) , :: ConstructorNumber ( 0x50f41ccf ) , :: ConstructorNumber ( 0xafd93fbb ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xa2fa4880 ) => Ok ( KeyboardButton :: KeyboardButton ( _de . read_bare :: < :: mtproto :: keyboard_button :: KeyboardButton > ( ) ? ) ) , :: ConstructorNumber ( 0x258aff05 ) => Ok ( KeyboardButton :: Url ( _de . read_bare :: < :: mtproto :: keyboard_button :: Url > ( ) ? ) ) , :: ConstructorNumber ( 0x683a5e46 ) => Ok ( KeyboardButton :: Callback ( _de . read_bare :: < :: mtproto :: keyboard_button :: Callback > ( ) ? ) ) , :: ConstructorNumber ( 0xb16a6c29 ) => Ok ( KeyboardButton :: RequestPhone ( _de . read_bare :: < :: mtproto :: keyboard_button :: RequestPhone > ( ) ? ) ) , :: ConstructorNumber ( 0xfc796b3f ) => Ok ( KeyboardButton :: RequestGeoLocation ( _de . read_bare :: < :: mtproto :: keyboard_button :: RequestGeoLocation > ( ) ? ) ) , :: ConstructorNumber ( 0x0568a748 ) => Ok ( KeyboardButton :: SwitchInline ( _de . read_bare :: < :: mtproto :: keyboard_button :: SwitchInline > ( ) ? ) ) , :: ConstructorNumber ( 0x50f41ccf ) => Ok ( KeyboardButton :: Game ( _de . read_bare :: < :: mtproto :: keyboard_button :: Game > ( ) ? ) ) , :: ConstructorNumber ( 0xafd93fbb ) => Ok ( KeyboardButton :: Buy ( _de . read_bare :: < :: mtproto :: keyboard_button :: Buy > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `KeyboardButtonRow`\n\n```text\nkeyboardButtonRow#77608b83 buttons:Vector<KeyboardButton> = KeyboardButtonRow;\n```\n" ] pub enum KeyboardButtonRow { KeyboardButtonRow ( :: mtproto :: keyboard_button_row :: KeyboardButtonRow ) , } impl KeyboardButtonRow { pub fn buttons ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: KeyboardButton > { match self { & KeyboardButtonRow :: KeyboardButtonRow ( ref x ) => & x . buttons , } } } impl :: BoxedSerialize for KeyboardButtonRow { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & KeyboardButtonRow :: KeyboardButtonRow ( ref x ) => ( :: ConstructorNumber ( 0x77608b83 ) , x ) , } } } impl :: BoxedDeserialize for KeyboardButtonRow { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x77608b83 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x77608b83 ) => Ok ( KeyboardButtonRow :: KeyboardButtonRow ( _de . read_bare :: < :: mtproto :: keyboard_button_row :: KeyboardButtonRow > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `LabeledPrice`\n\n```text\nlabeledPrice#cb296bf8 label:string amount:long = LabeledPrice;\n```\n" ] pub enum LabeledPrice { LabeledPrice ( :: mtproto :: labeled_price :: LabeledPrice ) , } impl LabeledPrice { pub fn amount ( & self ) -> & :: mtproto :: long { match self { & LabeledPrice :: LabeledPrice ( ref x ) => & x . amount , } } pub fn label ( & self ) -> & :: mtproto :: string { match self { & LabeledPrice :: LabeledPrice ( ref x ) => & x . label , } } } impl :: BoxedSerialize for LabeledPrice { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & LabeledPrice :: LabeledPrice ( ref x ) => ( :: ConstructorNumber ( 0xcb296bf8 ) , x ) , } } } impl :: BoxedDeserialize for LabeledPrice { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xcb296bf8 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xcb296bf8 ) => Ok ( LabeledPrice :: LabeledPrice ( _de . read_bare :: < :: mtproto :: labeled_price :: LabeledPrice > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `LangPackDifference`\n\n```text\nlangPackDifference#f385c1f6 lang_code:string from_version:int version:int strings:Vector<LangPackString> = LangPackDifference;\n```\n" ] pub enum LangPackDifference { LangPackDifference ( :: mtproto :: lang_pack_difference :: LangPackDifference ) , } impl LangPackDifference { pub fn from_version ( & self ) -> & :: mtproto :: int { match self { & LangPackDifference :: LangPackDifference ( ref x ) => & x . from_version , } } pub fn lang_code ( & self ) -> & :: mtproto :: string { match self { & LangPackDifference :: LangPackDifference ( ref x ) => & x . lang_code , } } pub fn strings ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: LangPackString > { match self { & LangPackDifference :: LangPackDifference ( ref x ) => & x . strings , } } pub fn version ( & self ) -> & :: mtproto :: int { match self { & LangPackDifference :: LangPackDifference ( ref x ) => & x . version , } } } impl :: BoxedSerialize for LangPackDifference { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & LangPackDifference :: LangPackDifference ( ref x ) => ( :: ConstructorNumber ( 0xf385c1f6 ) , x ) , } } } impl :: BoxedDeserialize for LangPackDifference { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xf385c1f6 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xf385c1f6 ) => Ok ( LangPackDifference :: LangPackDifference ( _de . read_bare :: < :: mtproto :: lang_pack_difference :: LangPackDifference > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `LangPackLanguage`\n\n```text\nlangPackLanguage#117698f1 name:string native_name:string lang_code:string = LangPackLanguage;\n```\n" ] pub enum LangPackLanguage { LangPackLanguage ( :: mtproto :: lang_pack_language :: LangPackLanguage ) , } impl LangPackLanguage { pub fn lang_code ( & self ) -> & :: mtproto :: string { match self { & LangPackLanguage :: LangPackLanguage ( ref x ) => & x . lang_code , } } pub fn name ( & self ) -> & :: mtproto :: string { match self { & LangPackLanguage :: LangPackLanguage ( ref x ) => & x . name , } } pub fn native_name ( & self ) -> & :: mtproto :: string { match self { & LangPackLanguage :: LangPackLanguage ( ref x ) => & x . native_name , } } } impl :: BoxedSerialize for LangPackLanguage { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & LangPackLanguage :: LangPackLanguage ( ref x ) => ( :: ConstructorNumber ( 0x117698f1 ) , x ) , } } } impl :: BoxedDeserialize for LangPackLanguage { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x117698f1 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x117698f1 ) => Ok ( LangPackLanguage :: LangPackLanguage ( _de . read_bare :: < :: mtproto :: lang_pack_language :: LangPackLanguage > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `LangPackString`\n\n```text\nlangPackString#cad181f6 key:string value:string = LangPackString;\n\nlangPackStringPluralized#6c47ac9f flags:# key:string zero_value:flags.0?string one_value:flags.1?string two_value:flags.2?string few_value:flags.3?string many_value:flags.4?string other_value:string = LangPackString;\n\nlangPackStringDeleted#2979eeb2 key:string = LangPackString;\n```\n" ] pub enum LangPackString { LangPackString ( :: mtproto :: lang_pack_string :: LangPackString ) , Pluralized ( :: mtproto :: lang_pack_string :: Pluralized ) , Deleted ( :: mtproto :: lang_pack_string :: Deleted ) , } impl LangPackString { pub fn few_value ( & self ) -> Option < & :: mtproto :: string > { match self { & LangPackString :: Pluralized ( ref x ) => x . few_value . as_ref ( ) , _ => None } } pub fn key ( & self ) -> & :: mtproto :: string { match self { & LangPackString :: LangPackString ( ref x ) => & x . key , & LangPackString :: Pluralized ( ref x ) => & x . key , & LangPackString :: Deleted ( ref x ) => & x . key , } } pub fn many_value ( & self ) -> Option < & :: mtproto :: string > { match self { & LangPackString :: Pluralized ( ref x ) => x . many_value . as_ref ( ) , _ => None } } pub fn one_value ( & self ) -> Option < & :: mtproto :: string > { match self { & LangPackString :: Pluralized ( ref x ) => x . one_value . as_ref ( ) , _ => None } } pub fn other_value ( & self ) -> Option < & :: mtproto :: string > { match self { & LangPackString :: Pluralized ( ref x ) => Some ( & x . other_value ) , _ => None } } pub fn two_value ( & self ) -> Option < & :: mtproto :: string > { match self { & LangPackString :: Pluralized ( ref x ) => x . two_value . as_ref ( ) , _ => None } } pub fn value ( & self ) -> Option < & :: mtproto :: string > { match self { & LangPackString :: LangPackString ( ref x ) => Some ( & x . value ) , _ => None } } pub fn zero_value ( & self ) -> Option < & :: mtproto :: string > { match self { & LangPackString :: Pluralized ( ref x ) => x . zero_value . as_ref ( ) , _ => None } } } impl :: BoxedSerialize for LangPackString { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & LangPackString :: LangPackString ( ref x ) => ( :: ConstructorNumber ( 0xcad181f6 ) , x ) , & LangPackString :: Pluralized ( ref x ) => ( :: ConstructorNumber ( 0x6c47ac9f ) , x ) , & LangPackString :: Deleted ( ref x ) => ( :: ConstructorNumber ( 0x2979eeb2 ) , x ) , } } } impl :: BoxedDeserialize for LangPackString { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xcad181f6 ) , :: ConstructorNumber ( 0x6c47ac9f ) , :: ConstructorNumber ( 0x2979eeb2 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xcad181f6 ) => Ok ( LangPackString :: LangPackString ( _de . read_bare :: < :: mtproto :: lang_pack_string :: LangPackString > ( ) ? ) ) , :: ConstructorNumber ( 0x6c47ac9f ) => Ok ( LangPackString :: Pluralized ( _de . read_bare :: < :: mtproto :: lang_pack_string :: Pluralized > ( ) ? ) ) , :: ConstructorNumber ( 0x2979eeb2 ) => Ok ( LangPackString :: Deleted ( _de . read_bare :: < :: mtproto :: lang_pack_string :: Deleted > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `MaskCoords`\n\n```text\nmaskCoords#aed6dbb2 n:int x:double y:double zoom:double = MaskCoords;\n```\n" ] pub enum MaskCoords { MaskCoords ( :: mtproto :: mask_coords :: MaskCoords ) , } impl MaskCoords { pub fn n ( & self ) -> & :: mtproto :: int { match self { & MaskCoords :: MaskCoords ( ref x ) => & x . n , } } pub fn x ( & self ) -> & :: mtproto :: double { match self { & MaskCoords :: MaskCoords ( ref x ) => & x . x , } } pub fn y ( & self ) -> & :: mtproto :: double { match self { & MaskCoords :: MaskCoords ( ref x ) => & x . y , } } pub fn zoom ( & self ) -> & :: mtproto :: double { match self { & MaskCoords :: MaskCoords ( ref x ) => & x . zoom , } } } impl :: BoxedSerialize for MaskCoords { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & MaskCoords :: MaskCoords ( ref x ) => ( :: ConstructorNumber ( 0xaed6dbb2 ) , x ) , } } } impl :: BoxedDeserialize for MaskCoords { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xaed6dbb2 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xaed6dbb2 ) => Ok ( MaskCoords :: MaskCoords ( _de . read_bare :: < :: mtproto :: mask_coords :: MaskCoords > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `Message`\n\n```text\nmessageEmpty#83e5de54 id:int = Message;\n\nmessage#44f9b43d flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true id:int from_id:flags.8?int to_id:Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to_msg_id:flags.3?int date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long = Message;\n\nmessageService#9e19a1f6 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true id:int from_id:flags.8?int to_id:Peer reply_to_msg_id:flags.3?int date:int action:MessageAction = Message;\n```\n" ] pub enum Message { Empty ( :: mtproto :: message :: Empty ) , Message ( :: mtproto :: message :: Message ) , Service ( :: mtproto :: message :: Service ) , } impl Message { pub fn action ( & self ) -> Option < & :: mtproto :: MessageAction > { match self { & Message :: Service ( ref x ) => Some ( & x . action ) , _ => None } } pub fn date ( & self ) -> Option < & :: mtproto :: int > { match self { & Message :: Service ( ref x ) => Some ( & x . date ) , & Message :: Message ( ref x ) => Some ( & x . date ) , _ => None } } pub fn edit_date ( & self ) -> Option < & :: mtproto :: int > { match self { & Message :: Message ( ref x ) => x . edit_date . as_ref ( ) , _ => None } } pub fn entities ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: MessageEntity > > { match self { & Message :: Message ( ref x ) => x . entities . as_ref ( ) , _ => None } } pub fn from_id ( & self ) -> Option < & :: mtproto :: int > { match self { & Message :: Service ( ref x ) => x . from_id . as_ref ( ) , & Message :: Message ( ref x ) => x . from_id . as_ref ( ) , _ => None } } pub fn fwd_from ( & self ) -> Option < & :: mtproto :: MessageFwdHeader > { match self { & Message :: Message ( ref x ) => x . fwd_from . as_ref ( ) , _ => None } } pub fn grouped_id ( & self ) -> Option < & :: mtproto :: long > { match self { & Message :: Message ( ref x ) => x . grouped_id . as_ref ( ) , _ => None } } pub fn id ( & self ) -> & :: mtproto :: int { match self { & Message :: Message ( ref x ) => & x . id , & Message :: Service ( ref x ) => & x . id , & Message :: Empty ( ref x ) => & x . id , } } pub fn media ( & self ) -> Option < & :: mtproto :: MessageMedia > { match self { & Message :: Message ( ref x ) => x . media . as_ref ( ) , _ => None } } pub fn media_unread ( & self ) -> Option < bool > { match self { & Message :: Service ( ref x ) => Some ( x . media_unread ) , & Message :: Message ( ref x ) => Some ( x . media_unread ) , _ => None } } pub fn mentioned ( & self ) -> Option < bool > { match self { & Message :: Message ( ref x ) => Some ( x . mentioned ) , & Message :: Service ( ref x ) => Some ( x . mentioned ) , _ => None } } pub fn message ( & self ) -> Option < & :: mtproto :: string > { match self { & Message :: Message ( ref x ) => Some ( & x . message ) , _ => None } } pub fn out ( & self ) -> Option < bool > { match self { & Message :: Message ( ref x ) => Some ( x . out ) , & Message :: Service ( ref x ) => Some ( x . out ) , _ => None } } pub fn post ( & self ) -> Option < bool > { match self { & Message :: Message ( ref x ) => Some ( x . post ) , & Message :: Service ( ref x ) => Some ( x . post ) , _ => None } } pub fn post_author ( & self ) -> Option < & :: mtproto :: string > { match self { & Message :: Message ( ref x ) => x . post_author . as_ref ( ) , _ => None } } pub fn reply_markup ( & self ) -> Option < & :: mtproto :: ReplyMarkup > { match self { & Message :: Message ( ref x ) => x . reply_markup . as_ref ( ) , _ => None } } pub fn reply_to_msg_id ( & self ) -> Option < & :: mtproto :: int > { match self { & Message :: Message ( ref x ) => x . reply_to_msg_id . as_ref ( ) , & Message :: Service ( ref x ) => x . reply_to_msg_id . as_ref ( ) , _ => None } } pub fn silent ( & self ) -> Option < bool > { match self { & Message :: Message ( ref x ) => Some ( x . silent ) , & Message :: Service ( ref x ) => Some ( x . silent ) , _ => None } } pub fn to_id ( & self ) -> Option < & :: mtproto :: Peer > { match self { & Message :: Service ( ref x ) => Some ( & x . to_id ) , & Message :: Message ( ref x ) => Some ( & x . to_id ) , _ => None } } pub fn via_bot_id ( & self ) -> Option < & :: mtproto :: int > { match self { & Message :: Message ( ref x ) => x . via_bot_id . as_ref ( ) , _ => None } } pub fn views ( & self ) -> Option < & :: mtproto :: int > { match self { & Message :: Message ( ref x ) => x . views . as_ref ( ) , _ => None } } } impl :: BoxedSerialize for Message { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Message :: Empty ( ref x ) => ( :: ConstructorNumber ( 0x83e5de54 ) , x ) , & Message :: Message ( ref x ) => ( :: ConstructorNumber ( 0x44f9b43d ) , x ) , & Message :: Service ( ref x ) => ( :: ConstructorNumber ( 0x9e19a1f6 ) , x ) , } } } impl :: BoxedDeserialize for Message { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x83e5de54 ) , :: ConstructorNumber ( 0x44f9b43d ) , :: ConstructorNumber ( 0x9e19a1f6 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x83e5de54 ) => Ok ( Message :: Empty ( _de . read_bare :: < :: mtproto :: message :: Empty > ( ) ? ) ) , :: ConstructorNumber ( 0x44f9b43d ) => Ok ( Message :: Message ( _de . read_bare :: < :: mtproto :: message :: Message > ( ) ? ) ) , :: ConstructorNumber ( 0x9e19a1f6 ) => Ok ( Message :: Service ( _de . read_bare :: < :: mtproto :: message :: Service > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `MessageAction`\n\n```text\nmessageActionEmpty#b6aef7b0 = MessageAction;\n\nmessageActionChatCreate#a6638b9a title:string users:Vector<int> = MessageAction;\n\nmessageActionChatEditTitle#b5a1ce5a title:string = MessageAction;\n\nmessageActionChatEditPhoto#7fcb13a8 photo:Photo = MessageAction;\n\nmessageActionChatDeletePhoto#95e3fbef = MessageAction;\n\nmessageActionChatAddUser#488a7337 users:Vector<int> = MessageAction;\n\nmessageActionChatDeleteUser#b2ae9b0c user_id:int = MessageAction;\n\nmessageActionChatJoinedByLink#f89cf5e8 inviter_id:int = MessageAction;\n\nmessageActionChannelCreate#95d2ac92 title:string = MessageAction;\n\nmessageActionChatMigrateTo#51bdb021 channel_id:int = MessageAction;\n\nmessageActionChannelMigrateFrom#b055eaee title:string chat_id:int = MessageAction;\n\nmessageActionPinMessage#94bd38ed = MessageAction;\n\nmessageActionHistoryClear#9fbab604 = MessageAction;\n\nmessageActionGameScore#92a72876 game_id:long score:int = MessageAction;\n\nmessageActionPaymentSentMe#8f31b327 flags:# currency:string total_amount:long payload:bytes info:flags.0?PaymentRequestedInfo shipping_option_id:flags.1?string charge:PaymentCharge = MessageAction;\n\nmessageActionPaymentSent#40699cd0 currency:string total_amount:long = MessageAction;\n\nmessageActionPhoneCall#80e11a7f flags:# call_id:long reason:flags.0?PhoneCallDiscardReason duration:flags.1?int = MessageAction;\n\nmessageActionScreenshotTaken#4792929b = MessageAction;\n\nmessageActionCustomAction#fae69f56 message:string = MessageAction;\n```\n" ] pub enum MessageAction { Empty , ChatCreate ( :: mtproto :: message_action :: ChatCreate ) , ChatEditTitle ( :: mtproto :: message_action :: ChatEditTitle ) , ChatEditPhoto ( :: mtproto :: message_action :: ChatEditPhoto ) , ChatDeletePhoto , ChatAddUser ( :: mtproto :: message_action :: ChatAddUser ) , ChatDeleteUser ( :: mtproto :: message_action :: ChatDeleteUser ) , ChatJoinedByLink ( :: mtproto :: message_action :: ChatJoinedByLink ) , ChannelCreate ( :: mtproto :: message_action :: ChannelCreate ) , ChatMigrateTo ( :: mtproto :: message_action :: ChatMigrateTo ) , ChannelMigrateFrom ( :: mtproto :: message_action :: ChannelMigrateFrom ) , PinMessage , HistoryClear , GameScore ( :: mtproto :: message_action :: GameScore ) , PaymentSentMe ( :: mtproto :: message_action :: PaymentSentMe ) , PaymentSent ( :: mtproto :: message_action :: PaymentSent ) , PhoneCall ( :: mtproto :: message_action :: PhoneCall ) , ScreenshotTaken , CustomAction ( :: mtproto :: message_action :: CustomAction ) , } impl MessageAction { pub fn call_id ( & self ) -> Option < & :: mtproto :: long > { match self { & MessageAction :: PhoneCall ( ref x ) => Some ( & x . call_id ) , _ => None } } pub fn channel_id ( & self ) -> Option < & :: mtproto :: int > { match self { & MessageAction :: ChatMigrateTo ( ref x ) => Some ( & x . channel_id ) , _ => None } } pub fn charge ( & self ) -> Option < & :: mtproto :: PaymentCharge > { match self { & MessageAction :: PaymentSentMe ( ref x ) => Some ( & x . charge ) , _ => None } } pub fn chat_id ( & self ) -> Option < & :: mtproto :: int > { match self { & MessageAction :: ChannelMigrateFrom ( ref x ) => Some ( & x . chat_id ) , _ => None } } pub fn currency ( & self ) -> Option < & :: mtproto :: string > { match self { & MessageAction :: PaymentSentMe ( ref x ) => Some ( & x . currency ) , & MessageAction :: PaymentSent ( ref x ) => Some ( & x . currency ) , _ => None } } pub fn duration ( & self ) -> Option < & :: mtproto :: int > { match self { & MessageAction :: PhoneCall ( ref x ) => x . duration . as_ref ( ) , _ => None } } pub fn game_id ( & self ) -> Option < & :: mtproto :: long > { match self { & MessageAction :: GameScore ( ref x ) => Some ( & x . game_id ) , _ => None } } pub fn info ( & self ) -> Option < & :: mtproto :: PaymentRequestedInfo > { match self { & MessageAction :: PaymentSentMe ( ref x ) => x . info . as_ref ( ) , _ => None } } pub fn inviter_id ( & self ) -> Option < & :: mtproto :: int > { match self { & MessageAction :: ChatJoinedByLink ( ref x ) => Some ( & x . inviter_id ) , _ => None } } pub fn message ( & self ) -> Option < & :: mtproto :: string > { match self { & MessageAction :: CustomAction ( ref x ) => Some ( & x . message ) , _ => None } } pub fn payload ( & self ) -> Option < & :: mtproto :: bytes > { match self { & MessageAction :: PaymentSentMe ( ref x ) => Some ( & x . payload ) , _ => None } } pub fn photo ( & self ) -> Option < & :: mtproto :: Photo > { match self { & MessageAction :: ChatEditPhoto ( ref x ) => Some ( & x . photo ) , _ => None } } pub fn reason ( & self ) -> Option < & :: mtproto :: PhoneCallDiscardReason > { match self { & MessageAction :: PhoneCall ( ref x ) => x . reason . as_ref ( ) , _ => None } } pub fn score ( & self ) -> Option < & :: mtproto :: int > { match self { & MessageAction :: GameScore ( ref x ) => Some ( & x . score ) , _ => None } } pub fn shipping_option_id ( & self ) -> Option < & :: mtproto :: string > { match self { & MessageAction :: PaymentSentMe ( ref x ) => x . shipping_option_id . as_ref ( ) , _ => None } } pub fn title ( & self ) -> Option < & :: mtproto :: string > { match self { & MessageAction :: ChatEditTitle ( ref x ) => Some ( & x . title ) , & MessageAction :: ChannelMigrateFrom ( ref x ) => Some ( & x . title ) , & MessageAction :: ChatCreate ( ref x ) => Some ( & x . title ) , & MessageAction :: ChannelCreate ( ref x ) => Some ( & x . title ) , _ => None } } pub fn total_amount ( & self ) -> Option < & :: mtproto :: long > { match self { & MessageAction :: PaymentSent ( ref x ) => Some ( & x . total_amount ) , & MessageAction :: PaymentSentMe ( ref x ) => Some ( & x . total_amount ) , _ => None } } pub fn user_id ( & self ) -> Option < & :: mtproto :: int > { match self { & MessageAction :: ChatDeleteUser ( ref x ) => Some ( & x . user_id ) , _ => None } } pub fn users ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > > { match self { & MessageAction :: ChatCreate ( ref x ) => Some ( & x . users ) , & MessageAction :: ChatAddUser ( ref x ) => Some ( & x . users ) , _ => None } } } impl :: BoxedSerialize for MessageAction { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & MessageAction :: Empty => ( :: ConstructorNumber ( 0xb6aef7b0 ) , & ( ) ) , & MessageAction :: ChatCreate ( ref x ) => ( :: ConstructorNumber ( 0xa6638b9a ) , x ) , & MessageAction :: ChatEditTitle ( ref x ) => ( :: ConstructorNumber ( 0xb5a1ce5a ) , x ) , & MessageAction :: ChatEditPhoto ( ref x ) => ( :: ConstructorNumber ( 0x7fcb13a8 ) , x ) , & MessageAction :: ChatDeletePhoto => ( :: ConstructorNumber ( 0x95e3fbef ) , & ( ) ) , & MessageAction :: ChatAddUser ( ref x ) => ( :: ConstructorNumber ( 0x488a7337 ) , x ) , & MessageAction :: ChatDeleteUser ( ref x ) => ( :: ConstructorNumber ( 0xb2ae9b0c ) , x ) , & MessageAction :: ChatJoinedByLink ( ref x ) => ( :: ConstructorNumber ( 0xf89cf5e8 ) , x ) , & MessageAction :: ChannelCreate ( ref x ) => ( :: ConstructorNumber ( 0x95d2ac92 ) , x ) , & MessageAction :: ChatMigrateTo ( ref x ) => ( :: ConstructorNumber ( 0x51bdb021 ) , x ) , & MessageAction :: ChannelMigrateFrom ( ref x ) => ( :: ConstructorNumber ( 0xb055eaee ) , x ) , & MessageAction :: PinMessage => ( :: ConstructorNumber ( 0x94bd38ed ) , & ( ) ) , & MessageAction :: HistoryClear => ( :: ConstructorNumber ( 0x9fbab604 ) , & ( ) ) , & MessageAction :: GameScore ( ref x ) => ( :: ConstructorNumber ( 0x92a72876 ) , x ) , & MessageAction :: PaymentSentMe ( ref x ) => ( :: ConstructorNumber ( 0x8f31b327 ) , x ) , & MessageAction :: PaymentSent ( ref x ) => ( :: ConstructorNumber ( 0x40699cd0 ) , x ) , & MessageAction :: PhoneCall ( ref x ) => ( :: ConstructorNumber ( 0x80e11a7f ) , x ) , & MessageAction :: ScreenshotTaken => ( :: ConstructorNumber ( 0x4792929b ) , & ( ) ) , & MessageAction :: CustomAction ( ref x ) => ( :: ConstructorNumber ( 0xfae69f56 ) , x ) , } } } impl :: BoxedDeserialize for MessageAction { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xb6aef7b0 ) , :: ConstructorNumber ( 0xa6638b9a ) , :: ConstructorNumber ( 0xb5a1ce5a ) , :: ConstructorNumber ( 0x7fcb13a8 ) , :: ConstructorNumber ( 0x95e3fbef ) , :: ConstructorNumber ( 0x488a7337 ) , :: ConstructorNumber ( 0xb2ae9b0c ) , :: ConstructorNumber ( 0xf89cf5e8 ) , :: ConstructorNumber ( 0x95d2ac92 ) , :: ConstructorNumber ( 0x51bdb021 ) , :: ConstructorNumber ( 0xb055eaee ) , :: ConstructorNumber ( 0x94bd38ed ) , :: ConstructorNumber ( 0x9fbab604 ) , :: ConstructorNumber ( 0x92a72876 ) , :: ConstructorNumber ( 0x8f31b327 ) , :: ConstructorNumber ( 0x40699cd0 ) , :: ConstructorNumber ( 0x80e11a7f ) , :: ConstructorNumber ( 0x4792929b ) , :: ConstructorNumber ( 0xfae69f56 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xb6aef7b0 ) => Ok ( MessageAction :: Empty ) , :: ConstructorNumber ( 0xa6638b9a ) => Ok ( MessageAction :: ChatCreate ( _de . read_bare :: < :: mtproto :: message_action :: ChatCreate > ( ) ? ) ) , :: ConstructorNumber ( 0xb5a1ce5a ) => Ok ( MessageAction :: ChatEditTitle ( _de . read_bare :: < :: mtproto :: message_action :: ChatEditTitle > ( ) ? ) ) , :: ConstructorNumber ( 0x7fcb13a8 ) => Ok ( MessageAction :: ChatEditPhoto ( _de . read_bare :: < :: mtproto :: message_action :: ChatEditPhoto > ( ) ? ) ) , :: ConstructorNumber ( 0x95e3fbef ) => Ok ( MessageAction :: ChatDeletePhoto ) , :: ConstructorNumber ( 0x488a7337 ) => Ok ( MessageAction :: ChatAddUser ( _de . read_bare :: < :: mtproto :: message_action :: ChatAddUser > ( ) ? ) ) , :: ConstructorNumber ( 0xb2ae9b0c ) => Ok ( MessageAction :: ChatDeleteUser ( _de . read_bare :: < :: mtproto :: message_action :: ChatDeleteUser > ( ) ? ) ) , :: ConstructorNumber ( 0xf89cf5e8 ) => Ok ( MessageAction :: ChatJoinedByLink ( _de . read_bare :: < :: mtproto :: message_action :: ChatJoinedByLink > ( ) ? ) ) , :: ConstructorNumber ( 0x95d2ac92 ) => Ok ( MessageAction :: ChannelCreate ( _de . read_bare :: < :: mtproto :: message_action :: ChannelCreate > ( ) ? ) ) , :: ConstructorNumber ( 0x51bdb021 ) => Ok ( MessageAction :: ChatMigrateTo ( _de . read_bare :: < :: mtproto :: message_action :: ChatMigrateTo > ( ) ? ) ) , :: ConstructorNumber ( 0xb055eaee ) => Ok ( MessageAction :: ChannelMigrateFrom ( _de . read_bare :: < :: mtproto :: message_action :: ChannelMigrateFrom > ( ) ? ) ) , :: ConstructorNumber ( 0x94bd38ed ) => Ok ( MessageAction :: PinMessage ) , :: ConstructorNumber ( 0x9fbab604 ) => Ok ( MessageAction :: HistoryClear ) , :: ConstructorNumber ( 0x92a72876 ) => Ok ( MessageAction :: GameScore ( _de . read_bare :: < :: mtproto :: message_action :: GameScore > ( ) ? ) ) , :: ConstructorNumber ( 0x8f31b327 ) => Ok ( MessageAction :: PaymentSentMe ( _de . read_bare :: < :: mtproto :: message_action :: PaymentSentMe > ( ) ? ) ) , :: ConstructorNumber ( 0x40699cd0 ) => Ok ( MessageAction :: PaymentSent ( _de . read_bare :: < :: mtproto :: message_action :: PaymentSent > ( ) ? ) ) , :: ConstructorNumber ( 0x80e11a7f ) => Ok ( MessageAction :: PhoneCall ( _de . read_bare :: < :: mtproto :: message_action :: PhoneCall > ( ) ? ) ) , :: ConstructorNumber ( 0x4792929b ) => Ok ( MessageAction :: ScreenshotTaken ) , :: ConstructorNumber ( 0xfae69f56 ) => Ok ( MessageAction :: CustomAction ( _de . read_bare :: < :: mtproto :: message_action :: CustomAction > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `MessageEntity`\n\n```text\nmessageEntityUnknown#bb92ba95 offset:int length:int = MessageEntity;\n\nmessageEntityMention#fa04579d offset:int length:int = MessageEntity;\n\nmessageEntityHashtag#6f635b0d offset:int length:int = MessageEntity;\n\nmessageEntityBotCommand#6cef8ac7 offset:int length:int = MessageEntity;\n\nmessageEntityUrl#6ed02538 offset:int length:int = MessageEntity;\n\nmessageEntityEmail#64e475c2 offset:int length:int = MessageEntity;\n\nmessageEntityBold#bd610bc9 offset:int length:int = MessageEntity;\n\nmessageEntityItalic#826f8b60 offset:int length:int = MessageEntity;\n\nmessageEntityCode#28a20571 offset:int length:int = MessageEntity;\n\nmessageEntityPre#73924be0 offset:int length:int language:string = MessageEntity;\n\nmessageEntityTextUrl#76a6d327 offset:int length:int url:string = MessageEntity;\n\nmessageEntityMentionName#352dca58 offset:int length:int user_id:int = MessageEntity;\n\ninputMessageEntityMentionName#208e68c9 offset:int length:int user_id:InputUser = MessageEntity;\n```\n" ] pub enum MessageEntity { MessageEntityUnknown ( :: mtproto :: message_entity :: MessageEntityUnknown ) , MessageEntityMention ( :: mtproto :: message_entity :: MessageEntityMention ) , MessageEntityHashtag ( :: mtproto :: message_entity :: MessageEntityHashtag ) , MessageEntityBotCommand ( :: mtproto :: message_entity :: MessageEntityBotCommand ) , MessageEntityUrl ( :: mtproto :: message_entity :: MessageEntityUrl ) , MessageEntityEmail ( :: mtproto :: message_entity :: MessageEntityEmail ) , MessageEntityBold ( :: mtproto :: message_entity :: MessageEntityBold ) , MessageEntityItalic ( :: mtproto :: message_entity :: MessageEntityItalic ) , MessageEntityCode ( :: mtproto :: message_entity :: MessageEntityCode ) , MessageEntityPre ( :: mtproto :: message_entity :: MessageEntityPre ) , MessageEntityTextUrl ( :: mtproto :: message_entity :: MessageEntityTextUrl ) , MessageEntityMentionName ( :: mtproto :: message_entity :: MessageEntityMentionName ) , InputMessageEntityMentionName ( :: mtproto :: message_entity :: InputMessageEntityMentionName ) , } impl MessageEntity { pub fn language ( & self ) -> Option < & :: mtproto :: string > { match self { & MessageEntity :: MessageEntityPre ( ref x ) => Some ( & x . language ) , _ => None } } pub fn length ( & self ) -> & :: mtproto :: int { match self { & MessageEntity :: MessageEntityMention ( ref x ) => & x . length , & MessageEntity :: MessageEntityUnknown ( ref x ) => & x . length , & MessageEntity :: MessageEntityPre ( ref x ) => & x . length , & MessageEntity :: MessageEntityItalic ( ref x ) => & x . length , & MessageEntity :: MessageEntityHashtag ( ref x ) => & x . length , & MessageEntity :: MessageEntityEmail ( ref x ) => & x . length , & MessageEntity :: MessageEntityBotCommand ( ref x ) => & x . length , & MessageEntity :: MessageEntityCode ( ref x ) => & x . length , & MessageEntity :: MessageEntityMentionName ( ref x ) => & x . length , & MessageEntity :: MessageEntityTextUrl ( ref x ) => & x . length , & MessageEntity :: InputMessageEntityMentionName ( ref x ) => & x . length , & MessageEntity :: MessageEntityUrl ( ref x ) => & x . length , & MessageEntity :: MessageEntityBold ( ref x ) => & x . length , } } pub fn offset ( & self ) -> & :: mtproto :: int { match self { & MessageEntity :: MessageEntityHashtag ( ref x ) => & x . offset , & MessageEntity :: MessageEntityItalic ( ref x ) => & x . offset , & MessageEntity :: MessageEntityMentionName ( ref x ) => & x . offset , & MessageEntity :: InputMessageEntityMentionName ( ref x ) => & x . offset , & MessageEntity :: MessageEntityEmail ( ref x ) => & x . offset , & MessageEntity :: MessageEntityBotCommand ( ref x ) => & x . offset , & MessageEntity :: MessageEntityUrl ( ref x ) => & x . offset , & MessageEntity :: MessageEntityBold ( ref x ) => & x . offset , & MessageEntity :: MessageEntityCode ( ref x ) => & x . offset , & MessageEntity :: MessageEntityTextUrl ( ref x ) => & x . offset , & MessageEntity :: MessageEntityMention ( ref x ) => & x . offset , & MessageEntity :: MessageEntityPre ( ref x ) => & x . offset , & MessageEntity :: MessageEntityUnknown ( ref x ) => & x . offset , } } pub fn url ( & self ) -> Option < & :: mtproto :: string > { match self { & MessageEntity :: MessageEntityTextUrl ( ref x ) => Some ( & x . url ) , _ => None } } } impl :: BoxedSerialize for MessageEntity { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & MessageEntity :: MessageEntityUnknown ( ref x ) => ( :: ConstructorNumber ( 0xbb92ba95 ) , x ) , & MessageEntity :: MessageEntityMention ( ref x ) => ( :: ConstructorNumber ( 0xfa04579d ) , x ) , & MessageEntity :: MessageEntityHashtag ( ref x ) => ( :: ConstructorNumber ( 0x6f635b0d ) , x ) , & MessageEntity :: MessageEntityBotCommand ( ref x ) => ( :: ConstructorNumber ( 0x6cef8ac7 ) , x ) , & MessageEntity :: MessageEntityUrl ( ref x ) => ( :: ConstructorNumber ( 0x6ed02538 ) , x ) , & MessageEntity :: MessageEntityEmail ( ref x ) => ( :: ConstructorNumber ( 0x64e475c2 ) , x ) , & MessageEntity :: MessageEntityBold ( ref x ) => ( :: ConstructorNumber ( 0xbd610bc9 ) , x ) , & MessageEntity :: MessageEntityItalic ( ref x ) => ( :: ConstructorNumber ( 0x826f8b60 ) , x ) , & MessageEntity :: MessageEntityCode ( ref x ) => ( :: ConstructorNumber ( 0x28a20571 ) , x ) , & MessageEntity :: MessageEntityPre ( ref x ) => ( :: ConstructorNumber ( 0x73924be0 ) , x ) , & MessageEntity :: MessageEntityTextUrl ( ref x ) => ( :: ConstructorNumber ( 0x76a6d327 ) , x ) , & MessageEntity :: MessageEntityMentionName ( ref x ) => ( :: ConstructorNumber ( 0x352dca58 ) , x ) , & MessageEntity :: InputMessageEntityMentionName ( ref x ) => ( :: ConstructorNumber ( 0x208e68c9 ) , x ) , } } } impl :: BoxedDeserialize for MessageEntity { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xbb92ba95 ) , :: ConstructorNumber ( 0xfa04579d ) , :: ConstructorNumber ( 0x6f635b0d ) , :: ConstructorNumber ( 0x6cef8ac7 ) , :: ConstructorNumber ( 0x6ed02538 ) , :: ConstructorNumber ( 0x64e475c2 ) , :: ConstructorNumber ( 0xbd610bc9 ) , :: ConstructorNumber ( 0x826f8b60 ) , :: ConstructorNumber ( 0x28a20571 ) , :: ConstructorNumber ( 0x73924be0 ) , :: ConstructorNumber ( 0x76a6d327 ) , :: ConstructorNumber ( 0x352dca58 ) , :: ConstructorNumber ( 0x208e68c9 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xbb92ba95 ) => Ok ( MessageEntity :: MessageEntityUnknown ( _de . read_bare :: < :: mtproto :: message_entity :: MessageEntityUnknown > ( ) ? ) ) , :: ConstructorNumber ( 0xfa04579d ) => Ok ( MessageEntity :: MessageEntityMention ( _de . read_bare :: < :: mtproto :: message_entity :: MessageEntityMention > ( ) ? ) ) , :: ConstructorNumber ( 0x6f635b0d ) => Ok ( MessageEntity :: MessageEntityHashtag ( _de . read_bare :: < :: mtproto :: message_entity :: MessageEntityHashtag > ( ) ? ) ) , :: ConstructorNumber ( 0x6cef8ac7 ) => Ok ( MessageEntity :: MessageEntityBotCommand ( _de . read_bare :: < :: mtproto :: message_entity :: MessageEntityBotCommand > ( ) ? ) ) , :: ConstructorNumber ( 0x6ed02538 ) => Ok ( MessageEntity :: MessageEntityUrl ( _de . read_bare :: < :: mtproto :: message_entity :: MessageEntityUrl > ( ) ? ) ) , :: ConstructorNumber ( 0x64e475c2 ) => Ok ( MessageEntity :: MessageEntityEmail ( _de . read_bare :: < :: mtproto :: message_entity :: MessageEntityEmail > ( ) ? ) ) , :: ConstructorNumber ( 0xbd610bc9 ) => Ok ( MessageEntity :: MessageEntityBold ( _de . read_bare :: < :: mtproto :: message_entity :: MessageEntityBold > ( ) ? ) ) , :: ConstructorNumber ( 0x826f8b60 ) => Ok ( MessageEntity :: MessageEntityItalic ( _de . read_bare :: < :: mtproto :: message_entity :: MessageEntityItalic > ( ) ? ) ) , :: ConstructorNumber ( 0x28a20571 ) => Ok ( MessageEntity :: MessageEntityCode ( _de . read_bare :: < :: mtproto :: message_entity :: MessageEntityCode > ( ) ? ) ) , :: ConstructorNumber ( 0x73924be0 ) => Ok ( MessageEntity :: MessageEntityPre ( _de . read_bare :: < :: mtproto :: message_entity :: MessageEntityPre > ( ) ? ) ) , :: ConstructorNumber ( 0x76a6d327 ) => Ok ( MessageEntity :: MessageEntityTextUrl ( _de . read_bare :: < :: mtproto :: message_entity :: MessageEntityTextUrl > ( ) ? ) ) , :: ConstructorNumber ( 0x352dca58 ) => Ok ( MessageEntity :: MessageEntityMentionName ( _de . read_bare :: < :: mtproto :: message_entity :: MessageEntityMentionName > ( ) ? ) ) , :: ConstructorNumber ( 0x208e68c9 ) => Ok ( MessageEntity :: InputMessageEntityMentionName ( _de . read_bare :: < :: mtproto :: message_entity :: InputMessageEntityMentionName > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `MessageFwdHeader`\n\n```text\nmessageFwdHeader#559ebe6d flags:# from_id:flags.0?int date:int channel_id:flags.1?int channel_post:flags.2?int post_author:flags.3?string saved_from_peer:flags.4?Peer saved_from_msg_id:flags.4?int = MessageFwdHeader;\n```\n" ] pub enum MessageFwdHeader { MessageFwdHeader ( :: mtproto :: message_fwd_header :: MessageFwdHeader ) , } impl MessageFwdHeader { pub fn channel_id ( & self ) -> Option < & :: mtproto :: int > { match self { & MessageFwdHeader :: MessageFwdHeader ( ref x ) => x . channel_id . as_ref ( ) , } } pub fn channel_post ( & self ) -> Option < & :: mtproto :: int > { match self { & MessageFwdHeader :: MessageFwdHeader ( ref x ) => x . channel_post . as_ref ( ) , } } pub fn date ( & self ) -> & :: mtproto :: int { match self { & MessageFwdHeader :: MessageFwdHeader ( ref x ) => & x . date , } } pub fn from_id ( & self ) -> Option < & :: mtproto :: int > { match self { & MessageFwdHeader :: MessageFwdHeader ( ref x ) => x . from_id . as_ref ( ) , } } pub fn post_author ( & self ) -> Option < & :: mtproto :: string > { match self { & MessageFwdHeader :: MessageFwdHeader ( ref x ) => x . post_author . as_ref ( ) , } } pub fn saved_from_msg_id ( & self ) -> Option < & :: mtproto :: int > { match self { & MessageFwdHeader :: MessageFwdHeader ( ref x ) => x . saved_from_msg_id . as_ref ( ) , } } pub fn saved_from_peer ( & self ) -> Option < & :: mtproto :: Peer > { match self { & MessageFwdHeader :: MessageFwdHeader ( ref x ) => x . saved_from_peer . as_ref ( ) , } } } impl :: BoxedSerialize for MessageFwdHeader { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & MessageFwdHeader :: MessageFwdHeader ( ref x ) => ( :: ConstructorNumber ( 0x559ebe6d ) , x ) , } } } impl :: BoxedDeserialize for MessageFwdHeader { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x559ebe6d ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x559ebe6d ) => Ok ( MessageFwdHeader :: MessageFwdHeader ( _de . read_bare :: < :: mtproto :: message_fwd_header :: MessageFwdHeader > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `MessageMedia`\n\n```text\nmessageMediaEmpty#3ded6320 = MessageMedia;\n\nmessageMediaPhoto#b5223b0f flags:# photo:flags.0?Photo caption:flags.1?string ttl_seconds:flags.2?int = MessageMedia;\n\nmessageMediaGeo#56e0d474 geo:GeoPoint = MessageMedia;\n\nmessageMediaContact#5e7d2f39 phone_number:string first_name:string last_name:string user_id:int = MessageMedia;\n\nmessageMediaUnsupported#9f84f49e = MessageMedia;\n\nmessageMediaDocument#7c4414d3 flags:# document:flags.0?Document caption:flags.1?string ttl_seconds:flags.2?int = MessageMedia;\n\nmessageMediaWebPage#a32dd600 webpage:WebPage = MessageMedia;\n\nmessageMediaVenue#2ec0533f geo:GeoPoint title:string address:string provider:string venue_id:string venue_type:string = MessageMedia;\n\nmessageMediaGame#fdb19008 game:Game = MessageMedia;\n\nmessageMediaInvoice#84551347 flags:# shipping_address_requested:flags.1?true test:flags.3?true title:string description:string photo:flags.0?WebDocument receipt_msg_id:flags.2?int currency:string total_amount:long start_param:string = MessageMedia;\n\nmessageMediaGeoLive#7c3c2609 geo:GeoPoint period:int = MessageMedia;\n```\n" ] pub enum MessageMedia { Empty , Photo ( :: mtproto :: message_media :: Photo ) , Geo ( :: mtproto :: message_media :: Geo ) , Contact ( :: mtproto :: message_media :: Contact ) , Unsupported , Document ( :: mtproto :: message_media :: Document ) , WebPage ( :: mtproto :: message_media :: WebPage ) , Venue ( :: mtproto :: message_media :: Venue ) , Game ( :: mtproto :: message_media :: Game ) , Invoice ( :: mtproto :: message_media :: Invoice ) , GeoLive ( :: mtproto :: message_media :: GeoLive ) , } impl MessageMedia { pub fn address ( & self ) -> Option < & :: mtproto :: string > { match self { & MessageMedia :: Venue ( ref x ) => Some ( & x . address ) , _ => None } } pub fn caption ( & self ) -> Option < & :: mtproto :: string > { match self { & MessageMedia :: Photo ( ref x ) => x . caption . as_ref ( ) , & MessageMedia :: Document ( ref x ) => x . caption . as_ref ( ) , _ => None } } pub fn currency ( & self ) -> Option < & :: mtproto :: string > { match self { & MessageMedia :: Invoice ( ref x ) => Some ( & x . currency ) , _ => None } } pub fn description ( & self ) -> Option < & :: mtproto :: string > { match self { & MessageMedia :: Invoice ( ref x ) => Some ( & x . description ) , _ => None } } pub fn document ( & self ) -> Option < & :: mtproto :: Document > { match self { & MessageMedia :: Document ( ref x ) => x . document . as_ref ( ) , _ => None } } pub fn first_name ( & self ) -> Option < & :: mtproto :: string > { match self { & MessageMedia :: Contact ( ref x ) => Some ( & x . first_name ) , _ => None } } pub fn game ( & self ) -> Option < & :: mtproto :: Game > { match self { & MessageMedia :: Game ( ref x ) => Some ( & x . game ) , _ => None } } pub fn geo ( & self ) -> Option < & :: mtproto :: GeoPoint > { match self { & MessageMedia :: GeoLive ( ref x ) => Some ( & x . geo ) , & MessageMedia :: Geo ( ref x ) => Some ( & x . geo ) , & MessageMedia :: Venue ( ref x ) => Some ( & x . geo ) , _ => None } } pub fn last_name ( & self ) -> Option < & :: mtproto :: string > { match self { & MessageMedia :: Contact ( ref x ) => Some ( & x . last_name ) , _ => None } } pub fn period ( & self ) -> Option < & :: mtproto :: int > { match self { & MessageMedia :: GeoLive ( ref x ) => Some ( & x . period ) , _ => None } } pub fn phone_number ( & self ) -> Option < & :: mtproto :: string > { match self { & MessageMedia :: Contact ( ref x ) => Some ( & x . phone_number ) , _ => None } } pub fn provider ( & self ) -> Option < & :: mtproto :: string > { match self { & MessageMedia :: Venue ( ref x ) => Some ( & x . provider ) , _ => None } } pub fn receipt_msg_id ( & self ) -> Option < & :: mtproto :: int > { match self { & MessageMedia :: Invoice ( ref x ) => x . receipt_msg_id . as_ref ( ) , _ => None } } pub fn shipping_address_requested ( & self ) -> Option < bool > { match self { & MessageMedia :: Invoice ( ref x ) => Some ( x . shipping_address_requested ) , _ => None } } pub fn start_param ( & self ) -> Option < & :: mtproto :: string > { match self { & MessageMedia :: Invoice ( ref x ) => Some ( & x . start_param ) , _ => None } } pub fn test ( & self ) -> Option < bool > { match self { & MessageMedia :: Invoice ( ref x ) => Some ( x . test ) , _ => None } } pub fn title ( & self ) -> Option < & :: mtproto :: string > { match self { & MessageMedia :: Venue ( ref x ) => Some ( & x . title ) , & MessageMedia :: Invoice ( ref x ) => Some ( & x . title ) , _ => None } } pub fn total_amount ( & self ) -> Option < & :: mtproto :: long > { match self { & MessageMedia :: Invoice ( ref x ) => Some ( & x . total_amount ) , _ => None } } pub fn ttl_seconds ( & self ) -> Option < & :: mtproto :: int > { match self { & MessageMedia :: Document ( ref x ) => x . ttl_seconds . as_ref ( ) , & MessageMedia :: Photo ( ref x ) => x . ttl_seconds . as_ref ( ) , _ => None } } pub fn user_id ( & self ) -> Option < & :: mtproto :: int > { match self { & MessageMedia :: Contact ( ref x ) => Some ( & x . user_id ) , _ => None } } pub fn venue_id ( & self ) -> Option < & :: mtproto :: string > { match self { & MessageMedia :: Venue ( ref x ) => Some ( & x . venue_id ) , _ => None } } pub fn venue_type ( & self ) -> Option < & :: mtproto :: string > { match self { & MessageMedia :: Venue ( ref x ) => Some ( & x . venue_type ) , _ => None } } pub fn webpage ( & self ) -> Option < & :: mtproto :: WebPage > { match self { & MessageMedia :: WebPage ( ref x ) => Some ( & x . webpage ) , _ => None } } } impl :: BoxedSerialize for MessageMedia { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & MessageMedia :: Empty => ( :: ConstructorNumber ( 0x3ded6320 ) , & ( ) ) , & MessageMedia :: Photo ( ref x ) => ( :: ConstructorNumber ( 0xb5223b0f ) , x ) , & MessageMedia :: Geo ( ref x ) => ( :: ConstructorNumber ( 0x56e0d474 ) , x ) , & MessageMedia :: Contact ( ref x ) => ( :: ConstructorNumber ( 0x5e7d2f39 ) , x ) , & MessageMedia :: Unsupported => ( :: ConstructorNumber ( 0x9f84f49e ) , & ( ) ) , & MessageMedia :: Document ( ref x ) => ( :: ConstructorNumber ( 0x7c4414d3 ) , x ) , & MessageMedia :: WebPage ( ref x ) => ( :: ConstructorNumber ( 0xa32dd600 ) , x ) , & MessageMedia :: Venue ( ref x ) => ( :: ConstructorNumber ( 0x2ec0533f ) , x ) , & MessageMedia :: Game ( ref x ) => ( :: ConstructorNumber ( 0xfdb19008 ) , x ) , & MessageMedia :: Invoice ( ref x ) => ( :: ConstructorNumber ( 0x84551347 ) , x ) , & MessageMedia :: GeoLive ( ref x ) => ( :: ConstructorNumber ( 0x7c3c2609 ) , x ) , } } } impl :: BoxedDeserialize for MessageMedia { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x3ded6320 ) , :: ConstructorNumber ( 0xb5223b0f ) , :: ConstructorNumber ( 0x56e0d474 ) , :: ConstructorNumber ( 0x5e7d2f39 ) , :: ConstructorNumber ( 0x9f84f49e ) , :: ConstructorNumber ( 0x7c4414d3 ) , :: ConstructorNumber ( 0xa32dd600 ) , :: ConstructorNumber ( 0x2ec0533f ) , :: ConstructorNumber ( 0xfdb19008 ) , :: ConstructorNumber ( 0x84551347 ) , :: ConstructorNumber ( 0x7c3c2609 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x3ded6320 ) => Ok ( MessageMedia :: Empty ) , :: ConstructorNumber ( 0xb5223b0f ) => Ok ( MessageMedia :: Photo ( _de . read_bare :: < :: mtproto :: message_media :: Photo > ( ) ? ) ) , :: ConstructorNumber ( 0x56e0d474 ) => Ok ( MessageMedia :: Geo ( _de . read_bare :: < :: mtproto :: message_media :: Geo > ( ) ? ) ) , :: ConstructorNumber ( 0x5e7d2f39 ) => Ok ( MessageMedia :: Contact ( _de . read_bare :: < :: mtproto :: message_media :: Contact > ( ) ? ) ) , :: ConstructorNumber ( 0x9f84f49e ) => Ok ( MessageMedia :: Unsupported ) , :: ConstructorNumber ( 0x7c4414d3 ) => Ok ( MessageMedia :: Document ( _de . read_bare :: < :: mtproto :: message_media :: Document > ( ) ? ) ) , :: ConstructorNumber ( 0xa32dd600 ) => Ok ( MessageMedia :: WebPage ( _de . read_bare :: < :: mtproto :: message_media :: WebPage > ( ) ? ) ) , :: ConstructorNumber ( 0x2ec0533f ) => Ok ( MessageMedia :: Venue ( _de . read_bare :: < :: mtproto :: message_media :: Venue > ( ) ? ) ) , :: ConstructorNumber ( 0xfdb19008 ) => Ok ( MessageMedia :: Game ( _de . read_bare :: < :: mtproto :: message_media :: Game > ( ) ? ) ) , :: ConstructorNumber ( 0x84551347 ) => Ok ( MessageMedia :: Invoice ( _de . read_bare :: < :: mtproto :: message_media :: Invoice > ( ) ? ) ) , :: ConstructorNumber ( 0x7c3c2609 ) => Ok ( MessageMedia :: GeoLive ( _de . read_bare :: < :: mtproto :: message_media :: GeoLive > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `MessageRange`\n\n```text\nmessageRange#ae30253 min_id:int max_id:int = MessageRange;\n```\n" ] pub enum MessageRange { MessageRange ( :: mtproto :: message_range :: MessageRange ) , } impl MessageRange { pub fn max_id ( & self ) -> & :: mtproto :: int { match self { & MessageRange :: MessageRange ( ref x ) => & x . max_id , } } pub fn min_id ( & self ) -> & :: mtproto :: int { match self { & MessageRange :: MessageRange ( ref x ) => & x . min_id , } } } impl :: BoxedSerialize for MessageRange { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & MessageRange :: MessageRange ( ref x ) => ( :: ConstructorNumber ( 0x0ae30253 ) , x ) , } } } impl :: BoxedDeserialize for MessageRange { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x0ae30253 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x0ae30253 ) => Ok ( MessageRange :: MessageRange ( _de . read_bare :: < :: mtproto :: message_range :: MessageRange > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `MessagesFilter`\n\n```text\ninputMessagesFilterEmpty#57e2f66c = MessagesFilter;\n\ninputMessagesFilterPhotos#9609a51c = MessagesFilter;\n\ninputMessagesFilterVideo#9fc00e65 = MessagesFilter;\n\ninputMessagesFilterPhotoVideo#56e9f0e4 = MessagesFilter;\n\ninputMessagesFilterDocument#9eddf188 = MessagesFilter;\n\ninputMessagesFilterUrl#7ef0dd87 = MessagesFilter;\n\ninputMessagesFilterGif#ffc86587 = MessagesFilter;\n\ninputMessagesFilterVoice#50f5c392 = MessagesFilter;\n\ninputMessagesFilterMusic#3751b49e = MessagesFilter;\n\ninputMessagesFilterChatPhotos#3a20ecb8 = MessagesFilter;\n\ninputMessagesFilterPhoneCalls#80c99768 flags:# missed:flags.0?true = MessagesFilter;\n\ninputMessagesFilterRoundVoice#7a7c17a4 = MessagesFilter;\n\ninputMessagesFilterRoundVideo#b549da53 = MessagesFilter;\n\ninputMessagesFilterMyMentions#c1f8e69a = MessagesFilter;\n\ninputMessagesFilterGeo#e7026d0d = MessagesFilter;\n\ninputMessagesFilterContacts#e062db83 = MessagesFilter;\n```\n" ] pub enum MessagesFilter { Empty , Photos , Video , PhotoVideo , Document , Url , Gif , Voice , Music , ChatPhotos , PhoneCalls ( :: mtproto :: input_messages_filter :: PhoneCalls ) , RoundVoice , RoundVideo , MyMentions , Geo , Contacts , } impl MessagesFilter { pub fn missed ( & self ) -> Option < bool > { match self { & MessagesFilter :: PhoneCalls ( ref x ) => Some ( x . missed ) , _ => None } } } impl :: BoxedSerialize for MessagesFilter { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & MessagesFilter :: Empty => ( :: ConstructorNumber ( 0x57e2f66c ) , & ( ) ) , & MessagesFilter :: Photos => ( :: ConstructorNumber ( 0x9609a51c ) , & ( ) ) , & MessagesFilter :: Video => ( :: ConstructorNumber ( 0x9fc00e65 ) , & ( ) ) , & MessagesFilter :: PhotoVideo => ( :: ConstructorNumber ( 0x56e9f0e4 ) , & ( ) ) , & MessagesFilter :: Document => ( :: ConstructorNumber ( 0x9eddf188 ) , & ( ) ) , & MessagesFilter :: Url => ( :: ConstructorNumber ( 0x7ef0dd87 ) , & ( ) ) , & MessagesFilter :: Gif => ( :: ConstructorNumber ( 0xffc86587 ) , & ( ) ) , & MessagesFilter :: Voice => ( :: ConstructorNumber ( 0x50f5c392 ) , & ( ) ) , & MessagesFilter :: Music => ( :: ConstructorNumber ( 0x3751b49e ) , & ( ) ) , & MessagesFilter :: ChatPhotos => ( :: ConstructorNumber ( 0x3a20ecb8 ) , & ( ) ) , & MessagesFilter :: PhoneCalls ( ref x ) => ( :: ConstructorNumber ( 0x80c99768 ) , x ) , & MessagesFilter :: RoundVoice => ( :: ConstructorNumber ( 0x7a7c17a4 ) , & ( ) ) , & MessagesFilter :: RoundVideo => ( :: ConstructorNumber ( 0xb549da53 ) , & ( ) ) , & MessagesFilter :: MyMentions => ( :: ConstructorNumber ( 0xc1f8e69a ) , & ( ) ) , & MessagesFilter :: Geo => ( :: ConstructorNumber ( 0xe7026d0d ) , & ( ) ) , & MessagesFilter :: Contacts => ( :: ConstructorNumber ( 0xe062db83 ) , & ( ) ) , } } } impl :: BoxedDeserialize for MessagesFilter { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x57e2f66c ) , :: ConstructorNumber ( 0x9609a51c ) , :: ConstructorNumber ( 0x9fc00e65 ) , :: ConstructorNumber ( 0x56e9f0e4 ) , :: ConstructorNumber ( 0x9eddf188 ) , :: ConstructorNumber ( 0x7ef0dd87 ) , :: ConstructorNumber ( 0xffc86587 ) , :: ConstructorNumber ( 0x50f5c392 ) , :: ConstructorNumber ( 0x3751b49e ) , :: ConstructorNumber ( 0x3a20ecb8 ) , :: ConstructorNumber ( 0x80c99768 ) , :: ConstructorNumber ( 0x7a7c17a4 ) , :: ConstructorNumber ( 0xb549da53 ) , :: ConstructorNumber ( 0xc1f8e69a ) , :: ConstructorNumber ( 0xe7026d0d ) , :: ConstructorNumber ( 0xe062db83 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x57e2f66c ) => Ok ( MessagesFilter :: Empty ) , :: ConstructorNumber ( 0x9609a51c ) => Ok ( MessagesFilter :: Photos ) , :: ConstructorNumber ( 0x9fc00e65 ) => Ok ( MessagesFilter :: Video ) , :: ConstructorNumber ( 0x56e9f0e4 ) => Ok ( MessagesFilter :: PhotoVideo ) , :: ConstructorNumber ( 0x9eddf188 ) => Ok ( MessagesFilter :: Document ) , :: ConstructorNumber ( 0x7ef0dd87 ) => Ok ( MessagesFilter :: Url ) , :: ConstructorNumber ( 0xffc86587 ) => Ok ( MessagesFilter :: Gif ) , :: ConstructorNumber ( 0x50f5c392 ) => Ok ( MessagesFilter :: Voice ) , :: ConstructorNumber ( 0x3751b49e ) => Ok ( MessagesFilter :: Music ) , :: ConstructorNumber ( 0x3a20ecb8 ) => Ok ( MessagesFilter :: ChatPhotos ) , :: ConstructorNumber ( 0x80c99768 ) => Ok ( MessagesFilter :: PhoneCalls ( _de . read_bare :: < :: mtproto :: input_messages_filter :: PhoneCalls > ( ) ? ) ) , :: ConstructorNumber ( 0x7a7c17a4 ) => Ok ( MessagesFilter :: RoundVoice ) , :: ConstructorNumber ( 0xb549da53 ) => Ok ( MessagesFilter :: RoundVideo ) , :: ConstructorNumber ( 0xc1f8e69a ) => Ok ( MessagesFilter :: MyMentions ) , :: ConstructorNumber ( 0xe7026d0d ) => Ok ( MessagesFilter :: Geo ) , :: ConstructorNumber ( 0xe062db83 ) => Ok ( MessagesFilter :: Contacts ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `MsgDetailedInfo`\n\n```text\nmsg_detailed_info#276d3ec6 msg_id:long answer_msg_id:long bytes:int status:int = MsgDetailedInfo;\n\nmsg_new_detailed_info#809db6df answer_msg_id:long bytes:int status:int = MsgDetailedInfo;\n```\n" ] pub enum MsgDetailedInfo { DetailedInfo ( :: mtproto :: msg :: DetailedInfo ) , NewDetailedInfo ( :: mtproto :: msg :: NewDetailedInfo ) , } impl MsgDetailedInfo { pub fn answer_msg_id ( & self ) -> & :: mtproto :: long { match self { & MsgDetailedInfo :: NewDetailedInfo ( ref x ) => & x . answer_msg_id , & MsgDetailedInfo :: DetailedInfo ( ref x ) => & x . answer_msg_id , } } pub fn bytes ( & self ) -> & :: mtproto :: int { match self { & MsgDetailedInfo :: DetailedInfo ( ref x ) => & x . bytes , & MsgDetailedInfo :: NewDetailedInfo ( ref x ) => & x . bytes , } } pub fn msg_id ( & self ) -> Option < & :: mtproto :: long > { match self { & MsgDetailedInfo :: DetailedInfo ( ref x ) => Some ( & x . msg_id ) , _ => None } } pub fn status ( & self ) -> & :: mtproto :: int { match self { & MsgDetailedInfo :: NewDetailedInfo ( ref x ) => & x . status , & MsgDetailedInfo :: DetailedInfo ( ref x ) => & x . status , } } } impl :: BoxedSerialize for MsgDetailedInfo { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & MsgDetailedInfo :: DetailedInfo ( ref x ) => ( :: ConstructorNumber ( 0x276d3ec6 ) , x ) , & MsgDetailedInfo :: NewDetailedInfo ( ref x ) => ( :: ConstructorNumber ( 0x809db6df ) , x ) , } } } impl :: BoxedDeserialize for MsgDetailedInfo { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x276d3ec6 ) , :: ConstructorNumber ( 0x809db6df ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x276d3ec6 ) => Ok ( MsgDetailedInfo :: DetailedInfo ( _de . read_bare :: < :: mtproto :: msg :: DetailedInfo > ( ) ? ) ) , :: ConstructorNumber ( 0x809db6df ) => Ok ( MsgDetailedInfo :: NewDetailedInfo ( _de . read_bare :: < :: mtproto :: msg :: NewDetailedInfo > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `MsgResendReq`\n\n```text\nmsg_resend_req#7d861a08 msg_ids:Vector<long> = MsgResendReq;\n```\n" ] pub enum MsgResendReq { MsgResendReq ( :: mtproto :: msg_resend_req :: MsgResendReq ) , } impl MsgResendReq { pub fn msg_ids ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > { match self { & MsgResendReq :: MsgResendReq ( ref x ) => & x . msg_ids , } } } impl :: BoxedSerialize for MsgResendReq { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & MsgResendReq :: MsgResendReq ( ref x ) => ( :: ConstructorNumber ( 0x7d861a08 ) , x ) , } } } impl :: BoxedDeserialize for MsgResendReq { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x7d861a08 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x7d861a08 ) => Ok ( MsgResendReq :: MsgResendReq ( _de . read_bare :: < :: mtproto :: msg_resend_req :: MsgResendReq > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `MsgsAck`\n\n```text\nmsgs_ack#62d6b459 msg_ids:Vector<long> = MsgsAck;\n```\n" ] pub enum MsgsAck { MsgsAck ( :: mtproto :: msgs_ack :: MsgsAck ) , } impl MsgsAck { pub fn msg_ids ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > { match self { & MsgsAck :: MsgsAck ( ref x ) => & x . msg_ids , } } } impl :: BoxedSerialize for MsgsAck { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & MsgsAck :: MsgsAck ( ref x ) => ( :: ConstructorNumber ( 0x62d6b459 ) , x ) , } } } impl :: BoxedDeserialize for MsgsAck { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x62d6b459 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x62d6b459 ) => Ok ( MsgsAck :: MsgsAck ( _de . read_bare :: < :: mtproto :: msgs_ack :: MsgsAck > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `MsgsAllInfo`\n\n```text\nmsgs_all_info#8cc0d131 msg_ids:Vector<long> info:string = MsgsAllInfo;\n```\n" ] pub enum MsgsAllInfo { MsgsAllInfo ( :: mtproto :: msgs_all_info :: MsgsAllInfo ) , } impl MsgsAllInfo { pub fn info ( & self ) -> & :: mtproto :: string { match self { & MsgsAllInfo :: MsgsAllInfo ( ref x ) => & x . info , } } pub fn msg_ids ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > { match self { & MsgsAllInfo :: MsgsAllInfo ( ref x ) => & x . msg_ids , } } } impl :: BoxedSerialize for MsgsAllInfo { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & MsgsAllInfo :: MsgsAllInfo ( ref x ) => ( :: ConstructorNumber ( 0x8cc0d131 ) , x ) , } } } impl :: BoxedDeserialize for MsgsAllInfo { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x8cc0d131 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x8cc0d131 ) => Ok ( MsgsAllInfo :: MsgsAllInfo ( _de . read_bare :: < :: mtproto :: msgs_all_info :: MsgsAllInfo > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `MsgsStateInfo`\n\n```text\nmsgs_state_info#04deb57d req_msg_id:long info:string = MsgsStateInfo;\n```\n" ] pub enum MsgsStateInfo { MsgsStateInfo ( :: mtproto :: msgs_state_info :: MsgsStateInfo ) , } impl MsgsStateInfo { pub fn info ( & self ) -> & :: mtproto :: string { match self { & MsgsStateInfo :: MsgsStateInfo ( ref x ) => & x . info , } } pub fn req_msg_id ( & self ) -> & :: mtproto :: long { match self { & MsgsStateInfo :: MsgsStateInfo ( ref x ) => & x . req_msg_id , } } } impl :: BoxedSerialize for MsgsStateInfo { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & MsgsStateInfo :: MsgsStateInfo ( ref x ) => ( :: ConstructorNumber ( 0x04deb57d ) , x ) , } } } impl :: BoxedDeserialize for MsgsStateInfo { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x04deb57d ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x04deb57d ) => Ok ( MsgsStateInfo :: MsgsStateInfo ( _de . read_bare :: < :: mtproto :: msgs_state_info :: MsgsStateInfo > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `MsgsStateReq`\n\n```text\nmsgs_state_req#da69fb52 msg_ids:Vector<long> = MsgsStateReq;\n```\n" ] pub enum MsgsStateReq { MsgsStateReq ( :: mtproto :: msgs_state_req :: MsgsStateReq ) , } impl MsgsStateReq { pub fn msg_ids ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > { match self { & MsgsStateReq :: MsgsStateReq ( ref x ) => & x . msg_ids , } } } impl :: BoxedSerialize for MsgsStateReq { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & MsgsStateReq :: MsgsStateReq ( ref x ) => ( :: ConstructorNumber ( 0xda69fb52 ) , x ) , } } } impl :: BoxedDeserialize for MsgsStateReq { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xda69fb52 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xda69fb52 ) => Ok ( MsgsStateReq :: MsgsStateReq ( _de . read_bare :: < :: mtproto :: msgs_state_req :: MsgsStateReq > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `NearestDc`\n\n```text\nnearestDc#8e1a1775 country:string this_dc:int nearest_dc:int = NearestDc;\n```\n" ] pub enum NearestDc { NearestDc ( :: mtproto :: nearest_dc :: NearestDc ) , } impl NearestDc { pub fn country ( & self ) -> & :: mtproto :: string { match self { & NearestDc :: NearestDc ( ref x ) => & x . country , } } pub fn nearest_dc ( & self ) -> & :: mtproto :: int { match self { & NearestDc :: NearestDc ( ref x ) => & x . nearest_dc , } } pub fn this_dc ( & self ) -> & :: mtproto :: int { match self { & NearestDc :: NearestDc ( ref x ) => & x . this_dc , } } } impl :: BoxedSerialize for NearestDc { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & NearestDc :: NearestDc ( ref x ) => ( :: ConstructorNumber ( 0x8e1a1775 ) , x ) , } } } impl :: BoxedDeserialize for NearestDc { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x8e1a1775 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x8e1a1775 ) => Ok ( NearestDc :: NearestDc ( _de . read_bare :: < :: mtproto :: nearest_dc :: NearestDc > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `NewSession`\n\n```text\nnew_session_created#9ec20908 first_msg_id:long unique_id:long server_salt:long = NewSession;\n```\n" ] pub enum NewSession { NewSessionCreated ( :: mtproto :: new_session_created :: NewSessionCreated ) , } impl NewSession { pub fn first_msg_id ( & self ) -> & :: mtproto :: long { match self { & NewSession :: NewSessionCreated ( ref x ) => & x . first_msg_id , } } pub fn server_salt ( & self ) -> & :: mtproto :: long { match self { & NewSession :: NewSessionCreated ( ref x ) => & x . server_salt , } } pub fn unique_id ( & self ) -> & :: mtproto :: long { match self { & NewSession :: NewSessionCreated ( ref x ) => & x . unique_id , } } } impl :: BoxedSerialize for NewSession { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & NewSession :: NewSessionCreated ( ref x ) => ( :: ConstructorNumber ( 0x9ec20908 ) , x ) , } } } impl :: BoxedDeserialize for NewSession { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x9ec20908 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x9ec20908 ) => Ok ( NewSession :: NewSessionCreated ( _de . read_bare :: < :: mtproto :: new_session_created :: NewSessionCreated > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `NotifyPeer`\n\n```text\nnotifyPeer#9fd40bd8 peer:Peer = NotifyPeer;\n\nnotifyUsers#b4c83b4c = NotifyPeer;\n\nnotifyChats#c007cec3 = NotifyPeer;\n\nnotifyAll#74d07c60 = NotifyPeer;\n```\n" ] pub enum NotifyPeer { Peer ( :: mtproto :: notify :: Peer ) , Users , Chats , All , } impl NotifyPeer { pub fn peer ( & self ) -> Option < & :: mtproto :: Peer > { match self { & NotifyPeer :: Peer ( ref x ) => Some ( & x . peer ) , _ => None } } } impl :: BoxedSerialize for NotifyPeer { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & NotifyPeer :: Peer ( ref x ) => ( :: ConstructorNumber ( 0x9fd40bd8 ) , x ) , & NotifyPeer :: Users => ( :: ConstructorNumber ( 0xb4c83b4c ) , & ( ) ) , & NotifyPeer :: Chats => ( :: ConstructorNumber ( 0xc007cec3 ) , & ( ) ) , & NotifyPeer :: All => ( :: ConstructorNumber ( 0x74d07c60 ) , & ( ) ) , } } } impl :: BoxedDeserialize for NotifyPeer { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x9fd40bd8 ) , :: ConstructorNumber ( 0xb4c83b4c ) , :: ConstructorNumber ( 0xc007cec3 ) , :: ConstructorNumber ( 0x74d07c60 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x9fd40bd8 ) => Ok ( NotifyPeer :: Peer ( _de . read_bare :: < :: mtproto :: notify :: Peer > ( ) ? ) ) , :: ConstructorNumber ( 0xb4c83b4c ) => Ok ( NotifyPeer :: Users ) , :: ConstructorNumber ( 0xc007cec3 ) => Ok ( NotifyPeer :: Chats ) , :: ConstructorNumber ( 0x74d07c60 ) => Ok ( NotifyPeer :: All ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `Null`\n\n```text\nnull#56730bcc = Null;\n```\n" ] pub enum Null { Null , } impl :: BoxedSerialize for Null { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Null :: Null => ( :: ConstructorNumber ( 0x56730bcc ) , & ( ) ) , } } } impl :: BoxedDeserialize for Null { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x56730bcc ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x56730bcc ) => Ok ( Null :: Null ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `P_Q_inner_data`\n\n```text\np_q_inner_data#83c95aec pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 = P_Q_inner_data;\n\np_q_inner_data_temp#3c6a84d4 pq:bytes p:bytes q:bytes nonce:int128 server_nonce:int128 new_nonce:int256 expires_in:int = P_Q_inner_data;\n```\n" ] pub enum PQInnerData { PQInnerData ( :: mtproto :: p_q_inner_data :: PQInnerData ) , Temp ( :: mtproto :: p_q_inner_data :: Temp ) , } impl PQInnerData { pub fn expires_in ( & self ) -> Option < & :: mtproto :: int > { match self { & PQInnerData :: Temp ( ref x ) => Some ( & x . expires_in ) , _ => None } } pub fn new_nonce ( & self ) -> & :: mtproto :: int256 { match self { & PQInnerData :: Temp ( ref x ) => & x . new_nonce , & PQInnerData :: PQInnerData ( ref x ) => & x . new_nonce , } } pub fn nonce ( & self ) -> & :: mtproto :: int128 { match self { & PQInnerData :: Temp ( ref x ) => & x . nonce , & PQInnerData :: PQInnerData ( ref x ) => & x . nonce , } } pub fn p ( & self ) -> & :: mtproto :: bytes { match self { & PQInnerData :: PQInnerData ( ref x ) => & x . p , & PQInnerData :: Temp ( ref x ) => & x . p , } } pub fn pq ( & self ) -> & :: mtproto :: bytes { match self { & PQInnerData :: PQInnerData ( ref x ) => & x . pq , & PQInnerData :: Temp ( ref x ) => & x . pq , } } pub fn q ( & self ) -> & :: mtproto :: bytes { match self { & PQInnerData :: PQInnerData ( ref x ) => & x . q , & PQInnerData :: Temp ( ref x ) => & x . q , } } pub fn server_nonce ( & self ) -> & :: mtproto :: int128 { match self { & PQInnerData :: PQInnerData ( ref x ) => & x . server_nonce , & PQInnerData :: Temp ( ref x ) => & x . server_nonce , } } } impl :: BoxedSerialize for PQInnerData { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & PQInnerData :: PQInnerData ( ref x ) => ( :: ConstructorNumber ( 0x83c95aec ) , x ) , & PQInnerData :: Temp ( ref x ) => ( :: ConstructorNumber ( 0x3c6a84d4 ) , x ) , } } } impl :: BoxedDeserialize for PQInnerData { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x83c95aec ) , :: ConstructorNumber ( 0x3c6a84d4 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x83c95aec ) => Ok ( PQInnerData :: PQInnerData ( _de . read_bare :: < :: mtproto :: p_q_inner_data :: PQInnerData > ( ) ? ) ) , :: ConstructorNumber ( 0x3c6a84d4 ) => Ok ( PQInnerData :: Temp ( _de . read_bare :: < :: mtproto :: p_q_inner_data :: Temp > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `Page`\n\n```text\npagePart#8e3f9ebe blocks:Vector<PageBlock> photos:Vector<Photo> documents:Vector<Document> = Page;\n\npageFull#556ec7aa blocks:Vector<PageBlock> photos:Vector<Photo> documents:Vector<Document> = Page;\n```\n" ] pub enum Page { Part ( :: mtproto :: page :: Part ) , Full ( :: mtproto :: page :: Full ) , } impl Page { pub fn blocks ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PageBlock > { match self { & Page :: Part ( ref x ) => & x . blocks , & Page :: Full ( ref x ) => & x . blocks , } } pub fn documents ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Document > { match self { & Page :: Part ( ref x ) => & x . documents , & Page :: Full ( ref x ) => & x . documents , } } pub fn photos ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Photo > { match self { & Page :: Part ( ref x ) => & x . photos , & Page :: Full ( ref x ) => & x . photos , } } } impl :: BoxedSerialize for Page { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Page :: Part ( ref x ) => ( :: ConstructorNumber ( 0x8e3f9ebe ) , x ) , & Page :: Full ( ref x ) => ( :: ConstructorNumber ( 0x556ec7aa ) , x ) , } } } impl :: BoxedDeserialize for Page { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x8e3f9ebe ) , :: ConstructorNumber ( 0x556ec7aa ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x8e3f9ebe ) => Ok ( Page :: Part ( _de . read_bare :: < :: mtproto :: page :: Part > ( ) ? ) ) , :: ConstructorNumber ( 0x556ec7aa ) => Ok ( Page :: Full ( _de . read_bare :: < :: mtproto :: page :: Full > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `PageBlock`\n\n```text\npageBlockUnsupported#13567e8a = PageBlock;\n\npageBlockTitle#70abc3fd text:RichText = PageBlock;\n\npageBlockSubtitle#8ffa9a1f text:RichText = PageBlock;\n\npageBlockAuthorDate#baafe5e0 author:RichText published_date:int = PageBlock;\n\npageBlockHeader#bfd064ec text:RichText = PageBlock;\n\npageBlockSubheader#f12bb6e1 text:RichText = PageBlock;\n\npageBlockParagraph#467a0766 text:RichText = PageBlock;\n\npageBlockPreformatted#c070d93e text:RichText language:string = PageBlock;\n\npageBlockFooter#48870999 text:RichText = PageBlock;\n\npageBlockDivider#db20b188 = PageBlock;\n\npageBlockAnchor#ce0d37b0 name:string = PageBlock;\n\npageBlockList#3a58c7f4 ordered:Bool items:Vector<RichText> = PageBlock;\n\npageBlockBlockquote#263d7c26 text:RichText caption:RichText = PageBlock;\n\npageBlockPullquote#4f4456d3 text:RichText caption:RichText = PageBlock;\n\npageBlockPhoto#e9c69982 photo_id:long caption:RichText = PageBlock;\n\npageBlockVideo#d9d71866 flags:# autoplay:flags.0?true loop:flags.1?true video_id:long caption:RichText = PageBlock;\n\npageBlockCover#39f23300 cover:PageBlock = PageBlock;\n\npageBlockEmbed#cde200d1 flags:# full_width:flags.0?true allow_scrolling:flags.3?true url:flags.1?string html:flags.2?string poster_photo_id:flags.4?long w:int h:int caption:RichText = PageBlock;\n\npageBlockEmbedPost#292c7be9 url:string webpage_id:long author_photo_id:long author:string date:int blocks:Vector<PageBlock> caption:RichText = PageBlock;\n\npageBlockCollage#8b31c4f items:Vector<PageBlock> caption:RichText = PageBlock;\n\npageBlockSlideshow#130c8963 items:Vector<PageBlock> caption:RichText = PageBlock;\n\npageBlockChannel#ef1751b5 channel:Chat = PageBlock;\n\npageBlockAudio#31b81a7f audio_id:long caption:RichText = PageBlock;\n```\n" ] pub enum PageBlock { Unsupported , Title ( :: mtproto :: page_block :: Title ) , Subtitle ( :: mtproto :: page_block :: Subtitle ) , AuthorDate ( :: mtproto :: page_block :: AuthorDate ) , Header ( :: mtproto :: page_block :: Header ) , Subheader ( :: mtproto :: page_block :: Subheader ) , Paragraph ( :: mtproto :: page_block :: Paragraph ) , Preformatted ( :: mtproto :: page_block :: Preformatted ) , Footer ( :: mtproto :: page_block :: Footer ) , Divider , Anchor ( :: mtproto :: page_block :: Anchor ) , List ( :: mtproto :: page_block :: List ) , Blockquote ( :: mtproto :: page_block :: Blockquote ) , Pullquote ( :: mtproto :: page_block :: Pullquote ) , Photo ( :: mtproto :: page_block :: Photo ) , Video ( :: mtproto :: page_block :: Video ) , Cover ( :: mtproto :: page_block :: Cover ) , Embed ( :: mtproto :: page_block :: Embed ) , EmbedPost ( :: mtproto :: page_block :: EmbedPost ) , Collage ( :: mtproto :: page_block :: Collage ) , Slideshow ( :: mtproto :: page_block :: Slideshow ) , Channel ( :: mtproto :: page_block :: Channel ) , Audio ( :: mtproto :: page_block :: Audio ) , } impl PageBlock { pub fn allow_scrolling ( & self ) -> Option < bool > { match self { & PageBlock :: Embed ( ref x ) => Some ( x . allow_scrolling ) , _ => None } } pub fn audio_id ( & self ) -> Option < & :: mtproto :: long > { match self { & PageBlock :: Audio ( ref x ) => Some ( & x . audio_id ) , _ => None } } pub fn author_photo_id ( & self ) -> Option < & :: mtproto :: long > { match self { & PageBlock :: EmbedPost ( ref x ) => Some ( & x . author_photo_id ) , _ => None } } pub fn autoplay ( & self ) -> Option < bool > { match self { & PageBlock :: Video ( ref x ) => Some ( x . autoplay ) , _ => None } } pub fn blocks ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PageBlock > > { match self { & PageBlock :: EmbedPost ( ref x ) => Some ( & x . blocks ) , _ => None } } pub fn caption ( & self ) -> Option < & :: mtproto :: RichText > { match self { & PageBlock :: Photo ( ref x ) => Some ( & x . caption ) , & PageBlock :: Pullquote ( ref x ) => Some ( & x . caption ) , & PageBlock :: Video ( ref x ) => Some ( & x . caption ) , & PageBlock :: EmbedPost ( ref x ) => Some ( & x . caption ) , & PageBlock :: Slideshow ( ref x ) => Some ( & x . caption ) , & PageBlock :: Embed ( ref x ) => Some ( & x . caption ) , & PageBlock :: Blockquote ( ref x ) => Some ( & x . caption ) , & PageBlock :: Collage ( ref x ) => Some ( & x . caption ) , & PageBlock :: Audio ( ref x ) => Some ( & x . caption ) , _ => None } } pub fn channel ( & self ) -> Option < & :: mtproto :: Chat > { match self { & PageBlock :: Channel ( ref x ) => Some ( & x . channel ) , _ => None } } pub fn cover ( & self ) -> Option < & :: mtproto :: PageBlock > { match self { & PageBlock :: Cover ( ref x ) => Some ( & x . cover ) , _ => None } } pub fn date ( & self ) -> Option < & :: mtproto :: int > { match self { & PageBlock :: EmbedPost ( ref x ) => Some ( & x . date ) , _ => None } } pub fn full_width ( & self ) -> Option < bool > { match self { & PageBlock :: Embed ( ref x ) => Some ( x . full_width ) , _ => None } } pub fn h ( & self ) -> Option < & :: mtproto :: int > { match self { & PageBlock :: Embed ( ref x ) => Some ( & x . h ) , _ => None } } pub fn html ( & self ) -> Option < & :: mtproto :: string > { match self { & PageBlock :: Embed ( ref x ) => x . html . as_ref ( ) , _ => None } } pub fn language ( & self ) -> Option < & :: mtproto :: string > { match self { & PageBlock :: Preformatted ( ref x ) => Some ( & x . language ) , _ => None } } pub fn loop_ ( & self ) -> Option < bool > { match self { & PageBlock :: Video ( ref x ) => Some ( x . loop_ ) , _ => None } } pub fn name ( & self ) -> Option < & :: mtproto :: string > { match self { & PageBlock :: Anchor ( ref x ) => Some ( & x . name ) , _ => None } } pub fn ordered ( & self ) -> Option < & :: mtproto :: Bool > { match self { & PageBlock :: List ( ref x ) => Some ( & x . ordered ) , _ => None } } pub fn photo_id ( & self ) -> Option < & :: mtproto :: long > { match self { & PageBlock :: Photo ( ref x ) => Some ( & x . photo_id ) , _ => None } } pub fn poster_photo_id ( & self ) -> Option < & :: mtproto :: long > { match self { & PageBlock :: Embed ( ref x ) => x . poster_photo_id . as_ref ( ) , _ => None } } pub fn published_date ( & self ) -> Option < & :: mtproto :: int > { match self { & PageBlock :: AuthorDate ( ref x ) => Some ( & x . published_date ) , _ => None } } pub fn text ( & self ) -> Option < & :: mtproto :: RichText > { match self { & PageBlock :: Header ( ref x ) => Some ( & x . text ) , & PageBlock :: Subheader ( ref x ) => Some ( & x . text ) , & PageBlock :: Preformatted ( ref x ) => Some ( & x . text ) , & PageBlock :: Title ( ref x ) => Some ( & x . text ) , & PageBlock :: Paragraph ( ref x ) => Some ( & x . text ) , & PageBlock :: Subtitle ( ref x ) => Some ( & x . text ) , & PageBlock :: Blockquote ( ref x ) => Some ( & x . text ) , & PageBlock :: Footer ( ref x ) => Some ( & x . text ) , & PageBlock :: Pullquote ( ref x ) => Some ( & x . text ) , _ => None } } pub fn video_id ( & self ) -> Option < & :: mtproto :: long > { match self { & PageBlock :: Video ( ref x ) => Some ( & x . video_id ) , _ => None } } pub fn w ( & self ) -> Option < & :: mtproto :: int > { match self { & PageBlock :: Embed ( ref x ) => Some ( & x . w ) , _ => None } } pub fn webpage_id ( & self ) -> Option < & :: mtproto :: long > { match self { & PageBlock :: EmbedPost ( ref x ) => Some ( & x . webpage_id ) , _ => None } } } impl :: BoxedSerialize for PageBlock { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & PageBlock :: Unsupported => ( :: ConstructorNumber ( 0x13567e8a ) , & ( ) ) , & PageBlock :: Title ( ref x ) => ( :: ConstructorNumber ( 0x70abc3fd ) , x ) , & PageBlock :: Subtitle ( ref x ) => ( :: ConstructorNumber ( 0x8ffa9a1f ) , x ) , & PageBlock :: AuthorDate ( ref x ) => ( :: ConstructorNumber ( 0xbaafe5e0 ) , x ) , & PageBlock :: Header ( ref x ) => ( :: ConstructorNumber ( 0xbfd064ec ) , x ) , & PageBlock :: Subheader ( ref x ) => ( :: ConstructorNumber ( 0xf12bb6e1 ) , x ) , & PageBlock :: Paragraph ( ref x ) => ( :: ConstructorNumber ( 0x467a0766 ) , x ) , & PageBlock :: Preformatted ( ref x ) => ( :: ConstructorNumber ( 0xc070d93e ) , x ) , & PageBlock :: Footer ( ref x ) => ( :: ConstructorNumber ( 0x48870999 ) , x ) , & PageBlock :: Divider => ( :: ConstructorNumber ( 0xdb20b188 ) , & ( ) ) , & PageBlock :: Anchor ( ref x ) => ( :: ConstructorNumber ( 0xce0d37b0 ) , x ) , & PageBlock :: List ( ref x ) => ( :: ConstructorNumber ( 0x3a58c7f4 ) , x ) , & PageBlock :: Blockquote ( ref x ) => ( :: ConstructorNumber ( 0x263d7c26 ) , x ) , & PageBlock :: Pullquote ( ref x ) => ( :: ConstructorNumber ( 0x4f4456d3 ) , x ) , & PageBlock :: Photo ( ref x ) => ( :: ConstructorNumber ( 0xe9c69982 ) , x ) , & PageBlock :: Video ( ref x ) => ( :: ConstructorNumber ( 0xd9d71866 ) , x ) , & PageBlock :: Cover ( ref x ) => ( :: ConstructorNumber ( 0x39f23300 ) , x ) , & PageBlock :: Embed ( ref x ) => ( :: ConstructorNumber ( 0xcde200d1 ) , x ) , & PageBlock :: EmbedPost ( ref x ) => ( :: ConstructorNumber ( 0x292c7be9 ) , x ) , & PageBlock :: Collage ( ref x ) => ( :: ConstructorNumber ( 0x08b31c4f ) , x ) , & PageBlock :: Slideshow ( ref x ) => ( :: ConstructorNumber ( 0x130c8963 ) , x ) , & PageBlock :: Channel ( ref x ) => ( :: ConstructorNumber ( 0xef1751b5 ) , x ) , & PageBlock :: Audio ( ref x ) => ( :: ConstructorNumber ( 0x31b81a7f ) , x ) , } } } impl :: BoxedDeserialize for PageBlock { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x13567e8a ) , :: ConstructorNumber ( 0x70abc3fd ) , :: ConstructorNumber ( 0x8ffa9a1f ) , :: ConstructorNumber ( 0xbaafe5e0 ) , :: ConstructorNumber ( 0xbfd064ec ) , :: ConstructorNumber ( 0xf12bb6e1 ) , :: ConstructorNumber ( 0x467a0766 ) , :: ConstructorNumber ( 0xc070d93e ) , :: ConstructorNumber ( 0x48870999 ) , :: ConstructorNumber ( 0xdb20b188 ) , :: ConstructorNumber ( 0xce0d37b0 ) , :: ConstructorNumber ( 0x3a58c7f4 ) , :: ConstructorNumber ( 0x263d7c26 ) , :: ConstructorNumber ( 0x4f4456d3 ) , :: ConstructorNumber ( 0xe9c69982 ) , :: ConstructorNumber ( 0xd9d71866 ) , :: ConstructorNumber ( 0x39f23300 ) , :: ConstructorNumber ( 0xcde200d1 ) , :: ConstructorNumber ( 0x292c7be9 ) , :: ConstructorNumber ( 0x08b31c4f ) , :: ConstructorNumber ( 0x130c8963 ) , :: ConstructorNumber ( 0xef1751b5 ) , :: ConstructorNumber ( 0x31b81a7f ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x13567e8a ) => Ok ( PageBlock :: Unsupported ) , :: ConstructorNumber ( 0x70abc3fd ) => Ok ( PageBlock :: Title ( _de . read_bare :: < :: mtproto :: page_block :: Title > ( ) ? ) ) , :: ConstructorNumber ( 0x8ffa9a1f ) => Ok ( PageBlock :: Subtitle ( _de . read_bare :: < :: mtproto :: page_block :: Subtitle > ( ) ? ) ) , :: ConstructorNumber ( 0xbaafe5e0 ) => Ok ( PageBlock :: AuthorDate ( _de . read_bare :: < :: mtproto :: page_block :: AuthorDate > ( ) ? ) ) , :: ConstructorNumber ( 0xbfd064ec ) => Ok ( PageBlock :: Header ( _de . read_bare :: < :: mtproto :: page_block :: Header > ( ) ? ) ) , :: ConstructorNumber ( 0xf12bb6e1 ) => Ok ( PageBlock :: Subheader ( _de . read_bare :: < :: mtproto :: page_block :: Subheader > ( ) ? ) ) , :: ConstructorNumber ( 0x467a0766 ) => Ok ( PageBlock :: Paragraph ( _de . read_bare :: < :: mtproto :: page_block :: Paragraph > ( ) ? ) ) , :: ConstructorNumber ( 0xc070d93e ) => Ok ( PageBlock :: Preformatted ( _de . read_bare :: < :: mtproto :: page_block :: Preformatted > ( ) ? ) ) , :: ConstructorNumber ( 0x48870999 ) => Ok ( PageBlock :: Footer ( _de . read_bare :: < :: mtproto :: page_block :: Footer > ( ) ? ) ) , :: ConstructorNumber ( 0xdb20b188 ) => Ok ( PageBlock :: Divider ) , :: ConstructorNumber ( 0xce0d37b0 ) => Ok ( PageBlock :: Anchor ( _de . read_bare :: < :: mtproto :: page_block :: Anchor > ( ) ? ) ) , :: ConstructorNumber ( 0x3a58c7f4 ) => Ok ( PageBlock :: List ( _de . read_bare :: < :: mtproto :: page_block :: List > ( ) ? ) ) , :: ConstructorNumber ( 0x263d7c26 ) => Ok ( PageBlock :: Blockquote ( _de . read_bare :: < :: mtproto :: page_block :: Blockquote > ( ) ? ) ) , :: ConstructorNumber ( 0x4f4456d3 ) => Ok ( PageBlock :: Pullquote ( _de . read_bare :: < :: mtproto :: page_block :: Pullquote > ( ) ? ) ) , :: ConstructorNumber ( 0xe9c69982 ) => Ok ( PageBlock :: Photo ( _de . read_bare :: < :: mtproto :: page_block :: Photo > ( ) ? ) ) , :: ConstructorNumber ( 0xd9d71866 ) => Ok ( PageBlock :: Video ( _de . read_bare :: < :: mtproto :: page_block :: Video > ( ) ? ) ) , :: ConstructorNumber ( 0x39f23300 ) => Ok ( PageBlock :: Cover ( _de . read_bare :: < :: mtproto :: page_block :: Cover > ( ) ? ) ) , :: ConstructorNumber ( 0xcde200d1 ) => Ok ( PageBlock :: Embed ( _de . read_bare :: < :: mtproto :: page_block :: Embed > ( ) ? ) ) , :: ConstructorNumber ( 0x292c7be9 ) => Ok ( PageBlock :: EmbedPost ( _de . read_bare :: < :: mtproto :: page_block :: EmbedPost > ( ) ? ) ) , :: ConstructorNumber ( 0x08b31c4f ) => Ok ( PageBlock :: Collage ( _de . read_bare :: < :: mtproto :: page_block :: Collage > ( ) ? ) ) , :: ConstructorNumber ( 0x130c8963 ) => Ok ( PageBlock :: Slideshow ( _de . read_bare :: < :: mtproto :: page_block :: Slideshow > ( ) ? ) ) , :: ConstructorNumber ( 0xef1751b5 ) => Ok ( PageBlock :: Channel ( _de . read_bare :: < :: mtproto :: page_block :: Channel > ( ) ? ) ) , :: ConstructorNumber ( 0x31b81a7f ) => Ok ( PageBlock :: Audio ( _de . read_bare :: < :: mtproto :: page_block :: Audio > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `PaymentCharge`\n\n```text\npaymentCharge#ea02c27e id:string provider_charge_id:string = PaymentCharge;\n```\n" ] pub enum PaymentCharge { PaymentCharge ( :: mtproto :: payment_charge :: PaymentCharge ) , } impl PaymentCharge { pub fn id ( & self ) -> & :: mtproto :: string { match self { & PaymentCharge :: PaymentCharge ( ref x ) => & x . id , } } pub fn provider_charge_id ( & self ) -> & :: mtproto :: string { match self { & PaymentCharge :: PaymentCharge ( ref x ) => & x . provider_charge_id , } } } impl :: BoxedSerialize for PaymentCharge { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & PaymentCharge :: PaymentCharge ( ref x ) => ( :: ConstructorNumber ( 0xea02c27e ) , x ) , } } } impl :: BoxedDeserialize for PaymentCharge { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xea02c27e ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xea02c27e ) => Ok ( PaymentCharge :: PaymentCharge ( _de . read_bare :: < :: mtproto :: payment_charge :: PaymentCharge > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `PaymentRequestedInfo`\n\n```text\npaymentRequestedInfo#909c3f94 flags:# name:flags.0?string phone:flags.1?string email:flags.2?string shipping_address:flags.3?PostAddress = PaymentRequestedInfo;\n```\n" ] pub enum PaymentRequestedInfo { PaymentRequestedInfo ( :: mtproto :: payment_requested_info :: PaymentRequestedInfo ) , } impl PaymentRequestedInfo { pub fn email ( & self ) -> Option < & :: mtproto :: string > { match self { & PaymentRequestedInfo :: PaymentRequestedInfo ( ref x ) => x . email . as_ref ( ) , } } pub fn name ( & self ) -> Option < & :: mtproto :: string > { match self { & PaymentRequestedInfo :: PaymentRequestedInfo ( ref x ) => x . name . as_ref ( ) , } } pub fn phone ( & self ) -> Option < & :: mtproto :: string > { match self { & PaymentRequestedInfo :: PaymentRequestedInfo ( ref x ) => x . phone . as_ref ( ) , } } pub fn shipping_address ( & self ) -> Option < & :: mtproto :: PostAddress > { match self { & PaymentRequestedInfo :: PaymentRequestedInfo ( ref x ) => x . shipping_address . as_ref ( ) , } } } impl :: BoxedSerialize for PaymentRequestedInfo { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & PaymentRequestedInfo :: PaymentRequestedInfo ( ref x ) => ( :: ConstructorNumber ( 0x909c3f94 ) , x ) , } } } impl :: BoxedDeserialize for PaymentRequestedInfo { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x909c3f94 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x909c3f94 ) => Ok ( PaymentRequestedInfo :: PaymentRequestedInfo ( _de . read_bare :: < :: mtproto :: payment_requested_info :: PaymentRequestedInfo > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `PaymentSavedCredentials`\n\n```text\npaymentSavedCredentialsCard#cdc27a1f id:string title:string = PaymentSavedCredentials;\n```\n" ] pub enum PaymentSavedCredentials { PaymentSavedCredentialsCard ( :: mtproto :: payment_saved_credentials_card :: PaymentSavedCredentialsCard ) , } impl PaymentSavedCredentials { pub fn id ( & self ) -> & :: mtproto :: string { match self { & PaymentSavedCredentials :: PaymentSavedCredentialsCard ( ref x ) => & x . id , } } pub fn title ( & self ) -> & :: mtproto :: string { match self { & PaymentSavedCredentials :: PaymentSavedCredentialsCard ( ref x ) => & x . title , } } } impl :: BoxedSerialize for PaymentSavedCredentials { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & PaymentSavedCredentials :: PaymentSavedCredentialsCard ( ref x ) => ( :: ConstructorNumber ( 0xcdc27a1f ) , x ) , } } } impl :: BoxedDeserialize for PaymentSavedCredentials { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xcdc27a1f ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xcdc27a1f ) => Ok ( PaymentSavedCredentials :: PaymentSavedCredentialsCard ( _de . read_bare :: < :: mtproto :: payment_saved_credentials_card :: PaymentSavedCredentialsCard > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `Peer`\n\n```text\npeerUser#9db1bc6d user_id:int = Peer;\n\npeerChat#bad0e5bb chat_id:int = Peer;\n\npeerChannel#bddde532 channel_id:int = Peer;\n```\n" ] pub enum Peer { User ( :: mtproto :: peer :: User ) , Chat ( :: mtproto :: peer :: Chat ) , Channel ( :: mtproto :: peer :: Channel ) , } impl Peer { pub fn channel_id ( & self ) -> Option < & :: mtproto :: int > { match self { & Peer :: Channel ( ref x ) => Some ( & x . channel_id ) , _ => None } } pub fn chat_id ( & self ) -> Option < & :: mtproto :: int > { match self { & Peer :: Chat ( ref x ) => Some ( & x . chat_id ) , _ => None } } pub fn user_id ( & self ) -> Option < & :: mtproto :: int > { match self { & Peer :: User ( ref x ) => Some ( & x . user_id ) , _ => None } } } impl :: BoxedSerialize for Peer { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Peer :: User ( ref x ) => ( :: ConstructorNumber ( 0x9db1bc6d ) , x ) , & Peer :: Chat ( ref x ) => ( :: ConstructorNumber ( 0xbad0e5bb ) , x ) , & Peer :: Channel ( ref x ) => ( :: ConstructorNumber ( 0xbddde532 ) , x ) , } } } impl :: BoxedDeserialize for Peer { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x9db1bc6d ) , :: ConstructorNumber ( 0xbad0e5bb ) , :: ConstructorNumber ( 0xbddde532 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x9db1bc6d ) => Ok ( Peer :: User ( _de . read_bare :: < :: mtproto :: peer :: User > ( ) ? ) ) , :: ConstructorNumber ( 0xbad0e5bb ) => Ok ( Peer :: Chat ( _de . read_bare :: < :: mtproto :: peer :: Chat > ( ) ? ) ) , :: ConstructorNumber ( 0xbddde532 ) => Ok ( Peer :: Channel ( _de . read_bare :: < :: mtproto :: peer :: Channel > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `PeerNotifyEvents`\n\n```text\npeerNotifyEventsEmpty#add53cb3 = PeerNotifyEvents;\n\npeerNotifyEventsAll#6d1ded88 = PeerNotifyEvents;\n```\n" ] pub enum PeerNotifyEvents { Empty , All , } impl :: BoxedSerialize for PeerNotifyEvents { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & PeerNotifyEvents :: Empty => ( :: ConstructorNumber ( 0xadd53cb3 ) , & ( ) ) , & PeerNotifyEvents :: All => ( :: ConstructorNumber ( 0x6d1ded88 ) , & ( ) ) , } } } impl :: BoxedDeserialize for PeerNotifyEvents { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xadd53cb3 ) , :: ConstructorNumber ( 0x6d1ded88 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xadd53cb3 ) => Ok ( PeerNotifyEvents :: Empty ) , :: ConstructorNumber ( 0x6d1ded88 ) => Ok ( PeerNotifyEvents :: All ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `PeerNotifySettings`\n\n```text\npeerNotifySettingsEmpty#70a68512 = PeerNotifySettings;\n\npeerNotifySettings#9acda4c0 flags:# show_previews:flags.0?true silent:flags.1?true mute_until:int sound:string = PeerNotifySettings;\n```\n" ] pub enum PeerNotifySettings { Empty , PeerNotifySettings ( :: mtproto :: peer_notify_settings :: PeerNotifySettings ) , } impl PeerNotifySettings { pub fn mute_until ( & self ) -> Option < & :: mtproto :: int > { match self { & PeerNotifySettings :: PeerNotifySettings ( ref x ) => Some ( & x . mute_until ) , _ => None } } pub fn show_previews ( & self ) -> Option < bool > { match self { & PeerNotifySettings :: PeerNotifySettings ( ref x ) => Some ( x . show_previews ) , _ => None } } pub fn silent ( & self ) -> Option < bool > { match self { & PeerNotifySettings :: PeerNotifySettings ( ref x ) => Some ( x . silent ) , _ => None } } pub fn sound ( & self ) -> Option < & :: mtproto :: string > { match self { & PeerNotifySettings :: PeerNotifySettings ( ref x ) => Some ( & x . sound ) , _ => None } } } impl :: BoxedSerialize for PeerNotifySettings { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & PeerNotifySettings :: Empty => ( :: ConstructorNumber ( 0x70a68512 ) , & ( ) ) , & PeerNotifySettings :: PeerNotifySettings ( ref x ) => ( :: ConstructorNumber ( 0x9acda4c0 ) , x ) , } } } impl :: BoxedDeserialize for PeerNotifySettings { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x70a68512 ) , :: ConstructorNumber ( 0x9acda4c0 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x70a68512 ) => Ok ( PeerNotifySettings :: Empty ) , :: ConstructorNumber ( 0x9acda4c0 ) => Ok ( PeerNotifySettings :: PeerNotifySettings ( _de . read_bare :: < :: mtproto :: peer_notify_settings :: PeerNotifySettings > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } impl :: BoxedSerialize for Option < :: mtproto :: peer_notify_settings :: PeerNotifySettings > { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match * self { None => ( :: ConstructorNumber ( 0x70a68512 ) , & ( ) ) , Some ( ref x ) => ( :: ConstructorNumber ( 0x9acda4c0 ) , x ) , } } } impl :: BoxedDeserialize for Option < :: mtproto :: peer_notify_settings :: PeerNotifySettings > { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x70a68512 ) , :: ConstructorNumber ( 0x9acda4c0 ) ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x70a68512 ) => Ok ( None ) , :: ConstructorNumber ( 0x9acda4c0 ) => Ok ( Some ( _de . read_bare :: < :: mtproto :: peer_notify_settings :: PeerNotifySettings > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `PeerSettings`\n\n```text\npeerSettings#818426cd flags:# report_spam:flags.0?true = PeerSettings;\n```\n" ] pub enum PeerSettings { PeerSettings ( :: mtproto :: peer_settings :: PeerSettings ) , } impl PeerSettings { pub fn report_spam ( & self ) -> bool { match self { & PeerSettings :: PeerSettings ( ref x ) => x . report_spam , } } } impl :: BoxedSerialize for PeerSettings { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & PeerSettings :: PeerSettings ( ref x ) => ( :: ConstructorNumber ( 0x818426cd ) , x ) , } } } impl :: BoxedDeserialize for PeerSettings { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x818426cd ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x818426cd ) => Ok ( PeerSettings :: PeerSettings ( _de . read_bare :: < :: mtproto :: peer_settings :: PeerSettings > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `PhoneCall`\n\n```text\nphoneCallEmpty#5366c915 id:long = PhoneCall;\n\nphoneCallWaiting#1b8f4ad1 flags:# id:long access_hash:long date:int admin_id:int participant_id:int protocol:PhoneCallProtocol receive_date:flags.0?int = PhoneCall;\n\nphoneCallRequested#83761ce4 id:long access_hash:long date:int admin_id:int participant_id:int g_a_hash:bytes protocol:PhoneCallProtocol = PhoneCall;\n\nphoneCallAccepted#6d003d3f id:long access_hash:long date:int admin_id:int participant_id:int g_b:bytes protocol:PhoneCallProtocol = PhoneCall;\n\nphoneCall#ffe6ab67 id:long access_hash:long date:int admin_id:int participant_id:int g_a_or_b:bytes key_fingerprint:long protocol:PhoneCallProtocol connection:PhoneConnection alternative_connections:Vector<PhoneConnection> start_date:int = PhoneCall;\n\nphoneCallDiscarded#50ca4de1 flags:# need_rating:flags.2?true need_debug:flags.3?true id:long reason:flags.0?PhoneCallDiscardReason duration:flags.1?int = PhoneCall;\n```\n" ] pub enum PhoneCall { Empty ( :: mtproto :: phone_call :: Empty ) , Waiting ( :: mtproto :: phone_call :: Waiting ) , Requested ( :: mtproto :: phone_call :: Requested ) , Accepted ( :: mtproto :: phone_call :: Accepted ) , PhoneCall ( :: mtproto :: phone_call :: PhoneCall ) , Discarded ( :: mtproto :: phone_call :: Discarded ) , } impl PhoneCall { pub fn access_hash ( & self ) -> Option < & :: mtproto :: long > { match self { & PhoneCall :: Requested ( ref x ) => Some ( & x . access_hash ) , & PhoneCall :: Waiting ( ref x ) => Some ( & x . access_hash ) , & PhoneCall :: PhoneCall ( ref x ) => Some ( & x . access_hash ) , & PhoneCall :: Accepted ( ref x ) => Some ( & x . access_hash ) , _ => None } } pub fn admin_id ( & self ) -> Option < & :: mtproto :: int > { match self { & PhoneCall :: Waiting ( ref x ) => Some ( & x . admin_id ) , & PhoneCall :: Requested ( ref x ) => Some ( & x . admin_id ) , & PhoneCall :: PhoneCall ( ref x ) => Some ( & x . admin_id ) , & PhoneCall :: Accepted ( ref x ) => Some ( & x . admin_id ) , _ => None } } pub fn alternative_connections ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PhoneConnection > > { match self { & PhoneCall :: PhoneCall ( ref x ) => Some ( & x . alternative_connections ) , _ => None } } pub fn connection ( & self ) -> Option < & :: mtproto :: PhoneConnection > { match self { & PhoneCall :: PhoneCall ( ref x ) => Some ( & x . connection ) , _ => None } } pub fn date ( & self ) -> Option < & :: mtproto :: int > { match self { & PhoneCall :: Requested ( ref x ) => Some ( & x . date ) , & PhoneCall :: Waiting ( ref x ) => Some ( & x . date ) , & PhoneCall :: Accepted ( ref x ) => Some ( & x . date ) , & PhoneCall :: PhoneCall ( ref x ) => Some ( & x . date ) , _ => None } } pub fn duration ( & self ) -> Option < & :: mtproto :: int > { match self { & PhoneCall :: Discarded ( ref x ) => x . duration . as_ref ( ) , _ => None } } pub fn g_a_hash ( & self ) -> Option < & :: mtproto :: bytes > { match self { & PhoneCall :: Requested ( ref x ) => Some ( & x . g_a_hash ) , _ => None } } pub fn g_a_or_b ( & self ) -> Option < & :: mtproto :: bytes > { match self { & PhoneCall :: PhoneCall ( ref x ) => Some ( & x . g_a_or_b ) , _ => None } } pub fn g_b ( & self ) -> Option < & :: mtproto :: bytes > { match self { & PhoneCall :: Accepted ( ref x ) => Some ( & x . g_b ) , _ => None } } pub fn id ( & self ) -> & :: mtproto :: long { match self { & PhoneCall :: Empty ( ref x ) => & x . id , & PhoneCall :: Discarded ( ref x ) => & x . id , & PhoneCall :: PhoneCall ( ref x ) => & x . id , & PhoneCall :: Requested ( ref x ) => & x . id , & PhoneCall :: Accepted ( ref x ) => & x . id , & PhoneCall :: Waiting ( ref x ) => & x . id , } } pub fn key_fingerprint ( & self ) -> Option < & :: mtproto :: long > { match self { & PhoneCall :: PhoneCall ( ref x ) => Some ( & x . key_fingerprint ) , _ => None } } pub fn need_debug ( & self ) -> Option < bool > { match self { & PhoneCall :: Discarded ( ref x ) => Some ( x . need_debug ) , _ => None } } pub fn need_rating ( & self ) -> Option < bool > { match self { & PhoneCall :: Discarded ( ref x ) => Some ( x . need_rating ) , _ => None } } pub fn participant_id ( & self ) -> Option < & :: mtproto :: int > { match self { & PhoneCall :: Waiting ( ref x ) => Some ( & x . participant_id ) , & PhoneCall :: Accepted ( ref x ) => Some ( & x . participant_id ) , & PhoneCall :: Requested ( ref x ) => Some ( & x . participant_id ) , & PhoneCall :: PhoneCall ( ref x ) => Some ( & x . participant_id ) , _ => None } } pub fn protocol ( & self ) -> Option < & :: mtproto :: PhoneCallProtocol > { match self { & PhoneCall :: Accepted ( ref x ) => Some ( & x . protocol ) , & PhoneCall :: PhoneCall ( ref x ) => Some ( & x . protocol ) , & PhoneCall :: Requested ( ref x ) => Some ( & x . protocol ) , & PhoneCall :: Waiting ( ref x ) => Some ( & x . protocol ) , _ => None } } pub fn reason ( & self ) -> Option < & :: mtproto :: PhoneCallDiscardReason > { match self { & PhoneCall :: Discarded ( ref x ) => x . reason . as_ref ( ) , _ => None } } pub fn receive_date ( & self ) -> Option < & :: mtproto :: int > { match self { & PhoneCall :: Waiting ( ref x ) => x . receive_date . as_ref ( ) , _ => None } } pub fn start_date ( & self ) -> Option < & :: mtproto :: int > { match self { & PhoneCall :: PhoneCall ( ref x ) => Some ( & x . start_date ) , _ => None } } } impl :: BoxedSerialize for PhoneCall { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & PhoneCall :: Empty ( ref x ) => ( :: ConstructorNumber ( 0x5366c915 ) , x ) , & PhoneCall :: Waiting ( ref x ) => ( :: ConstructorNumber ( 0x1b8f4ad1 ) , x ) , & PhoneCall :: Requested ( ref x ) => ( :: ConstructorNumber ( 0x83761ce4 ) , x ) , & PhoneCall :: Accepted ( ref x ) => ( :: ConstructorNumber ( 0x6d003d3f ) , x ) , & PhoneCall :: PhoneCall ( ref x ) => ( :: ConstructorNumber ( 0xffe6ab67 ) , x ) , & PhoneCall :: Discarded ( ref x ) => ( :: ConstructorNumber ( 0x50ca4de1 ) , x ) , } } } impl :: BoxedDeserialize for PhoneCall { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x5366c915 ) , :: ConstructorNumber ( 0x1b8f4ad1 ) , :: ConstructorNumber ( 0x83761ce4 ) , :: ConstructorNumber ( 0x6d003d3f ) , :: ConstructorNumber ( 0xffe6ab67 ) , :: ConstructorNumber ( 0x50ca4de1 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x5366c915 ) => Ok ( PhoneCall :: Empty ( _de . read_bare :: < :: mtproto :: phone_call :: Empty > ( ) ? ) ) , :: ConstructorNumber ( 0x1b8f4ad1 ) => Ok ( PhoneCall :: Waiting ( _de . read_bare :: < :: mtproto :: phone_call :: Waiting > ( ) ? ) ) , :: ConstructorNumber ( 0x83761ce4 ) => Ok ( PhoneCall :: Requested ( _de . read_bare :: < :: mtproto :: phone_call :: Requested > ( ) ? ) ) , :: ConstructorNumber ( 0x6d003d3f ) => Ok ( PhoneCall :: Accepted ( _de . read_bare :: < :: mtproto :: phone_call :: Accepted > ( ) ? ) ) , :: ConstructorNumber ( 0xffe6ab67 ) => Ok ( PhoneCall :: PhoneCall ( _de . read_bare :: < :: mtproto :: phone_call :: PhoneCall > ( ) ? ) ) , :: ConstructorNumber ( 0x50ca4de1 ) => Ok ( PhoneCall :: Discarded ( _de . read_bare :: < :: mtproto :: phone_call :: Discarded > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `PhoneCallDiscardReason`\n\n```text\nphoneCallDiscardReasonMissed#85e42301 = PhoneCallDiscardReason;\n\nphoneCallDiscardReasonDisconnect#e095c1a0 = PhoneCallDiscardReason;\n\nphoneCallDiscardReasonHangup#57adc690 = PhoneCallDiscardReason;\n\nphoneCallDiscardReasonBusy#faf7e8c9 = PhoneCallDiscardReason;\n```\n" ] pub enum PhoneCallDiscardReason { Missed , Disconnect , Hangup , Busy , } impl :: BoxedSerialize for PhoneCallDiscardReason { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & PhoneCallDiscardReason :: Missed => ( :: ConstructorNumber ( 0x85e42301 ) , & ( ) ) , & PhoneCallDiscardReason :: Disconnect => ( :: ConstructorNumber ( 0xe095c1a0 ) , & ( ) ) , & PhoneCallDiscardReason :: Hangup => ( :: ConstructorNumber ( 0x57adc690 ) , & ( ) ) , & PhoneCallDiscardReason :: Busy => ( :: ConstructorNumber ( 0xfaf7e8c9 ) , & ( ) ) , } } } impl :: BoxedDeserialize for PhoneCallDiscardReason { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x85e42301 ) , :: ConstructorNumber ( 0xe095c1a0 ) , :: ConstructorNumber ( 0x57adc690 ) , :: ConstructorNumber ( 0xfaf7e8c9 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x85e42301 ) => Ok ( PhoneCallDiscardReason :: Missed ) , :: ConstructorNumber ( 0xe095c1a0 ) => Ok ( PhoneCallDiscardReason :: Disconnect ) , :: ConstructorNumber ( 0x57adc690 ) => Ok ( PhoneCallDiscardReason :: Hangup ) , :: ConstructorNumber ( 0xfaf7e8c9 ) => Ok ( PhoneCallDiscardReason :: Busy ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `PhoneCallProtocol`\n\n```text\nphoneCallProtocol#a2bb35cb flags:# udp_p2p:flags.0?true udp_reflector:flags.1?true min_layer:int max_layer:int = PhoneCallProtocol;\n```\n" ] pub enum PhoneCallProtocol { PhoneCallProtocol ( :: mtproto :: phone_call_protocol :: PhoneCallProtocol ) , } impl PhoneCallProtocol { pub fn max_layer ( & self ) -> & :: mtproto :: int { match self { & PhoneCallProtocol :: PhoneCallProtocol ( ref x ) => & x . max_layer , } } pub fn min_layer ( & self ) -> & :: mtproto :: int { match self { & PhoneCallProtocol :: PhoneCallProtocol ( ref x ) => & x . min_layer , } } pub fn udp_p2p ( & self ) -> bool { match self { & PhoneCallProtocol :: PhoneCallProtocol ( ref x ) => x . udp_p2p , } } pub fn udp_reflector ( & self ) -> bool { match self { & PhoneCallProtocol :: PhoneCallProtocol ( ref x ) => x . udp_reflector , } } } impl :: BoxedSerialize for PhoneCallProtocol { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & PhoneCallProtocol :: PhoneCallProtocol ( ref x ) => ( :: ConstructorNumber ( 0xa2bb35cb ) , x ) , } } } impl :: BoxedDeserialize for PhoneCallProtocol { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xa2bb35cb ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xa2bb35cb ) => Ok ( PhoneCallProtocol :: PhoneCallProtocol ( _de . read_bare :: < :: mtproto :: phone_call_protocol :: PhoneCallProtocol > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `PhoneConnection`\n\n```text\nphoneConnection#9d4c17c0 id:long ip:string ipv6:string port:int peer_tag:bytes = PhoneConnection;\n```\n" ] pub enum PhoneConnection { PhoneConnection ( :: mtproto :: phone_connection :: PhoneConnection ) , } impl PhoneConnection { pub fn id ( & self ) -> & :: mtproto :: long { match self { & PhoneConnection :: PhoneConnection ( ref x ) => & x . id , } } pub fn ip ( & self ) -> & :: mtproto :: string { match self { & PhoneConnection :: PhoneConnection ( ref x ) => & x . ip , } } pub fn ipv6 ( & self ) -> & :: mtproto :: string { match self { & PhoneConnection :: PhoneConnection ( ref x ) => & x . ipv6 , } } pub fn peer_tag ( & self ) -> & :: mtproto :: bytes { match self { & PhoneConnection :: PhoneConnection ( ref x ) => & x . peer_tag , } } pub fn port ( & self ) -> & :: mtproto :: int { match self { & PhoneConnection :: PhoneConnection ( ref x ) => & x . port , } } } impl :: BoxedSerialize for PhoneConnection { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & PhoneConnection :: PhoneConnection ( ref x ) => ( :: ConstructorNumber ( 0x9d4c17c0 ) , x ) , } } } impl :: BoxedDeserialize for PhoneConnection { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x9d4c17c0 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x9d4c17c0 ) => Ok ( PhoneConnection :: PhoneConnection ( _de . read_bare :: < :: mtproto :: phone_connection :: PhoneConnection > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `Photo`\n\n```text\nphotoEmpty#2331b22d id:long = Photo;\n\nphoto#9288dd29 flags:# has_stickers:flags.0?true id:long access_hash:long date:int sizes:Vector<PhotoSize> = Photo;\n```\n" ] pub enum Photo { Empty ( :: mtproto :: photo :: Empty ) , Photo ( :: mtproto :: photo :: Photo ) , } impl Photo { pub fn access_hash ( & self ) -> Option < & :: mtproto :: long > { match self { & Photo :: Photo ( ref x ) => Some ( & x . access_hash ) , _ => None } } pub fn date ( & self ) -> Option < & :: mtproto :: int > { match self { & Photo :: Photo ( ref x ) => Some ( & x . date ) , _ => None } } pub fn has_stickers ( & self ) -> Option < bool > { match self { & Photo :: Photo ( ref x ) => Some ( x . has_stickers ) , _ => None } } pub fn id ( & self ) -> & :: mtproto :: long { match self { & Photo :: Empty ( ref x ) => & x . id , & Photo :: Photo ( ref x ) => & x . id , } } pub fn sizes ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PhotoSize > > { match self { & Photo :: Photo ( ref x ) => Some ( & x . sizes ) , _ => None } } } impl :: BoxedSerialize for Photo { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Photo :: Empty ( ref x ) => ( :: ConstructorNumber ( 0x2331b22d ) , x ) , & Photo :: Photo ( ref x ) => ( :: ConstructorNumber ( 0x9288dd29 ) , x ) , } } } impl :: BoxedDeserialize for Photo { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x2331b22d ) , :: ConstructorNumber ( 0x9288dd29 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x2331b22d ) => Ok ( Photo :: Empty ( _de . read_bare :: < :: mtproto :: photo :: Empty > ( ) ? ) ) , :: ConstructorNumber ( 0x9288dd29 ) => Ok ( Photo :: Photo ( _de . read_bare :: < :: mtproto :: photo :: Photo > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `PhotoSize`\n\n```text\nphotoSizeEmpty#e17e23c type:string = PhotoSize;\n\nphotoSize#77bfb61b type:string location:FileLocation w:int h:int size:int = PhotoSize;\n\nphotoCachedSize#e9a734fa type:string location:FileLocation w:int h:int bytes:bytes = PhotoSize;\n```\n" ] pub enum PhotoSize { SizeEmpty ( :: mtproto :: photo :: SizeEmpty ) , Size ( :: mtproto :: photo :: Size ) , CachedSize ( :: mtproto :: photo :: CachedSize ) , } impl PhotoSize { pub fn bytes ( & self ) -> Option < & :: mtproto :: bytes > { match self { & PhotoSize :: CachedSize ( ref x ) => Some ( & x . bytes ) , _ => None } } pub fn h ( & self ) -> Option < & :: mtproto :: int > { match self { & PhotoSize :: Size ( ref x ) => Some ( & x . h ) , & PhotoSize :: CachedSize ( ref x ) => Some ( & x . h ) , _ => None } } pub fn location ( & self ) -> Option < & :: mtproto :: FileLocation > { match self { & PhotoSize :: Size ( ref x ) => Some ( & x . location ) , & PhotoSize :: CachedSize ( ref x ) => Some ( & x . location ) , _ => None } } pub fn size ( & self ) -> Option < & :: mtproto :: int > { match self { & PhotoSize :: Size ( ref x ) => Some ( & x . size ) , _ => None } } pub fn type_ ( & self ) -> & :: mtproto :: string { match self { & PhotoSize :: CachedSize ( ref x ) => & x . type_ , & PhotoSize :: SizeEmpty ( ref x ) => & x . type_ , & PhotoSize :: Size ( ref x ) => & x . type_ , } } pub fn w ( & self ) -> Option < & :: mtproto :: int > { match self { & PhotoSize :: Size ( ref x ) => Some ( & x . w ) , & PhotoSize :: CachedSize ( ref x ) => Some ( & x . w ) , _ => None } } } impl :: BoxedSerialize for PhotoSize { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & PhotoSize :: SizeEmpty ( ref x ) => ( :: ConstructorNumber ( 0x0e17e23c ) , x ) , & PhotoSize :: Size ( ref x ) => ( :: ConstructorNumber ( 0x77bfb61b ) , x ) , & PhotoSize :: CachedSize ( ref x ) => ( :: ConstructorNumber ( 0xe9a734fa ) , x ) , } } } impl :: BoxedDeserialize for PhotoSize { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x0e17e23c ) , :: ConstructorNumber ( 0x77bfb61b ) , :: ConstructorNumber ( 0xe9a734fa ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x0e17e23c ) => Ok ( PhotoSize :: SizeEmpty ( _de . read_bare :: < :: mtproto :: photo :: SizeEmpty > ( ) ? ) ) , :: ConstructorNumber ( 0x77bfb61b ) => Ok ( PhotoSize :: Size ( _de . read_bare :: < :: mtproto :: photo :: Size > ( ) ? ) ) , :: ConstructorNumber ( 0xe9a734fa ) => Ok ( PhotoSize :: CachedSize ( _de . read_bare :: < :: mtproto :: photo :: CachedSize > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `Pong`\n\n```text\npong#347773c5 msg_id:long ping_id:long = Pong;\n```\n" ] pub enum Pong { Pong ( :: mtproto :: pong :: Pong ) , } impl Pong { pub fn msg_id ( & self ) -> & :: mtproto :: long { match self { & Pong :: Pong ( ref x ) => & x . msg_id , } } pub fn ping_id ( & self ) -> & :: mtproto :: long { match self { & Pong :: Pong ( ref x ) => & x . ping_id , } } } impl :: BoxedSerialize for Pong { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Pong :: Pong ( ref x ) => ( :: ConstructorNumber ( 0x347773c5 ) , x ) , } } } impl :: BoxedDeserialize for Pong { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x347773c5 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x347773c5 ) => Ok ( Pong :: Pong ( _de . read_bare :: < :: mtproto :: pong :: Pong > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `PopularContact`\n\n```text\npopularContact#5ce14175 client_id:long importers:int = PopularContact;\n```\n" ] pub enum PopularContact { PopularContact ( :: mtproto :: popular_contact :: PopularContact ) , } impl PopularContact { pub fn client_id ( & self ) -> & :: mtproto :: long { match self { & PopularContact :: PopularContact ( ref x ) => & x . client_id , } } pub fn importers ( & self ) -> & :: mtproto :: int { match self { & PopularContact :: PopularContact ( ref x ) => & x . importers , } } } impl :: BoxedSerialize for PopularContact { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & PopularContact :: PopularContact ( ref x ) => ( :: ConstructorNumber ( 0x5ce14175 ) , x ) , } } } impl :: BoxedDeserialize for PopularContact { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x5ce14175 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x5ce14175 ) => Ok ( PopularContact :: PopularContact ( _de . read_bare :: < :: mtproto :: popular_contact :: PopularContact > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `PostAddress`\n\n```text\npostAddress#1e8caaeb street_line1:string street_line2:string city:string state:string country_iso2:string post_code:string = PostAddress;\n```\n" ] pub enum PostAddress { PostAddress ( :: mtproto :: post_address :: PostAddress ) , } impl PostAddress { pub fn city ( & self ) -> & :: mtproto :: string { match self { & PostAddress :: PostAddress ( ref x ) => & x . city , } } pub fn country_iso2 ( & self ) -> & :: mtproto :: string { match self { & PostAddress :: PostAddress ( ref x ) => & x . country_iso2 , } } pub fn post_code ( & self ) -> & :: mtproto :: string { match self { & PostAddress :: PostAddress ( ref x ) => & x . post_code , } } pub fn state ( & self ) -> & :: mtproto :: string { match self { & PostAddress :: PostAddress ( ref x ) => & x . state , } } pub fn street_line1 ( & self ) -> & :: mtproto :: string { match self { & PostAddress :: PostAddress ( ref x ) => & x . street_line1 , } } pub fn street_line2 ( & self ) -> & :: mtproto :: string { match self { & PostAddress :: PostAddress ( ref x ) => & x . street_line2 , } } } impl :: BoxedSerialize for PostAddress { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & PostAddress :: PostAddress ( ref x ) => ( :: ConstructorNumber ( 0x1e8caaeb ) , x ) , } } } impl :: BoxedDeserialize for PostAddress { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x1e8caaeb ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x1e8caaeb ) => Ok ( PostAddress :: PostAddress ( _de . read_bare :: < :: mtproto :: post_address :: PostAddress > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `PrivacyKey`\n\n```text\nprivacyKeyStatusTimestamp#bc2eab30 = PrivacyKey;\n\nprivacyKeyChatInvite#500e6dfa = PrivacyKey;\n\nprivacyKeyPhoneCall#3d662b7b = PrivacyKey;\n```\n" ] pub enum PrivacyKey { StatusTimestamp , ChatInvite , PhoneCall , } impl :: BoxedSerialize for PrivacyKey { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & PrivacyKey :: StatusTimestamp => ( :: ConstructorNumber ( 0xbc2eab30 ) , & ( ) ) , & PrivacyKey :: ChatInvite => ( :: ConstructorNumber ( 0x500e6dfa ) , & ( ) ) , & PrivacyKey :: PhoneCall => ( :: ConstructorNumber ( 0x3d662b7b ) , & ( ) ) , } } } impl :: BoxedDeserialize for PrivacyKey { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xbc2eab30 ) , :: ConstructorNumber ( 0x500e6dfa ) , :: ConstructorNumber ( 0x3d662b7b ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xbc2eab30 ) => Ok ( PrivacyKey :: StatusTimestamp ) , :: ConstructorNumber ( 0x500e6dfa ) => Ok ( PrivacyKey :: ChatInvite ) , :: ConstructorNumber ( 0x3d662b7b ) => Ok ( PrivacyKey :: PhoneCall ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `PrivacyRule`\n\n```text\nprivacyValueAllowContacts#fffe1bac = PrivacyRule;\n\nprivacyValueAllowAll#65427b82 = PrivacyRule;\n\nprivacyValueAllowUsers#4d5bbe0c users:Vector<int> = PrivacyRule;\n\nprivacyValueDisallowContacts#f888fa1a = PrivacyRule;\n\nprivacyValueDisallowAll#8b73e763 = PrivacyRule;\n\nprivacyValueDisallowUsers#c7f49b7 users:Vector<int> = PrivacyRule;\n```\n" ] pub enum PrivacyRule { AllowContacts , AllowAll , AllowUsers ( :: mtproto :: privacy_value :: AllowUsers ) , DisallowContacts , DisallowAll , DisallowUsers ( :: mtproto :: privacy_value :: DisallowUsers ) , } impl PrivacyRule { pub fn users ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > > { match self { & PrivacyRule :: AllowUsers ( ref x ) => Some ( & x . users ) , & PrivacyRule :: DisallowUsers ( ref x ) => Some ( & x . users ) , _ => None } } } impl :: BoxedSerialize for PrivacyRule { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & PrivacyRule :: AllowContacts => ( :: ConstructorNumber ( 0xfffe1bac ) , & ( ) ) , & PrivacyRule :: AllowAll => ( :: ConstructorNumber ( 0x65427b82 ) , & ( ) ) , & PrivacyRule :: AllowUsers ( ref x ) => ( :: ConstructorNumber ( 0x4d5bbe0c ) , x ) , & PrivacyRule :: DisallowContacts => ( :: ConstructorNumber ( 0xf888fa1a ) , & ( ) ) , & PrivacyRule :: DisallowAll => ( :: ConstructorNumber ( 0x8b73e763 ) , & ( ) ) , & PrivacyRule :: DisallowUsers ( ref x ) => ( :: ConstructorNumber ( 0x0c7f49b7 ) , x ) , } } } impl :: BoxedDeserialize for PrivacyRule { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xfffe1bac ) , :: ConstructorNumber ( 0x65427b82 ) , :: ConstructorNumber ( 0x4d5bbe0c ) , :: ConstructorNumber ( 0xf888fa1a ) , :: ConstructorNumber ( 0x8b73e763 ) , :: ConstructorNumber ( 0x0c7f49b7 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xfffe1bac ) => Ok ( PrivacyRule :: AllowContacts ) , :: ConstructorNumber ( 0x65427b82 ) => Ok ( PrivacyRule :: AllowAll ) , :: ConstructorNumber ( 0x4d5bbe0c ) => Ok ( PrivacyRule :: AllowUsers ( _de . read_bare :: < :: mtproto :: privacy_value :: AllowUsers > ( ) ? ) ) , :: ConstructorNumber ( 0xf888fa1a ) => Ok ( PrivacyRule :: DisallowContacts ) , :: ConstructorNumber ( 0x8b73e763 ) => Ok ( PrivacyRule :: DisallowAll ) , :: ConstructorNumber ( 0x0c7f49b7 ) => Ok ( PrivacyRule :: DisallowUsers ( _de . read_bare :: < :: mtproto :: privacy_value :: DisallowUsers > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `ReceivedNotifyMessage`\n\n```text\nreceivedNotifyMessage#a384b779 id:int flags:int = ReceivedNotifyMessage;\n```\n" ] pub enum ReceivedNotifyMessage { ReceivedNotifyMessage ( :: mtproto :: received_notify_message :: ReceivedNotifyMessage ) , } impl ReceivedNotifyMessage { pub fn flags ( & self ) -> & :: mtproto :: int { match self { & ReceivedNotifyMessage :: ReceivedNotifyMessage ( ref x ) => & x . flags , } } pub fn id ( & self ) -> & :: mtproto :: int { match self { & ReceivedNotifyMessage :: ReceivedNotifyMessage ( ref x ) => & x . id , } } } impl :: BoxedSerialize for ReceivedNotifyMessage { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ReceivedNotifyMessage :: ReceivedNotifyMessage ( ref x ) => ( :: ConstructorNumber ( 0xa384b779 ) , x ) , } } } impl :: BoxedDeserialize for ReceivedNotifyMessage { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xa384b779 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xa384b779 ) => Ok ( ReceivedNotifyMessage :: ReceivedNotifyMessage ( _de . read_bare :: < :: mtproto :: received_notify_message :: ReceivedNotifyMessage > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `RecentMeUrl`\n\n```text\nrecentMeUrlUnknown#46e1d13d url:string = RecentMeUrl;\n\nrecentMeUrlUser#8dbc3336 url:string user_id:int = RecentMeUrl;\n\nrecentMeUrlChat#a01b22f9 url:string chat_id:int = RecentMeUrl;\n\nrecentMeUrlChatInvite#eb49081d url:string chat_invite:ChatInvite = RecentMeUrl;\n\nrecentMeUrlStickerSet#bc0a57dc url:string set:StickerSetCovered = RecentMeUrl;\n```\n" ] pub enum RecentMeUrl { Unknown ( :: mtproto :: recent_me_url :: Unknown ) , User ( :: mtproto :: recent_me_url :: User ) , Chat ( :: mtproto :: recent_me_url :: Chat ) , ChatInvite ( :: mtproto :: recent_me_url :: ChatInvite ) , StickerSet ( :: mtproto :: recent_me_url :: StickerSet ) , } impl RecentMeUrl { pub fn chat_id ( & self ) -> Option < & :: mtproto :: int > { match self { & RecentMeUrl :: Chat ( ref x ) => Some ( & x . chat_id ) , _ => None } } pub fn chat_invite ( & self ) -> Option < & :: mtproto :: ChatInvite > { match self { & RecentMeUrl :: ChatInvite ( ref x ) => Some ( & x . chat_invite ) , _ => None } } pub fn set ( & self ) -> Option < & :: mtproto :: StickerSetCovered > { match self { & RecentMeUrl :: StickerSet ( ref x ) => Some ( & x . set ) , _ => None } } pub fn url ( & self ) -> & :: mtproto :: string { match self { & RecentMeUrl :: Unknown ( ref x ) => & x . url , & RecentMeUrl :: User ( ref x ) => & x . url , & RecentMeUrl :: Chat ( ref x ) => & x . url , & RecentMeUrl :: ChatInvite ( ref x ) => & x . url , & RecentMeUrl :: StickerSet ( ref x ) => & x . url , } } pub fn user_id ( & self ) -> Option < & :: mtproto :: int > { match self { & RecentMeUrl :: User ( ref x ) => Some ( & x . user_id ) , _ => None } } } impl :: BoxedSerialize for RecentMeUrl { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & RecentMeUrl :: Unknown ( ref x ) => ( :: ConstructorNumber ( 0x46e1d13d ) , x ) , & RecentMeUrl :: User ( ref x ) => ( :: ConstructorNumber ( 0x8dbc3336 ) , x ) , & RecentMeUrl :: Chat ( ref x ) => ( :: ConstructorNumber ( 0xa01b22f9 ) , x ) , & RecentMeUrl :: ChatInvite ( ref x ) => ( :: ConstructorNumber ( 0xeb49081d ) , x ) , & RecentMeUrl :: StickerSet ( ref x ) => ( :: ConstructorNumber ( 0xbc0a57dc ) , x ) , } } } impl :: BoxedDeserialize for RecentMeUrl { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x46e1d13d ) , :: ConstructorNumber ( 0x8dbc3336 ) , :: ConstructorNumber ( 0xa01b22f9 ) , :: ConstructorNumber ( 0xeb49081d ) , :: ConstructorNumber ( 0xbc0a57dc ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x46e1d13d ) => Ok ( RecentMeUrl :: Unknown ( _de . read_bare :: < :: mtproto :: recent_me_url :: Unknown > ( ) ? ) ) , :: ConstructorNumber ( 0x8dbc3336 ) => Ok ( RecentMeUrl :: User ( _de . read_bare :: < :: mtproto :: recent_me_url :: User > ( ) ? ) ) , :: ConstructorNumber ( 0xa01b22f9 ) => Ok ( RecentMeUrl :: Chat ( _de . read_bare :: < :: mtproto :: recent_me_url :: Chat > ( ) ? ) ) , :: ConstructorNumber ( 0xeb49081d ) => Ok ( RecentMeUrl :: ChatInvite ( _de . read_bare :: < :: mtproto :: recent_me_url :: ChatInvite > ( ) ? ) ) , :: ConstructorNumber ( 0xbc0a57dc ) => Ok ( RecentMeUrl :: StickerSet ( _de . read_bare :: < :: mtproto :: recent_me_url :: StickerSet > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `ReplyMarkup`\n\n```text\nreplyKeyboardHide#a03e5b85 flags:# selective:flags.2?true = ReplyMarkup;\n\nreplyKeyboardForceReply#f4108aa0 flags:# single_use:flags.1?true selective:flags.2?true = ReplyMarkup;\n\nreplyKeyboardMarkup#3502758c flags:# resize:flags.0?true single_use:flags.1?true selective:flags.2?true rows:Vector<KeyboardButtonRow> = ReplyMarkup;\n\nreplyInlineMarkup#48a30254 rows:Vector<KeyboardButtonRow> = ReplyMarkup;\n```\n" ] pub enum ReplyMarkup { KeyboardHide ( :: mtproto :: reply :: KeyboardHide ) , KeyboardForceReply ( :: mtproto :: reply :: KeyboardForceReply ) , KeyboardMarkup ( :: mtproto :: reply :: KeyboardMarkup ) , InlineMarkup ( :: mtproto :: reply :: InlineMarkup ) , } impl ReplyMarkup { pub fn resize ( & self ) -> Option < bool > { match self { & ReplyMarkup :: KeyboardMarkup ( ref x ) => Some ( x . resize ) , _ => None } } pub fn rows ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: KeyboardButtonRow > > { match self { & ReplyMarkup :: KeyboardMarkup ( ref x ) => Some ( & x . rows ) , & ReplyMarkup :: InlineMarkup ( ref x ) => Some ( & x . rows ) , _ => None } } pub fn selective ( & self ) -> Option < bool > { match self { & ReplyMarkup :: KeyboardMarkup ( ref x ) => Some ( x . selective ) , & ReplyMarkup :: KeyboardHide ( ref x ) => Some ( x . selective ) , & ReplyMarkup :: KeyboardForceReply ( ref x ) => Some ( x . selective ) , _ => None } } pub fn single_use ( & self ) -> Option < bool > { match self { & ReplyMarkup :: KeyboardForceReply ( ref x ) => Some ( x . single_use ) , & ReplyMarkup :: KeyboardMarkup ( ref x ) => Some ( x . single_use ) , _ => None } } } impl :: BoxedSerialize for ReplyMarkup { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ReplyMarkup :: KeyboardHide ( ref x ) => ( :: ConstructorNumber ( 0xa03e5b85 ) , x ) , & ReplyMarkup :: KeyboardForceReply ( ref x ) => ( :: ConstructorNumber ( 0xf4108aa0 ) , x ) , & ReplyMarkup :: KeyboardMarkup ( ref x ) => ( :: ConstructorNumber ( 0x3502758c ) , x ) , & ReplyMarkup :: InlineMarkup ( ref x ) => ( :: ConstructorNumber ( 0x48a30254 ) , x ) , } } } impl :: BoxedDeserialize for ReplyMarkup { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xa03e5b85 ) , :: ConstructorNumber ( 0xf4108aa0 ) , :: ConstructorNumber ( 0x3502758c ) , :: ConstructorNumber ( 0x48a30254 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xa03e5b85 ) => Ok ( ReplyMarkup :: KeyboardHide ( _de . read_bare :: < :: mtproto :: reply :: KeyboardHide > ( ) ? ) ) , :: ConstructorNumber ( 0xf4108aa0 ) => Ok ( ReplyMarkup :: KeyboardForceReply ( _de . read_bare :: < :: mtproto :: reply :: KeyboardForceReply > ( ) ? ) ) , :: ConstructorNumber ( 0x3502758c ) => Ok ( ReplyMarkup :: KeyboardMarkup ( _de . read_bare :: < :: mtproto :: reply :: KeyboardMarkup > ( ) ? ) ) , :: ConstructorNumber ( 0x48a30254 ) => Ok ( ReplyMarkup :: InlineMarkup ( _de . read_bare :: < :: mtproto :: reply :: InlineMarkup > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `ReportReason`\n\n```text\ninputReportReasonSpam#58dbcab8 = ReportReason;\n\ninputReportReasonViolence#1e22c78d = ReportReason;\n\ninputReportReasonPornography#2e59d922 = ReportReason;\n\ninputReportReasonOther#e1746d0a text:string = ReportReason;\n```\n" ] pub enum ReportReason { Spam , Violence , Pornography , Other ( :: mtproto :: input_report_reason :: Other ) , } impl ReportReason { pub fn text ( & self ) -> Option < & :: mtproto :: string > { match self { & ReportReason :: Other ( ref x ) => Some ( & x . text ) , _ => None } } } impl :: BoxedSerialize for ReportReason { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ReportReason :: Spam => ( :: ConstructorNumber ( 0x58dbcab8 ) , & ( ) ) , & ReportReason :: Violence => ( :: ConstructorNumber ( 0x1e22c78d ) , & ( ) ) , & ReportReason :: Pornography => ( :: ConstructorNumber ( 0x2e59d922 ) , & ( ) ) , & ReportReason :: Other ( ref x ) => ( :: ConstructorNumber ( 0xe1746d0a ) , x ) , } } } impl :: BoxedDeserialize for ReportReason { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x58dbcab8 ) , :: ConstructorNumber ( 0x1e22c78d ) , :: ConstructorNumber ( 0x2e59d922 ) , :: ConstructorNumber ( 0xe1746d0a ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x58dbcab8 ) => Ok ( ReportReason :: Spam ) , :: ConstructorNumber ( 0x1e22c78d ) => Ok ( ReportReason :: Violence ) , :: ConstructorNumber ( 0x2e59d922 ) => Ok ( ReportReason :: Pornography ) , :: ConstructorNumber ( 0xe1746d0a ) => Ok ( ReportReason :: Other ( _de . read_bare :: < :: mtproto :: input_report_reason :: Other > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `ResPQ`\n\n```text\nresPQ#05162463 nonce:int128 server_nonce:int128 pq:string server_public_key_fingerprints:Vector<long> = ResPQ;\n```\n" ] pub enum ResPQ { ResPQ ( :: mtproto :: res_pq :: ResPQ ) , } impl ResPQ { pub fn nonce ( & self ) -> & :: mtproto :: int128 { match self { & ResPQ :: ResPQ ( ref x ) => & x . nonce , } } pub fn pq ( & self ) -> & :: mtproto :: bytes { match self { & ResPQ :: ResPQ ( ref x ) => & x . pq , } } pub fn server_nonce ( & self ) -> & :: mtproto :: int128 { match self { & ResPQ :: ResPQ ( ref x ) => & x . server_nonce , } } pub fn server_public_key_fingerprints ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > { match self { & ResPQ :: ResPQ ( ref x ) => & x . server_public_key_fingerprints , } } } impl :: BoxedSerialize for ResPQ { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ResPQ :: ResPQ ( ref x ) => ( :: ConstructorNumber ( 0x05162463 ) , x ) , } } } impl :: BoxedDeserialize for ResPQ { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x05162463 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x05162463 ) => Ok ( ResPQ :: ResPQ ( _de . read_bare :: < :: mtproto :: res_pq :: ResPQ > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `RichText`\n\n```text\ntextEmpty#dc3d824f = RichText;\n\ntextPlain#744694e0 text:string = RichText;\n\ntextBold#6724abc4 text:RichText = RichText;\n\ntextItalic#d912a59c text:RichText = RichText;\n\ntextUnderline#c12622c4 text:RichText = RichText;\n\ntextStrike#9bf8bb95 text:RichText = RichText;\n\ntextFixed#6c3f19b9 text:RichText = RichText;\n\ntextUrl#3c2884c1 text:RichText url:string webpage_id:long = RichText;\n\ntextEmail#de5a0dd6 text:RichText email:string = RichText;\n\ntextConcat#7e6260d7 texts:Vector<RichText> = RichText;\n```\n" ] pub enum RichText { Empty , Plain ( :: mtproto :: text :: Plain ) , Bold ( :: mtproto :: text :: Bold ) , Italic ( :: mtproto :: text :: Italic ) , Underline ( :: mtproto :: text :: Underline ) , Strike ( :: mtproto :: text :: Strike ) , Fixed ( :: mtproto :: text :: Fixed ) , Url ( :: mtproto :: text :: Url ) , Email ( :: mtproto :: text :: Email ) , Concat ( :: mtproto :: text :: Concat ) , } impl RichText { pub fn email ( & self ) -> Option < & :: mtproto :: string > { match self { & RichText :: Email ( ref x ) => Some ( & x . email ) , _ => None } } pub fn texts ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: RichText > > { match self { & RichText :: Concat ( ref x ) => Some ( & x . texts ) , _ => None } } pub fn url ( & self ) -> Option < & :: mtproto :: string > { match self { & RichText :: Url ( ref x ) => Some ( & x . url ) , _ => None } } pub fn webpage_id ( & self ) -> Option < & :: mtproto :: long > { match self { & RichText :: Url ( ref x ) => Some ( & x . webpage_id ) , _ => None } } } impl :: BoxedSerialize for RichText { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & RichText :: Empty => ( :: ConstructorNumber ( 0xdc3d824f ) , & ( ) ) , & RichText :: Plain ( ref x ) => ( :: ConstructorNumber ( 0x744694e0 ) , x ) , & RichText :: Bold ( ref x ) => ( :: ConstructorNumber ( 0x6724abc4 ) , x ) , & RichText :: Italic ( ref x ) => ( :: ConstructorNumber ( 0xd912a59c ) , x ) , & RichText :: Underline ( ref x ) => ( :: ConstructorNumber ( 0xc12622c4 ) , x ) , & RichText :: Strike ( ref x ) => ( :: ConstructorNumber ( 0x9bf8bb95 ) , x ) , & RichText :: Fixed ( ref x ) => ( :: ConstructorNumber ( 0x6c3f19b9 ) , x ) , & RichText :: Url ( ref x ) => ( :: ConstructorNumber ( 0x3c2884c1 ) , x ) , & RichText :: Email ( ref x ) => ( :: ConstructorNumber ( 0xde5a0dd6 ) , x ) , & RichText :: Concat ( ref x ) => ( :: ConstructorNumber ( 0x7e6260d7 ) , x ) , } } } impl :: BoxedDeserialize for RichText { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xdc3d824f ) , :: ConstructorNumber ( 0x744694e0 ) , :: ConstructorNumber ( 0x6724abc4 ) , :: ConstructorNumber ( 0xd912a59c ) , :: ConstructorNumber ( 0xc12622c4 ) , :: ConstructorNumber ( 0x9bf8bb95 ) , :: ConstructorNumber ( 0x6c3f19b9 ) , :: ConstructorNumber ( 0x3c2884c1 ) , :: ConstructorNumber ( 0xde5a0dd6 ) , :: ConstructorNumber ( 0x7e6260d7 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xdc3d824f ) => Ok ( RichText :: Empty ) , :: ConstructorNumber ( 0x744694e0 ) => Ok ( RichText :: Plain ( _de . read_bare :: < :: mtproto :: text :: Plain > ( ) ? ) ) , :: ConstructorNumber ( 0x6724abc4 ) => Ok ( RichText :: Bold ( _de . read_bare :: < :: mtproto :: text :: Bold > ( ) ? ) ) , :: ConstructorNumber ( 0xd912a59c ) => Ok ( RichText :: Italic ( _de . read_bare :: < :: mtproto :: text :: Italic > ( ) ? ) ) , :: ConstructorNumber ( 0xc12622c4 ) => Ok ( RichText :: Underline ( _de . read_bare :: < :: mtproto :: text :: Underline > ( ) ? ) ) , :: ConstructorNumber ( 0x9bf8bb95 ) => Ok ( RichText :: Strike ( _de . read_bare :: < :: mtproto :: text :: Strike > ( ) ? ) ) , :: ConstructorNumber ( 0x6c3f19b9 ) => Ok ( RichText :: Fixed ( _de . read_bare :: < :: mtproto :: text :: Fixed > ( ) ? ) ) , :: ConstructorNumber ( 0x3c2884c1 ) => Ok ( RichText :: Url ( _de . read_bare :: < :: mtproto :: text :: Url > ( ) ? ) ) , :: ConstructorNumber ( 0xde5a0dd6 ) => Ok ( RichText :: Email ( _de . read_bare :: < :: mtproto :: text :: Email > ( ) ? ) ) , :: ConstructorNumber ( 0x7e6260d7 ) => Ok ( RichText :: Concat ( _de . read_bare :: < :: mtproto :: text :: Concat > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `RpcDropAnswer`\n\n```text\nrpc_answer_unknown#5e2ad36e = RpcDropAnswer;\n\nrpc_answer_dropped_running#cd78e586 = RpcDropAnswer;\n\nrpc_answer_dropped#a43ad8b7 msg_id:long seq_no:int bytes:int = RpcDropAnswer;\n```\n" ] pub enum RpcDropAnswer { Unknown , DroppedRunning , Dropped ( :: mtproto :: rpc_answer :: Dropped ) , } impl RpcDropAnswer { pub fn bytes ( & self ) -> Option < & :: mtproto :: int > { match self { & RpcDropAnswer :: Dropped ( ref x ) => Some ( & x . bytes ) , _ => None } } pub fn msg_id ( & self ) -> Option < & :: mtproto :: long > { match self { & RpcDropAnswer :: Dropped ( ref x ) => Some ( & x . msg_id ) , _ => None } } pub fn seq_no ( & self ) -> Option < & :: mtproto :: int > { match self { & RpcDropAnswer :: Dropped ( ref x ) => Some ( & x . seq_no ) , _ => None } } } impl :: BoxedSerialize for RpcDropAnswer { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & RpcDropAnswer :: Unknown => ( :: ConstructorNumber ( 0x5e2ad36e ) , & ( ) ) , & RpcDropAnswer :: DroppedRunning => ( :: ConstructorNumber ( 0xcd78e586 ) , & ( ) ) , & RpcDropAnswer :: Dropped ( ref x ) => ( :: ConstructorNumber ( 0xa43ad8b7 ) , x ) , } } } impl :: BoxedDeserialize for RpcDropAnswer { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x5e2ad36e ) , :: ConstructorNumber ( 0xcd78e586 ) , :: ConstructorNumber ( 0xa43ad8b7 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x5e2ad36e ) => Ok ( RpcDropAnswer :: Unknown ) , :: ConstructorNumber ( 0xcd78e586 ) => Ok ( RpcDropAnswer :: DroppedRunning ) , :: ConstructorNumber ( 0xa43ad8b7 ) => Ok ( RpcDropAnswer :: Dropped ( _de . read_bare :: < :: mtproto :: rpc_answer :: Dropped > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `RpcError`\n\n```text\nrpc_error#2144ca19 error_code:int error_message:string = RpcError;\n```\n" ] pub enum RpcError { RpcError ( :: mtproto :: rpc_error :: RpcError ) , } impl RpcError { pub fn error_code ( & self ) -> & :: mtproto :: int { match self { & RpcError :: RpcError ( ref x ) => & x . error_code , } } pub fn error_message ( & self ) -> & :: mtproto :: string { match self { & RpcError :: RpcError ( ref x ) => & x . error_message , } } } impl :: BoxedSerialize for RpcError { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & RpcError :: RpcError ( ref x ) => ( :: ConstructorNumber ( 0x2144ca19 ) , x ) , } } } impl :: BoxedDeserialize for RpcError { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x2144ca19 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x2144ca19 ) => Ok ( RpcError :: RpcError ( _de . read_bare :: < :: mtproto :: rpc_error :: RpcError > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `SendMessageAction`\n\n```text\nsendMessageTypingAction#16bf744e = SendMessageAction;\n\nsendMessageCancelAction#fd5ec8f5 = SendMessageAction;\n\nsendMessageRecordVideoAction#a187d66f = SendMessageAction;\n\nsendMessageUploadVideoAction#e9763aec progress:int = SendMessageAction;\n\nsendMessageRecordAudioAction#d52f73f7 = SendMessageAction;\n\nsendMessageUploadAudioAction#f351d7ab progress:int = SendMessageAction;\n\nsendMessageUploadPhotoAction#d1d34a26 progress:int = SendMessageAction;\n\nsendMessageUploadDocumentAction#aa0cd9e4 progress:int = SendMessageAction;\n\nsendMessageGeoLocationAction#176f8ba1 = SendMessageAction;\n\nsendMessageChooseContactAction#628cbc6f = SendMessageAction;\n\nsendMessageGamePlayAction#dd6a8f48 = SendMessageAction;\n\nsendMessageRecordRoundAction#88f27fbc = SendMessageAction;\n\nsendMessageUploadRoundAction#243e1c66 progress:int = SendMessageAction;\n```\n" ] pub enum SendMessageAction { TypingAction , CancelAction , RecordVideoAction , UploadVideoAction ( :: mtproto :: send_message :: UploadVideoAction ) , RecordAudioAction , UploadAudioAction ( :: mtproto :: send_message :: UploadAudioAction ) , UploadPhotoAction ( :: mtproto :: send_message :: UploadPhotoAction ) , UploadDocumentAction ( :: mtproto :: send_message :: UploadDocumentAction ) , GeoLocationAction , ChooseContactAction , GamePlayAction , RecordRoundAction , UploadRoundAction ( :: mtproto :: send_message :: UploadRoundAction ) , } impl SendMessageAction { pub fn progress ( & self ) -> Option < & :: mtproto :: int > { match self { & SendMessageAction :: UploadRoundAction ( ref x ) => Some ( & x . progress ) , & SendMessageAction :: UploadDocumentAction ( ref x ) => Some ( & x . progress ) , & SendMessageAction :: UploadAudioAction ( ref x ) => Some ( & x . progress ) , & SendMessageAction :: UploadPhotoAction ( ref x ) => Some ( & x . progress ) , & SendMessageAction :: UploadVideoAction ( ref x ) => Some ( & x . progress ) , _ => None } } } impl :: BoxedSerialize for SendMessageAction { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & SendMessageAction :: TypingAction => ( :: ConstructorNumber ( 0x16bf744e ) , & ( ) ) , & SendMessageAction :: CancelAction => ( :: ConstructorNumber ( 0xfd5ec8f5 ) , & ( ) ) , & SendMessageAction :: RecordVideoAction => ( :: ConstructorNumber ( 0xa187d66f ) , & ( ) ) , & SendMessageAction :: UploadVideoAction ( ref x ) => ( :: ConstructorNumber ( 0xe9763aec ) , x ) , & SendMessageAction :: RecordAudioAction => ( :: ConstructorNumber ( 0xd52f73f7 ) , & ( ) ) , & SendMessageAction :: UploadAudioAction ( ref x ) => ( :: ConstructorNumber ( 0xf351d7ab ) , x ) , & SendMessageAction :: UploadPhotoAction ( ref x ) => ( :: ConstructorNumber ( 0xd1d34a26 ) , x ) , & SendMessageAction :: UploadDocumentAction ( ref x ) => ( :: ConstructorNumber ( 0xaa0cd9e4 ) , x ) , & SendMessageAction :: GeoLocationAction => ( :: ConstructorNumber ( 0x176f8ba1 ) , & ( ) ) , & SendMessageAction :: ChooseContactAction => ( :: ConstructorNumber ( 0x628cbc6f ) , & ( ) ) , & SendMessageAction :: GamePlayAction => ( :: ConstructorNumber ( 0xdd6a8f48 ) , & ( ) ) , & SendMessageAction :: RecordRoundAction => ( :: ConstructorNumber ( 0x88f27fbc ) , & ( ) ) , & SendMessageAction :: UploadRoundAction ( ref x ) => ( :: ConstructorNumber ( 0x243e1c66 ) , x ) , } } } impl :: BoxedDeserialize for SendMessageAction { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x16bf744e ) , :: ConstructorNumber ( 0xfd5ec8f5 ) , :: ConstructorNumber ( 0xa187d66f ) , :: ConstructorNumber ( 0xe9763aec ) , :: ConstructorNumber ( 0xd52f73f7 ) , :: ConstructorNumber ( 0xf351d7ab ) , :: ConstructorNumber ( 0xd1d34a26 ) , :: ConstructorNumber ( 0xaa0cd9e4 ) , :: ConstructorNumber ( 0x176f8ba1 ) , :: ConstructorNumber ( 0x628cbc6f ) , :: ConstructorNumber ( 0xdd6a8f48 ) , :: ConstructorNumber ( 0x88f27fbc ) , :: ConstructorNumber ( 0x243e1c66 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x16bf744e ) => Ok ( SendMessageAction :: TypingAction ) , :: ConstructorNumber ( 0xfd5ec8f5 ) => Ok ( SendMessageAction :: CancelAction ) , :: ConstructorNumber ( 0xa187d66f ) => Ok ( SendMessageAction :: RecordVideoAction ) , :: ConstructorNumber ( 0xe9763aec ) => Ok ( SendMessageAction :: UploadVideoAction ( _de . read_bare :: < :: mtproto :: send_message :: UploadVideoAction > ( ) ? ) ) , :: ConstructorNumber ( 0xd52f73f7 ) => Ok ( SendMessageAction :: RecordAudioAction ) , :: ConstructorNumber ( 0xf351d7ab ) => Ok ( SendMessageAction :: UploadAudioAction ( _de . read_bare :: < :: mtproto :: send_message :: UploadAudioAction > ( ) ? ) ) , :: ConstructorNumber ( 0xd1d34a26 ) => Ok ( SendMessageAction :: UploadPhotoAction ( _de . read_bare :: < :: mtproto :: send_message :: UploadPhotoAction > ( ) ? ) ) , :: ConstructorNumber ( 0xaa0cd9e4 ) => Ok ( SendMessageAction :: UploadDocumentAction ( _de . read_bare :: < :: mtproto :: send_message :: UploadDocumentAction > ( ) ? ) ) , :: ConstructorNumber ( 0x176f8ba1 ) => Ok ( SendMessageAction :: GeoLocationAction ) , :: ConstructorNumber ( 0x628cbc6f ) => Ok ( SendMessageAction :: ChooseContactAction ) , :: ConstructorNumber ( 0xdd6a8f48 ) => Ok ( SendMessageAction :: GamePlayAction ) , :: ConstructorNumber ( 0x88f27fbc ) => Ok ( SendMessageAction :: RecordRoundAction ) , :: ConstructorNumber ( 0x243e1c66 ) => Ok ( SendMessageAction :: UploadRoundAction ( _de . read_bare :: < :: mtproto :: send_message :: UploadRoundAction > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `Server_DH_inner_data`\n\n```text\nserver_DH_inner_data#b5890dba nonce:int128 server_nonce:int128 g:int dh_prime:string g_a:string server_time:int = Server_DH_inner_data;\n```\n" ] pub enum ServerDHInnerData { ServerDHInnerData ( :: mtproto :: server_dh_inner_data :: ServerDHInnerData ) , } impl ServerDHInnerData { pub fn dh_prime ( & self ) -> & :: mtproto :: bytes { match self { & ServerDHInnerData :: ServerDHInnerData ( ref x ) => & x . dh_prime , } } pub fn g ( & self ) -> & :: mtproto :: int { match self { & ServerDHInnerData :: ServerDHInnerData ( ref x ) => & x . g , } } pub fn g_a ( & self ) -> & :: mtproto :: bytes { match self { & ServerDHInnerData :: ServerDHInnerData ( ref x ) => & x . g_a , } } pub fn nonce ( & self ) -> & :: mtproto :: int128 { match self { & ServerDHInnerData :: ServerDHInnerData ( ref x ) => & x . nonce , } } pub fn server_nonce ( & self ) -> & :: mtproto :: int128 { match self { & ServerDHInnerData :: ServerDHInnerData ( ref x ) => & x . server_nonce , } } pub fn server_time ( & self ) -> & :: mtproto :: int { match self { & ServerDHInnerData :: ServerDHInnerData ( ref x ) => & x . server_time , } } } impl :: BoxedSerialize for ServerDHInnerData { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ServerDHInnerData :: ServerDHInnerData ( ref x ) => ( :: ConstructorNumber ( 0xb5890dba ) , x ) , } } } impl :: BoxedDeserialize for ServerDHInnerData { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xb5890dba ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xb5890dba ) => Ok ( ServerDHInnerData :: ServerDHInnerData ( _de . read_bare :: < :: mtproto :: server_dh_inner_data :: ServerDHInnerData > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `Server_DH_Params`\n\n```text\nserver_DH_params_fail#79cb045d nonce:int128 server_nonce:int128 new_nonce_hash:int128 = Server_DH_Params;\n\nserver_DH_params_ok#d0e8075c nonce:int128 server_nonce:int128 encrypted_answer:string = Server_DH_Params;\n```\n" ] pub enum ServerDHParams { Fail ( :: mtproto :: server_dh_params :: Fail ) , Ok ( :: mtproto :: server_dh_params :: Ok ) , } impl ServerDHParams { pub fn encrypted_answer ( & self ) -> Option < & :: mtproto :: bytes > { match self { & ServerDHParams :: Ok ( ref x ) => Some ( & x . encrypted_answer ) , _ => None } } pub fn new_nonce_hash ( & self ) -> Option < & :: mtproto :: int128 > { match self { & ServerDHParams :: Fail ( ref x ) => Some ( & x . new_nonce_hash ) , _ => None } } pub fn nonce ( & self ) -> & :: mtproto :: int128 { match self { & ServerDHParams :: Ok ( ref x ) => & x . nonce , & ServerDHParams :: Fail ( ref x ) => & x . nonce , } } pub fn server_nonce ( & self ) -> & :: mtproto :: int128 { match self { & ServerDHParams :: Fail ( ref x ) => & x . server_nonce , & ServerDHParams :: Ok ( ref x ) => & x . server_nonce , } } } impl :: BoxedSerialize for ServerDHParams { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ServerDHParams :: Fail ( ref x ) => ( :: ConstructorNumber ( 0x79cb045d ) , x ) , & ServerDHParams :: Ok ( ref x ) => ( :: ConstructorNumber ( 0xd0e8075c ) , x ) , } } } impl :: BoxedDeserialize for ServerDHParams { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x79cb045d ) , :: ConstructorNumber ( 0xd0e8075c ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x79cb045d ) => Ok ( ServerDHParams :: Fail ( _de . read_bare :: < :: mtproto :: server_dh_params :: Fail > ( ) ? ) ) , :: ConstructorNumber ( 0xd0e8075c ) => Ok ( ServerDHParams :: Ok ( _de . read_bare :: < :: mtproto :: server_dh_params :: Ok > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `Set_client_DH_params_answer`\n\n```text\ndh_gen_ok#3bcbf734 nonce:int128 server_nonce:int128 new_nonce_hash1:int128 = Set_client_DH_params_answer;\n\ndh_gen_retry#46dc1fb9 nonce:int128 server_nonce:int128 new_nonce_hash2:int128 = Set_client_DH_params_answer;\n\ndh_gen_fail#a69dae02 nonce:int128 server_nonce:int128 new_nonce_hash3:int128 = Set_client_DH_params_answer;\n```\n" ] pub enum SetClientDHParamsAnswer { Ok ( :: mtproto :: dh_gen :: Ok ) , Retry ( :: mtproto :: dh_gen :: Retry ) , Fail ( :: mtproto :: dh_gen :: Fail ) , } impl SetClientDHParamsAnswer { pub fn new_nonce_hash1 ( & self ) -> Option < & :: mtproto :: int128 > { match self { & SetClientDHParamsAnswer :: Ok ( ref x ) => Some ( & x . new_nonce_hash1 ) , _ => None } } pub fn new_nonce_hash2 ( & self ) -> Option < & :: mtproto :: int128 > { match self { & SetClientDHParamsAnswer :: Retry ( ref x ) => Some ( & x . new_nonce_hash2 ) , _ => None } } pub fn new_nonce_hash3 ( & self ) -> Option < & :: mtproto :: int128 > { match self { & SetClientDHParamsAnswer :: Fail ( ref x ) => Some ( & x . new_nonce_hash3 ) , _ => None } } pub fn nonce ( & self ) -> & :: mtproto :: int128 { match self { & SetClientDHParamsAnswer :: Ok ( ref x ) => & x . nonce , & SetClientDHParamsAnswer :: Fail ( ref x ) => & x . nonce , & SetClientDHParamsAnswer :: Retry ( ref x ) => & x . nonce , } } pub fn server_nonce ( & self ) -> & :: mtproto :: int128 { match self { & SetClientDHParamsAnswer :: Fail ( ref x ) => & x . server_nonce , & SetClientDHParamsAnswer :: Ok ( ref x ) => & x . server_nonce , & SetClientDHParamsAnswer :: Retry ( ref x ) => & x . server_nonce , } } } impl :: BoxedSerialize for SetClientDHParamsAnswer { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & SetClientDHParamsAnswer :: Ok ( ref x ) => ( :: ConstructorNumber ( 0x3bcbf734 ) , x ) , & SetClientDHParamsAnswer :: Retry ( ref x ) => ( :: ConstructorNumber ( 0x46dc1fb9 ) , x ) , & SetClientDHParamsAnswer :: Fail ( ref x ) => ( :: ConstructorNumber ( 0xa69dae02 ) , x ) , } } } impl :: BoxedDeserialize for SetClientDHParamsAnswer { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x3bcbf734 ) , :: ConstructorNumber ( 0x46dc1fb9 ) , :: ConstructorNumber ( 0xa69dae02 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x3bcbf734 ) => Ok ( SetClientDHParamsAnswer :: Ok ( _de . read_bare :: < :: mtproto :: dh_gen :: Ok > ( ) ? ) ) , :: ConstructorNumber ( 0x46dc1fb9 ) => Ok ( SetClientDHParamsAnswer :: Retry ( _de . read_bare :: < :: mtproto :: dh_gen :: Retry > ( ) ? ) ) , :: ConstructorNumber ( 0xa69dae02 ) => Ok ( SetClientDHParamsAnswer :: Fail ( _de . read_bare :: < :: mtproto :: dh_gen :: Fail > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `ShippingOption`\n\n```text\nshippingOption#b6213cdf id:string title:string prices:Vector<LabeledPrice> = ShippingOption;\n```\n" ] pub enum ShippingOption { ShippingOption ( :: mtproto :: shipping_option :: ShippingOption ) , } impl ShippingOption { pub fn id ( & self ) -> & :: mtproto :: string { match self { & ShippingOption :: ShippingOption ( ref x ) => & x . id , } } pub fn prices ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: LabeledPrice > { match self { & ShippingOption :: ShippingOption ( ref x ) => & x . prices , } } pub fn title ( & self ) -> & :: mtproto :: string { match self { & ShippingOption :: ShippingOption ( ref x ) => & x . title , } } } impl :: BoxedSerialize for ShippingOption { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ShippingOption :: ShippingOption ( ref x ) => ( :: ConstructorNumber ( 0xb6213cdf ) , x ) , } } } impl :: BoxedDeserialize for ShippingOption { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xb6213cdf ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xb6213cdf ) => Ok ( ShippingOption :: ShippingOption ( _de . read_bare :: < :: mtproto :: shipping_option :: ShippingOption > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `StickerPack`\n\n```text\nstickerPack#12b299d4 emoticon:string documents:Vector<long> = StickerPack;\n```\n" ] pub enum StickerPack { StickerPack ( :: mtproto :: sticker_pack :: StickerPack ) , } impl StickerPack { pub fn documents ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > { match self { & StickerPack :: StickerPack ( ref x ) => & x . documents , } } pub fn emoticon ( & self ) -> & :: mtproto :: string { match self { & StickerPack :: StickerPack ( ref x ) => & x . emoticon , } } } impl :: BoxedSerialize for StickerPack { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & StickerPack :: StickerPack ( ref x ) => ( :: ConstructorNumber ( 0x12b299d4 ) , x ) , } } } impl :: BoxedDeserialize for StickerPack { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x12b299d4 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x12b299d4 ) => Ok ( StickerPack :: StickerPack ( _de . read_bare :: < :: mtproto :: sticker_pack :: StickerPack > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `StickerSet`\n\n```text\nstickerSet#cd303b41 flags:# installed:flags.0?true archived:flags.1?true official:flags.2?true masks:flags.3?true id:long access_hash:long title:string short_name:string count:int hash:int = StickerSet;\n```\n" ] pub enum StickerSet { StickerSet ( :: mtproto :: sticker_set :: StickerSet ) , } impl StickerSet { pub fn access_hash ( & self ) -> & :: mtproto :: long { match self { & StickerSet :: StickerSet ( ref x ) => & x . access_hash , } } pub fn archived ( & self ) -> bool { match self { & StickerSet :: StickerSet ( ref x ) => x . archived , } } pub fn count ( & self ) -> & :: mtproto :: int { match self { & StickerSet :: StickerSet ( ref x ) => & x . count , } } pub fn hash ( & self ) -> & :: mtproto :: int { match self { & StickerSet :: StickerSet ( ref x ) => & x . hash , } } pub fn id ( & self ) -> & :: mtproto :: long { match self { & StickerSet :: StickerSet ( ref x ) => & x . id , } } pub fn installed ( & self ) -> bool { match self { & StickerSet :: StickerSet ( ref x ) => x . installed , } } pub fn masks ( & self ) -> bool { match self { & StickerSet :: StickerSet ( ref x ) => x . masks , } } pub fn official ( & self ) -> bool { match self { & StickerSet :: StickerSet ( ref x ) => x . official , } } pub fn short_name ( & self ) -> & :: mtproto :: string { match self { & StickerSet :: StickerSet ( ref x ) => & x . short_name , } } pub fn title ( & self ) -> & :: mtproto :: string { match self { & StickerSet :: StickerSet ( ref x ) => & x . title , } } } impl :: BoxedSerialize for StickerSet { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & StickerSet :: StickerSet ( ref x ) => ( :: ConstructorNumber ( 0xcd303b41 ) , x ) , } } } impl :: BoxedDeserialize for StickerSet { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xcd303b41 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xcd303b41 ) => Ok ( StickerSet :: StickerSet ( _de . read_bare :: < :: mtproto :: sticker_set :: StickerSet > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `StickerSetCovered`\n\n```text\nstickerSetCovered#6410a5d2 set:StickerSet cover:Document = StickerSetCovered;\n\nstickerSetMultiCovered#3407e51b set:StickerSet covers:Vector<Document> = StickerSetCovered;\n```\n" ] pub enum StickerSetCovered { Covered ( :: mtproto :: sticker_set :: Covered ) , MultiCovered ( :: mtproto :: sticker_set :: MultiCovered ) , } impl StickerSetCovered { pub fn cover ( & self ) -> Option < & :: mtproto :: Document > { match self { & StickerSetCovered :: Covered ( ref x ) => Some ( & x . cover ) , _ => None } } pub fn covers ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Document > > { match self { & StickerSetCovered :: MultiCovered ( ref x ) => Some ( & x . covers ) , _ => None } } pub fn set ( & self ) -> & :: mtproto :: StickerSet { match self { & StickerSetCovered :: MultiCovered ( ref x ) => & x . set , & StickerSetCovered :: Covered ( ref x ) => & x . set , } } } impl :: BoxedSerialize for StickerSetCovered { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & StickerSetCovered :: Covered ( ref x ) => ( :: ConstructorNumber ( 0x6410a5d2 ) , x ) , & StickerSetCovered :: MultiCovered ( ref x ) => ( :: ConstructorNumber ( 0x3407e51b ) , x ) , } } } impl :: BoxedDeserialize for StickerSetCovered { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x6410a5d2 ) , :: ConstructorNumber ( 0x3407e51b ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x6410a5d2 ) => Ok ( StickerSetCovered :: Covered ( _de . read_bare :: < :: mtproto :: sticker_set :: Covered > ( ) ? ) ) , :: ConstructorNumber ( 0x3407e51b ) => Ok ( StickerSetCovered :: MultiCovered ( _de . read_bare :: < :: mtproto :: sticker_set :: MultiCovered > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `TopPeer`\n\n```text\ntopPeer#edcdc05b peer:Peer rating:double = TopPeer;\n```\n" ] pub enum TopPeer { TopPeer ( :: mtproto :: top_peer :: TopPeer ) , } impl TopPeer { pub fn peer ( & self ) -> & :: mtproto :: Peer { match self { & TopPeer :: TopPeer ( ref x ) => & x . peer , } } pub fn rating ( & self ) -> & :: mtproto :: double { match self { & TopPeer :: TopPeer ( ref x ) => & x . rating , } } } impl :: BoxedSerialize for TopPeer { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & TopPeer :: TopPeer ( ref x ) => ( :: ConstructorNumber ( 0xedcdc05b ) , x ) , } } } impl :: BoxedDeserialize for TopPeer { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xedcdc05b ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xedcdc05b ) => Ok ( TopPeer :: TopPeer ( _de . read_bare :: < :: mtproto :: top_peer :: TopPeer > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `TopPeerCategory`\n\n```text\ntopPeerCategoryBotsPM#ab661b5b = TopPeerCategory;\n\ntopPeerCategoryBotsInline#148677e2 = TopPeerCategory;\n\ntopPeerCategoryCorrespondents#637b7ed = TopPeerCategory;\n\ntopPeerCategoryGroups#bd17a14a = TopPeerCategory;\n\ntopPeerCategoryChannels#161d9628 = TopPeerCategory;\n\ntopPeerCategoryPhoneCalls#1e76a78c = TopPeerCategory;\n```\n" ] pub enum TopPeerCategory { BotsPM , BotsInline , Correspondents , Groups , Channels , PhoneCalls , } impl :: BoxedSerialize for TopPeerCategory { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & TopPeerCategory :: BotsPM => ( :: ConstructorNumber ( 0xab661b5b ) , & ( ) ) , & TopPeerCategory :: BotsInline => ( :: ConstructorNumber ( 0x148677e2 ) , & ( ) ) , & TopPeerCategory :: Correspondents => ( :: ConstructorNumber ( 0x0637b7ed ) , & ( ) ) , & TopPeerCategory :: Groups => ( :: ConstructorNumber ( 0xbd17a14a ) , & ( ) ) , & TopPeerCategory :: Channels => ( :: ConstructorNumber ( 0x161d9628 ) , & ( ) ) , & TopPeerCategory :: PhoneCalls => ( :: ConstructorNumber ( 0x1e76a78c ) , & ( ) ) , } } } impl :: BoxedDeserialize for TopPeerCategory { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xab661b5b ) , :: ConstructorNumber ( 0x148677e2 ) , :: ConstructorNumber ( 0x0637b7ed ) , :: ConstructorNumber ( 0xbd17a14a ) , :: ConstructorNumber ( 0x161d9628 ) , :: ConstructorNumber ( 0x1e76a78c ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xab661b5b ) => Ok ( TopPeerCategory :: BotsPM ) , :: ConstructorNumber ( 0x148677e2 ) => Ok ( TopPeerCategory :: BotsInline ) , :: ConstructorNumber ( 0x0637b7ed ) => Ok ( TopPeerCategory :: Correspondents ) , :: ConstructorNumber ( 0xbd17a14a ) => Ok ( TopPeerCategory :: Groups ) , :: ConstructorNumber ( 0x161d9628 ) => Ok ( TopPeerCategory :: Channels ) , :: ConstructorNumber ( 0x1e76a78c ) => Ok ( TopPeerCategory :: PhoneCalls ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `TopPeerCategoryPeers`\n\n```text\ntopPeerCategoryPeers#fb834291 category:TopPeerCategory count:int peers:Vector<TopPeer> = TopPeerCategoryPeers;\n```\n" ] pub enum TopPeerCategoryPeers { TopPeerCategoryPeers ( :: mtproto :: top_peer_category_peers :: TopPeerCategoryPeers ) , } impl TopPeerCategoryPeers { pub fn category ( & self ) -> & :: mtproto :: TopPeerCategory { match self { & TopPeerCategoryPeers :: TopPeerCategoryPeers ( ref x ) => & x . category , } } pub fn count ( & self ) -> & :: mtproto :: int { match self { & TopPeerCategoryPeers :: TopPeerCategoryPeers ( ref x ) => & x . count , } } pub fn peers ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: TopPeer > { match self { & TopPeerCategoryPeers :: TopPeerCategoryPeers ( ref x ) => & x . peers , } } } impl :: BoxedSerialize for TopPeerCategoryPeers { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & TopPeerCategoryPeers :: TopPeerCategoryPeers ( ref x ) => ( :: ConstructorNumber ( 0xfb834291 ) , x ) , } } } impl :: BoxedDeserialize for TopPeerCategoryPeers { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xfb834291 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xfb834291 ) => Ok ( TopPeerCategoryPeers :: TopPeerCategoryPeers ( _de . read_bare :: < :: mtproto :: top_peer_category_peers :: TopPeerCategoryPeers > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `Update`\n\n```text\nupdateNewMessage#1f2b0afd message:Message pts:int pts_count:int = Update;\n\nupdateMessageID#4e90bfd6 id:int random_id:long = Update;\n\nupdateDeleteMessages#a20db0e5 messages:Vector<int> pts:int pts_count:int = Update;\n\nupdateUserTyping#5c486927 user_id:int action:SendMessageAction = Update;\n\nupdateChatUserTyping#9a65ea1f chat_id:int user_id:int action:SendMessageAction = Update;\n\nupdateChatParticipants#7761198 participants:ChatParticipants = Update;\n\nupdateUserStatus#1bfbd823 user_id:int status:UserStatus = Update;\n\nupdateUserName#a7332b73 user_id:int first_name:string last_name:string username:string = Update;\n\nupdateUserPhoto#95313b0c user_id:int date:int photo:UserProfilePhoto previous:Bool = Update;\n\nupdateContactRegistered#2575bbb9 user_id:int date:int = Update;\n\nupdateContactLink#9d2e67c5 user_id:int my_link:ContactLink foreign_link:ContactLink = Update;\n\nupdateNewEncryptedMessage#12bcbd9a message:EncryptedMessage qts:int = Update;\n\nupdateEncryptedChatTyping#1710f156 chat_id:int = Update;\n\nupdateEncryption#b4a2e88d chat:EncryptedChat date:int = Update;\n\nupdateEncryptedMessagesRead#38fe25b7 chat_id:int max_date:int date:int = Update;\n\nupdateChatParticipantAdd#ea4b0e5c chat_id:int user_id:int inviter_id:int date:int version:int = Update;\n\nupdateChatParticipantDelete#6e5f8c22 chat_id:int user_id:int version:int = Update;\n\nupdateDcOptions#8e5e9873 dc_options:Vector<DcOption> = Update;\n\nupdateUserBlocked#80ece81a user_id:int blocked:Bool = Update;\n\nupdateNotifySettings#bec268ef peer:NotifyPeer notify_settings:PeerNotifySettings = Update;\n\nupdateServiceNotification#ebe46819 flags:# popup:flags.0?true inbox_date:flags.1?int type:string message:string media:MessageMedia entities:Vector<MessageEntity> = Update;\n\nupdatePrivacy#ee3b272a key:PrivacyKey rules:Vector<PrivacyRule> = Update;\n\nupdateUserPhone#12b9417b user_id:int phone:string = Update;\n\nupdateReadHistoryInbox#9961fd5c peer:Peer max_id:int pts:int pts_count:int = Update;\n\nupdateReadHistoryOutbox#2f2f21bf peer:Peer max_id:int pts:int pts_count:int = Update;\n\nupdateWebPage#7f891213 webpage:WebPage pts:int pts_count:int = Update;\n\nupdateReadMessagesContents#68c13933 messages:Vector<int> pts:int pts_count:int = Update;\n\nupdateChannelTooLong#eb0467fb flags:# channel_id:int pts:flags.0?int = Update;\n\nupdateChannel#b6d45656 channel_id:int = Update;\n\nupdateNewChannelMessage#62ba04d9 message:Message pts:int pts_count:int = Update;\n\nupdateReadChannelInbox#4214f37f channel_id:int max_id:int = Update;\n\nupdateDeleteChannelMessages#c37521c9 channel_id:int messages:Vector<int> pts:int pts_count:int = Update;\n\nupdateChannelMessageViews#98a12b4b channel_id:int id:int views:int = Update;\n\nupdateChatAdmins#6e947941 chat_id:int enabled:Bool version:int = Update;\n\nupdateChatParticipantAdmin#b6901959 chat_id:int user_id:int is_admin:Bool version:int = Update;\n\nupdateNewStickerSet#688a30aa stickerset:messages.StickerSet = Update;\n\nupdateStickerSetsOrder#bb2d201 flags:# masks:flags.0?true order:Vector<long> = Update;\n\nupdateStickerSets#43ae3dec = Update;\n\nupdateSavedGifs#9375341e = Update;\n\nupdateBotInlineQuery#54826690 flags:# query_id:long user_id:int query:string geo:flags.0?GeoPoint offset:string = Update;\n\nupdateBotInlineSend#e48f964 flags:# user_id:int query:string geo:flags.0?GeoPoint id:string msg_id:flags.1?InputBotInlineMessageID = Update;\n\nupdateEditChannelMessage#1b3f4df7 message:Message pts:int pts_count:int = Update;\n\nupdateChannelPinnedMessage#98592475 channel_id:int id:int = Update;\n\nupdateBotCallbackQuery#e73547e1 flags:# query_id:long user_id:int peer:Peer msg_id:int chat_instance:long data:flags.0?bytes game_short_name:flags.1?string = Update;\n\nupdateEditMessage#e40370a3 message:Message pts:int pts_count:int = Update;\n\nupdateInlineBotCallbackQuery#f9d27a5a flags:# query_id:long user_id:int msg_id:InputBotInlineMessageID chat_instance:long data:flags.0?bytes game_short_name:flags.1?string = Update;\n\nupdateReadChannelOutbox#25d6c9c7 channel_id:int max_id:int = Update;\n\nupdateDraftMessage#ee2bb969 peer:Peer draft:DraftMessage = Update;\n\nupdateReadFeaturedStickers#571d2742 = Update;\n\nupdateRecentStickers#9a422c20 = Update;\n\nupdateConfig#a229dd06 = Update;\n\nupdatePtsChanged#3354678f = Update;\n\nupdateChannelWebPage#40771900 channel_id:int webpage:WebPage pts:int pts_count:int = Update;\n\nupdateDialogPinned#d711a2cc flags:# pinned:flags.0?true peer:Peer = Update;\n\nupdatePinnedDialogs#d8caf68d flags:# order:flags.0?Vector<Peer> = Update;\n\nupdateBotWebhookJSON#8317c0c3 data:DataJSON = Update;\n\nupdateBotWebhookJSONQuery#9b9240a6 query_id:long data:DataJSON timeout:int = Update;\n\nupdateBotShippingQuery#e0cdc940 query_id:long user_id:int payload:bytes shipping_address:PostAddress = Update;\n\nupdateBotPrecheckoutQuery#5d2f3aa9 flags:# query_id:long user_id:int payload:bytes info:flags.0?PaymentRequestedInfo shipping_option_id:flags.1?string currency:string total_amount:long = Update;\n\nupdatePhoneCall#ab0f6b1e phone_call:PhoneCall = Update;\n\nupdateLangPackTooLong#10c2404b = Update;\n\nupdateLangPack#56022f4d difference:LangPackDifference = Update;\n\nupdateFavedStickers#e511996d = Update;\n\nupdateChannelReadMessagesContents#89893b45 channel_id:int messages:Vector<int> = Update;\n\nupdateContactsReset#7084a7be = Update;\n\nupdateChannelAvailableMessages#70db6837 channel_id:int available_min_id:int = Update;\n```\n" ] pub enum Update { NewMessage ( :: mtproto :: update :: NewMessage ) , MessageID ( :: mtproto :: update :: MessageID ) , DeleteMessages ( :: mtproto :: update :: DeleteMessages ) , UserTyping ( :: mtproto :: update :: UserTyping ) , ChatUserTyping ( :: mtproto :: update :: ChatUserTyping ) , ChatParticipants ( :: mtproto :: update :: ChatParticipants ) , UserStatus ( :: mtproto :: update :: UserStatus ) , UserName ( :: mtproto :: update :: UserName ) , UserPhoto ( :: mtproto :: update :: UserPhoto ) , ContactRegistered ( :: mtproto :: update :: ContactRegistered ) , ContactLink ( :: mtproto :: update :: ContactLink ) , NewEncryptedMessage ( :: mtproto :: update :: NewEncryptedMessage ) , EncryptedChatTyping ( :: mtproto :: update :: EncryptedChatTyping ) , Encryption ( :: mtproto :: update :: Encryption ) , EncryptedMessagesRead ( :: mtproto :: update :: EncryptedMessagesRead ) , ChatParticipantAdd ( :: mtproto :: update :: ChatParticipantAdd ) , ChatParticipantDelete ( :: mtproto :: update :: ChatParticipantDelete ) , DcOptions ( :: mtproto :: update :: DcOptions ) , UserBlocked ( :: mtproto :: update :: UserBlocked ) , NotifySettings ( :: mtproto :: update :: NotifySettings ) , ServiceNotification ( :: mtproto :: update :: ServiceNotification ) , Privacy ( :: mtproto :: update :: Privacy ) , UserPhone ( :: mtproto :: update :: UserPhone ) , ReadHistoryInbox ( :: mtproto :: update :: ReadHistoryInbox ) , ReadHistoryOutbox ( :: mtproto :: update :: ReadHistoryOutbox ) , WebPage ( :: mtproto :: update :: WebPage ) , ReadMessagesContents ( :: mtproto :: update :: ReadMessagesContents ) , ChannelTooLong ( :: mtproto :: update :: ChannelTooLong ) , Channel ( :: mtproto :: update :: Channel ) , NewChannelMessage ( :: mtproto :: update :: NewChannelMessage ) , ReadChannelInbox ( :: mtproto :: update :: ReadChannelInbox ) , DeleteChannelMessages ( :: mtproto :: update :: DeleteChannelMessages ) , ChannelMessageViews ( :: mtproto :: update :: ChannelMessageViews ) , ChatAdmins ( :: mtproto :: update :: ChatAdmins ) , ChatParticipantAdmin ( :: mtproto :: update :: ChatParticipantAdmin ) , NewStickerSet ( :: mtproto :: update :: NewStickerSet ) , StickerSetsOrder ( :: mtproto :: update :: StickerSetsOrder ) , StickerSets , SavedGifs , BotInlineQuery ( :: mtproto :: update :: BotInlineQuery ) , BotInlineSend ( :: mtproto :: update :: BotInlineSend ) , EditChannelMessage ( :: mtproto :: update :: EditChannelMessage ) , ChannelPinnedMessage ( :: mtproto :: update :: ChannelPinnedMessage ) , BotCallbackQuery ( :: mtproto :: update :: BotCallbackQuery ) , EditMessage ( :: mtproto :: update :: EditMessage ) , InlineBotCallbackQuery ( :: mtproto :: update :: InlineBotCallbackQuery ) , ReadChannelOutbox ( :: mtproto :: update :: ReadChannelOutbox ) , DraftMessage ( :: mtproto :: update :: DraftMessage ) , ReadFeaturedStickers , RecentStickers , Config , PtsChanged , ChannelWebPage ( :: mtproto :: update :: ChannelWebPage ) , DialogPinned ( :: mtproto :: update :: DialogPinned ) , PinnedDialogs ( :: mtproto :: update :: PinnedDialogs ) , BotWebhookJSON ( :: mtproto :: update :: BotWebhookJSON ) , BotWebhookJSONQuery ( :: mtproto :: update :: BotWebhookJSONQuery ) , BotShippingQuery ( :: mtproto :: update :: BotShippingQuery ) , BotPrecheckoutQuery ( :: mtproto :: update :: BotPrecheckoutQuery ) , PhoneCall ( :: mtproto :: update :: PhoneCall ) , LangPackTooLong , LangPack ( :: mtproto :: update :: LangPack ) , FavedStickers , ChannelReadMessagesContents ( :: mtproto :: update :: ChannelReadMessagesContents ) , ContactsReset , ChannelAvailableMessages ( :: mtproto :: update :: ChannelAvailableMessages ) , } impl Update { pub fn action ( & self ) -> Option < & :: mtproto :: SendMessageAction > { match self { & Update :: ChatUserTyping ( ref x ) => Some ( & x . action ) , & Update :: UserTyping ( ref x ) => Some ( & x . action ) , _ => None } } pub fn available_min_id ( & self ) -> Option < & :: mtproto :: int > { match self { & Update :: ChannelAvailableMessages ( ref x ) => Some ( & x . available_min_id ) , _ => None } } pub fn blocked ( & self ) -> Option < & :: mtproto :: Bool > { match self { & Update :: UserBlocked ( ref x ) => Some ( & x . blocked ) , _ => None } } pub fn channel_id ( & self ) -> Option < & :: mtproto :: int > { match self { & Update :: DeleteChannelMessages ( ref x ) => Some ( & x . channel_id ) , & Update :: ChannelPinnedMessage ( ref x ) => Some ( & x . channel_id ) , & Update :: ChannelWebPage ( ref x ) => Some ( & x . channel_id ) , & Update :: ChannelAvailableMessages ( ref x ) => Some ( & x . channel_id ) , & Update :: Channel ( ref x ) => Some ( & x . channel_id ) , & Update :: ReadChannelInbox ( ref x ) => Some ( & x . channel_id ) , & Update :: ChannelReadMessagesContents ( ref x ) => Some ( & x . channel_id ) , & Update :: ChannelMessageViews ( ref x ) => Some ( & x . channel_id ) , & Update :: ReadChannelOutbox ( ref x ) => Some ( & x . channel_id ) , & Update :: ChannelTooLong ( ref x ) => Some ( & x . channel_id ) , _ => None } } pub fn chat ( & self ) -> Option < & :: mtproto :: EncryptedChat > { match self { & Update :: Encryption ( ref x ) => Some ( & x . chat ) , _ => None } } pub fn chat_id ( & self ) -> Option < & :: mtproto :: int > { match self { & Update :: ChatUserTyping ( ref x ) => Some ( & x . chat_id ) , & Update :: EncryptedMessagesRead ( ref x ) => Some ( & x . chat_id ) , & Update :: ChatParticipantDelete ( ref x ) => Some ( & x . chat_id ) , & Update :: ChatAdmins ( ref x ) => Some ( & x . chat_id ) , & Update :: ChatParticipantAdmin ( ref x ) => Some ( & x . chat_id ) , & Update :: ChatParticipantAdd ( ref x ) => Some ( & x . chat_id ) , & Update :: EncryptedChatTyping ( ref x ) => Some ( & x . chat_id ) , _ => None } } pub fn chat_instance ( & self ) -> Option < & :: mtproto :: long > { match self { & Update :: BotCallbackQuery ( ref x ) => Some ( & x . chat_instance ) , & Update :: InlineBotCallbackQuery ( ref x ) => Some ( & x . chat_instance ) , _ => None } } pub fn currency ( & self ) -> Option < & :: mtproto :: string > { match self { & Update :: BotPrecheckoutQuery ( ref x ) => Some ( & x . currency ) , _ => None } } pub fn date ( & self ) -> Option < & :: mtproto :: int > { match self { & Update :: UserPhoto ( ref x ) => Some ( & x . date ) , & Update :: EncryptedMessagesRead ( ref x ) => Some ( & x . date ) , & Update :: ContactRegistered ( ref x ) => Some ( & x . date ) , & Update :: Encryption ( ref x ) => Some ( & x . date ) , & Update :: ChatParticipantAdd ( ref x ) => Some ( & x . date ) , _ => None } } pub fn dc_options ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: DcOption > > { match self { & Update :: DcOptions ( ref x ) => Some ( & x . dc_options ) , _ => None } } pub fn difference ( & self ) -> Option < & :: mtproto :: LangPackDifference > { match self { & Update :: LangPack ( ref x ) => Some ( & x . difference ) , _ => None } } pub fn draft ( & self ) -> Option < & :: mtproto :: DraftMessage > { match self { & Update :: DraftMessage ( ref x ) => Some ( & x . draft ) , _ => None } } pub fn enabled ( & self ) -> Option < & :: mtproto :: Bool > { match self { & Update :: ChatAdmins ( ref x ) => Some ( & x . enabled ) , _ => None } } pub fn entities ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: MessageEntity > > { match self { & Update :: ServiceNotification ( ref x ) => Some ( & x . entities ) , _ => None } } pub fn first_name ( & self ) -> Option < & :: mtproto :: string > { match self { & Update :: UserName ( ref x ) => Some ( & x . first_name ) , _ => None } } pub fn foreign_link ( & self ) -> Option < & :: mtproto :: ContactLink > { match self { & Update :: ContactLink ( ref x ) => Some ( & x . foreign_link ) , _ => None } } pub fn game_short_name ( & self ) -> Option < & :: mtproto :: string > { match self { & Update :: InlineBotCallbackQuery ( ref x ) => x . game_short_name . as_ref ( ) , & Update :: BotCallbackQuery ( ref x ) => x . game_short_name . as_ref ( ) , _ => None } } pub fn geo ( & self ) -> Option < & :: mtproto :: GeoPoint > { match self { & Update :: BotInlineQuery ( ref x ) => x . geo . as_ref ( ) , & Update :: BotInlineSend ( ref x ) => x . geo . as_ref ( ) , _ => None } } pub fn inbox_date ( & self ) -> Option < & :: mtproto :: int > { match self { & Update :: ServiceNotification ( ref x ) => x . inbox_date . as_ref ( ) , _ => None } } pub fn info ( & self ) -> Option < & :: mtproto :: PaymentRequestedInfo > { match self { & Update :: BotPrecheckoutQuery ( ref x ) => x . info . as_ref ( ) , _ => None } } pub fn inviter_id ( & self ) -> Option < & :: mtproto :: int > { match self { & Update :: ChatParticipantAdd ( ref x ) => Some ( & x . inviter_id ) , _ => None } } pub fn is_admin ( & self ) -> Option < & :: mtproto :: Bool > { match self { & Update :: ChatParticipantAdmin ( ref x ) => Some ( & x . is_admin ) , _ => None } } pub fn key ( & self ) -> Option < & :: mtproto :: PrivacyKey > { match self { & Update :: Privacy ( ref x ) => Some ( & x . key ) , _ => None } } pub fn last_name ( & self ) -> Option < & :: mtproto :: string > { match self { & Update :: UserName ( ref x ) => Some ( & x . last_name ) , _ => None } } pub fn masks ( & self ) -> Option < bool > { match self { & Update :: StickerSetsOrder ( ref x ) => Some ( x . masks ) , _ => None } } pub fn max_date ( & self ) -> Option < & :: mtproto :: int > { match self { & Update :: EncryptedMessagesRead ( ref x ) => Some ( & x . max_date ) , _ => None } } pub fn max_id ( & self ) -> Option < & :: mtproto :: int > { match self { & Update :: ReadHistoryOutbox ( ref x ) => Some ( & x . max_id ) , & Update :: ReadHistoryInbox ( ref x ) => Some ( & x . max_id ) , & Update :: ReadChannelOutbox ( ref x ) => Some ( & x . max_id ) , & Update :: ReadChannelInbox ( ref x ) => Some ( & x . max_id ) , _ => None } } pub fn media ( & self ) -> Option < & :: mtproto :: MessageMedia > { match self { & Update :: ServiceNotification ( ref x ) => Some ( & x . media ) , _ => None } } pub fn messages ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > > { match self { & Update :: DeleteChannelMessages ( ref x ) => Some ( & x . messages ) , & Update :: ReadMessagesContents ( ref x ) => Some ( & x . messages ) , & Update :: DeleteMessages ( ref x ) => Some ( & x . messages ) , & Update :: ChannelReadMessagesContents ( ref x ) => Some ( & x . messages ) , _ => None } } pub fn my_link ( & self ) -> Option < & :: mtproto :: ContactLink > { match self { & Update :: ContactLink ( ref x ) => Some ( & x . my_link ) , _ => None } } pub fn notify_settings ( & self ) -> Option < & :: mtproto :: PeerNotifySettings > { match self { & Update :: NotifySettings ( ref x ) => Some ( & x . notify_settings ) , _ => None } } pub fn offset ( & self ) -> Option < & :: mtproto :: string > { match self { & Update :: BotInlineQuery ( ref x ) => Some ( & x . offset ) , _ => None } } pub fn participants ( & self ) -> Option < & :: mtproto :: ChatParticipants > { match self { & Update :: ChatParticipants ( ref x ) => Some ( & x . participants ) , _ => None } } pub fn payload ( & self ) -> Option < & :: mtproto :: bytes > { match self { & Update :: BotShippingQuery ( ref x ) => Some ( & x . payload ) , & Update :: BotPrecheckoutQuery ( ref x ) => Some ( & x . payload ) , _ => None } } pub fn phone ( & self ) -> Option < & :: mtproto :: string > { match self { & Update :: UserPhone ( ref x ) => Some ( & x . phone ) , _ => None } } pub fn phone_call ( & self ) -> Option < & :: mtproto :: PhoneCall > { match self { & Update :: PhoneCall ( ref x ) => Some ( & x . phone_call ) , _ => None } } pub fn photo ( & self ) -> Option < & :: mtproto :: UserProfilePhoto > { match self { & Update :: UserPhoto ( ref x ) => Some ( & x . photo ) , _ => None } } pub fn pinned ( & self ) -> Option < bool > { match self { & Update :: DialogPinned ( ref x ) => Some ( x . pinned ) , _ => None } } pub fn popup ( & self ) -> Option < bool > { match self { & Update :: ServiceNotification ( ref x ) => Some ( x . popup ) , _ => None } } pub fn previous ( & self ) -> Option < & :: mtproto :: Bool > { match self { & Update :: UserPhoto ( ref x ) => Some ( & x . previous ) , _ => None } } pub fn pts_count ( & self ) -> Option < & :: mtproto :: int > { match self { & Update :: ReadMessagesContents ( ref x ) => Some ( & x . pts_count ) , & Update :: EditChannelMessage ( ref x ) => Some ( & x . pts_count ) , & Update :: WebPage ( ref x ) => Some ( & x . pts_count ) , & Update :: NewChannelMessage ( ref x ) => Some ( & x . pts_count ) , & Update :: DeleteChannelMessages ( ref x ) => Some ( & x . pts_count ) , & Update :: DeleteMessages ( ref x ) => Some ( & x . pts_count ) , & Update :: NewMessage ( ref x ) => Some ( & x . pts_count ) , & Update :: ReadHistoryInbox ( ref x ) => Some ( & x . pts_count ) , & Update :: EditMessage ( ref x ) => Some ( & x . pts_count ) , & Update :: ReadHistoryOutbox ( ref x ) => Some ( & x . pts_count ) , & Update :: ChannelWebPage ( ref x ) => Some ( & x . pts_count ) , _ => None } } pub fn qts ( & self ) -> Option < & :: mtproto :: int > { match self { & Update :: NewEncryptedMessage ( ref x ) => Some ( & x . qts ) , _ => None } } pub fn query ( & self ) -> Option < & :: mtproto :: string > { match self { & Update :: BotInlineSend ( ref x ) => Some ( & x . query ) , & Update :: BotInlineQuery ( ref x ) => Some ( & x . query ) , _ => None } } pub fn query_id ( & self ) -> Option < & :: mtproto :: long > { match self { & Update :: BotCallbackQuery ( ref x ) => Some ( & x . query_id ) , & Update :: BotWebhookJSONQuery ( ref x ) => Some ( & x . query_id ) , & Update :: BotPrecheckoutQuery ( ref x ) => Some ( & x . query_id ) , & Update :: BotShippingQuery ( ref x ) => Some ( & x . query_id ) , & Update :: BotInlineQuery ( ref x ) => Some ( & x . query_id ) , & Update :: InlineBotCallbackQuery ( ref x ) => Some ( & x . query_id ) , _ => None } } pub fn random_id ( & self ) -> Option < & :: mtproto :: long > { match self { & Update :: MessageID ( ref x ) => Some ( & x . random_id ) , _ => None } } pub fn rules ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PrivacyRule > > { match self { & Update :: Privacy ( ref x ) => Some ( & x . rules ) , _ => None } } pub fn shipping_address ( & self ) -> Option < & :: mtproto :: PostAddress > { match self { & Update :: BotShippingQuery ( ref x ) => Some ( & x . shipping_address ) , _ => None } } pub fn shipping_option_id ( & self ) -> Option < & :: mtproto :: string > { match self { & Update :: BotPrecheckoutQuery ( ref x ) => x . shipping_option_id . as_ref ( ) , _ => None } } pub fn status ( & self ) -> Option < & :: mtproto :: UserStatus > { match self { & Update :: UserStatus ( ref x ) => Some ( & x . status ) , _ => None } } pub fn stickerset ( & self ) -> Option < & :: mtproto :: messages :: StickerSet > { match self { & Update :: NewStickerSet ( ref x ) => Some ( & x . stickerset ) , _ => None } } pub fn timeout ( & self ) -> Option < & :: mtproto :: int > { match self { & Update :: BotWebhookJSONQuery ( ref x ) => Some ( & x . timeout ) , _ => None } } pub fn total_amount ( & self ) -> Option < & :: mtproto :: long > { match self { & Update :: BotPrecheckoutQuery ( ref x ) => Some ( & x . total_amount ) , _ => None } } pub fn type_ ( & self ) -> Option < & :: mtproto :: string > { match self { & Update :: ServiceNotification ( ref x ) => Some ( & x . type_ ) , _ => None } } pub fn user_id ( & self ) -> Option < & :: mtproto :: int > { match self { & Update :: UserName ( ref x ) => Some ( & x . user_id ) , & Update :: ContactRegistered ( ref x ) => Some ( & x . user_id ) , & Update :: ContactLink ( ref x ) => Some ( & x . user_id ) , & Update :: BotShippingQuery ( ref x ) => Some ( & x . user_id ) , & Update :: ChatParticipantDelete ( ref x ) => Some ( & x . user_id ) , & Update :: BotPrecheckoutQuery ( ref x ) => Some ( & x . user_id ) , & Update :: ChatParticipantAdmin ( ref x ) => Some ( & x . user_id ) , & Update :: ChatUserTyping ( ref x ) => Some ( & x . user_id ) , & Update :: UserPhone ( ref x ) => Some ( & x . user_id ) , & Update :: UserTyping ( ref x ) => Some ( & x . user_id ) , & Update :: BotCallbackQuery ( ref x ) => Some ( & x . user_id ) , & Update :: BotInlineSend ( ref x ) => Some ( & x . user_id ) , & Update :: BotInlineQuery ( ref x ) => Some ( & x . user_id ) , & Update :: InlineBotCallbackQuery ( ref x ) => Some ( & x . user_id ) , & Update :: UserBlocked ( ref x ) => Some ( & x . user_id ) , & Update :: UserStatus ( ref x ) => Some ( & x . user_id ) , & Update :: ChatParticipantAdd ( ref x ) => Some ( & x . user_id ) , & Update :: UserPhoto ( ref x ) => Some ( & x . user_id ) , _ => None } } pub fn username ( & self ) -> Option < & :: mtproto :: string > { match self { & Update :: UserName ( ref x ) => Some ( & x . username ) , _ => None } } pub fn version ( & self ) -> Option < & :: mtproto :: int > { match self { & Update :: ChatParticipantAdd ( ref x ) => Some ( & x . version ) , & Update :: ChatParticipantAdmin ( ref x ) => Some ( & x . version ) , & Update :: ChatParticipantDelete ( ref x ) => Some ( & x . version ) , & Update :: ChatAdmins ( ref x ) => Some ( & x . version ) , _ => None } } pub fn views ( & self ) -> Option < & :: mtproto :: int > { match self { & Update :: ChannelMessageViews ( ref x ) => Some ( & x . views ) , _ => None } } pub fn webpage ( & self ) -> Option < & :: mtproto :: WebPage > { match self { & Update :: ChannelWebPage ( ref x ) => Some ( & x . webpage ) , & Update :: WebPage ( ref x ) => Some ( & x . webpage ) , _ => None } } } impl :: BoxedSerialize for Update { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Update :: NewMessage ( ref x ) => ( :: ConstructorNumber ( 0x1f2b0afd ) , x ) , & Update :: MessageID ( ref x ) => ( :: ConstructorNumber ( 0x4e90bfd6 ) , x ) , & Update :: DeleteMessages ( ref x ) => ( :: ConstructorNumber ( 0xa20db0e5 ) , x ) , & Update :: UserTyping ( ref x ) => ( :: ConstructorNumber ( 0x5c486927 ) , x ) , & Update :: ChatUserTyping ( ref x ) => ( :: ConstructorNumber ( 0x9a65ea1f ) , x ) , & Update :: ChatParticipants ( ref x ) => ( :: ConstructorNumber ( 0x07761198 ) , x ) , & Update :: UserStatus ( ref x ) => ( :: ConstructorNumber ( 0x1bfbd823 ) , x ) , & Update :: UserName ( ref x ) => ( :: ConstructorNumber ( 0xa7332b73 ) , x ) , & Update :: UserPhoto ( ref x ) => ( :: ConstructorNumber ( 0x95313b0c ) , x ) , & Update :: ContactRegistered ( ref x ) => ( :: ConstructorNumber ( 0x2575bbb9 ) , x ) , & Update :: ContactLink ( ref x ) => ( :: ConstructorNumber ( 0x9d2e67c5 ) , x ) , & Update :: NewEncryptedMessage ( ref x ) => ( :: ConstructorNumber ( 0x12bcbd9a ) , x ) , & Update :: EncryptedChatTyping ( ref x ) => ( :: ConstructorNumber ( 0x1710f156 ) , x ) , & Update :: Encryption ( ref x ) => ( :: ConstructorNumber ( 0xb4a2e88d ) , x ) , & Update :: EncryptedMessagesRead ( ref x ) => ( :: ConstructorNumber ( 0x38fe25b7 ) , x ) , & Update :: ChatParticipantAdd ( ref x ) => ( :: ConstructorNumber ( 0xea4b0e5c ) , x ) , & Update :: ChatParticipantDelete ( ref x ) => ( :: ConstructorNumber ( 0x6e5f8c22 ) , x ) , & Update :: DcOptions ( ref x ) => ( :: ConstructorNumber ( 0x8e5e9873 ) , x ) , & Update :: UserBlocked ( ref x ) => ( :: ConstructorNumber ( 0x80ece81a ) , x ) , & Update :: NotifySettings ( ref x ) => ( :: ConstructorNumber ( 0xbec268ef ) , x ) , & Update :: ServiceNotification ( ref x ) => ( :: ConstructorNumber ( 0xebe46819 ) , x ) , & Update :: Privacy ( ref x ) => ( :: ConstructorNumber ( 0xee3b272a ) , x ) , & Update :: UserPhone ( ref x ) => ( :: ConstructorNumber ( 0x12b9417b ) , x ) , & Update :: ReadHistoryInbox ( ref x ) => ( :: ConstructorNumber ( 0x9961fd5c ) , x ) , & Update :: ReadHistoryOutbox ( ref x ) => ( :: ConstructorNumber ( 0x2f2f21bf ) , x ) , & Update :: WebPage ( ref x ) => ( :: ConstructorNumber ( 0x7f891213 ) , x ) , & Update :: ReadMessagesContents ( ref x ) => ( :: ConstructorNumber ( 0x68c13933 ) , x ) , & Update :: ChannelTooLong ( ref x ) => ( :: ConstructorNumber ( 0xeb0467fb ) , x ) , & Update :: Channel ( ref x ) => ( :: ConstructorNumber ( 0xb6d45656 ) , x ) , & Update :: NewChannelMessage ( ref x ) => ( :: ConstructorNumber ( 0x62ba04d9 ) , x ) , & Update :: ReadChannelInbox ( ref x ) => ( :: ConstructorNumber ( 0x4214f37f ) , x ) , & Update :: DeleteChannelMessages ( ref x ) => ( :: ConstructorNumber ( 0xc37521c9 ) , x ) , & Update :: ChannelMessageViews ( ref x ) => ( :: ConstructorNumber ( 0x98a12b4b ) , x ) , & Update :: ChatAdmins ( ref x ) => ( :: ConstructorNumber ( 0x6e947941 ) , x ) , & Update :: ChatParticipantAdmin ( ref x ) => ( :: ConstructorNumber ( 0xb6901959 ) , x ) , & Update :: NewStickerSet ( ref x ) => ( :: ConstructorNumber ( 0x688a30aa ) , x ) , & Update :: StickerSetsOrder ( ref x ) => ( :: ConstructorNumber ( 0x0bb2d201 ) , x ) , & Update :: StickerSets => ( :: ConstructorNumber ( 0x43ae3dec ) , & ( ) ) , & Update :: SavedGifs => ( :: ConstructorNumber ( 0x9375341e ) , & ( ) ) , & Update :: BotInlineQuery ( ref x ) => ( :: ConstructorNumber ( 0x54826690 ) , x ) , & Update :: BotInlineSend ( ref x ) => ( :: ConstructorNumber ( 0x0e48f964 ) , x ) , & Update :: EditChannelMessage ( ref x ) => ( :: ConstructorNumber ( 0x1b3f4df7 ) , x ) , & Update :: ChannelPinnedMessage ( ref x ) => ( :: ConstructorNumber ( 0x98592475 ) , x ) , & Update :: BotCallbackQuery ( ref x ) => ( :: ConstructorNumber ( 0xe73547e1 ) , x ) , & Update :: EditMessage ( ref x ) => ( :: ConstructorNumber ( 0xe40370a3 ) , x ) , & Update :: InlineBotCallbackQuery ( ref x ) => ( :: ConstructorNumber ( 0xf9d27a5a ) , x ) , & Update :: ReadChannelOutbox ( ref x ) => ( :: ConstructorNumber ( 0x25d6c9c7 ) , x ) , & Update :: DraftMessage ( ref x ) => ( :: ConstructorNumber ( 0xee2bb969 ) , x ) , & Update :: ReadFeaturedStickers => ( :: ConstructorNumber ( 0x571d2742 ) , & ( ) ) , & Update :: RecentStickers => ( :: ConstructorNumber ( 0x9a422c20 ) , & ( ) ) , & Update :: Config => ( :: ConstructorNumber ( 0xa229dd06 ) , & ( ) ) , & Update :: PtsChanged => ( :: ConstructorNumber ( 0x3354678f ) , & ( ) ) , & Update :: ChannelWebPage ( ref x ) => ( :: ConstructorNumber ( 0x40771900 ) , x ) , & Update :: DialogPinned ( ref x ) => ( :: ConstructorNumber ( 0xd711a2cc ) , x ) , & Update :: PinnedDialogs ( ref x ) => ( :: ConstructorNumber ( 0xd8caf68d ) , x ) , & Update :: BotWebhookJSON ( ref x ) => ( :: ConstructorNumber ( 0x8317c0c3 ) , x ) , & Update :: BotWebhookJSONQuery ( ref x ) => ( :: ConstructorNumber ( 0x9b9240a6 ) , x ) , & Update :: BotShippingQuery ( ref x ) => ( :: ConstructorNumber ( 0xe0cdc940 ) , x ) , & Update :: BotPrecheckoutQuery ( ref x ) => ( :: ConstructorNumber ( 0x5d2f3aa9 ) , x ) , & Update :: PhoneCall ( ref x ) => ( :: ConstructorNumber ( 0xab0f6b1e ) , x ) , & Update :: LangPackTooLong => ( :: ConstructorNumber ( 0x10c2404b ) , & ( ) ) , & Update :: LangPack ( ref x ) => ( :: ConstructorNumber ( 0x56022f4d ) , x ) , & Update :: FavedStickers => ( :: ConstructorNumber ( 0xe511996d ) , & ( ) ) , & Update :: ChannelReadMessagesContents ( ref x ) => ( :: ConstructorNumber ( 0x89893b45 ) , x ) , & Update :: ContactsReset => ( :: ConstructorNumber ( 0x7084a7be ) , & ( ) ) , & Update :: ChannelAvailableMessages ( ref x ) => ( :: ConstructorNumber ( 0x70db6837 ) , x ) , } } } impl :: BoxedDeserialize for Update { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x1f2b0afd ) , :: ConstructorNumber ( 0x4e90bfd6 ) , :: ConstructorNumber ( 0xa20db0e5 ) , :: ConstructorNumber ( 0x5c486927 ) , :: ConstructorNumber ( 0x9a65ea1f ) , :: ConstructorNumber ( 0x07761198 ) , :: ConstructorNumber ( 0x1bfbd823 ) , :: ConstructorNumber ( 0xa7332b73 ) , :: ConstructorNumber ( 0x95313b0c ) , :: ConstructorNumber ( 0x2575bbb9 ) , :: ConstructorNumber ( 0x9d2e67c5 ) , :: ConstructorNumber ( 0x12bcbd9a ) , :: ConstructorNumber ( 0x1710f156 ) , :: ConstructorNumber ( 0xb4a2e88d ) , :: ConstructorNumber ( 0x38fe25b7 ) , :: ConstructorNumber ( 0xea4b0e5c ) , :: ConstructorNumber ( 0x6e5f8c22 ) , :: ConstructorNumber ( 0x8e5e9873 ) , :: ConstructorNumber ( 0x80ece81a ) , :: ConstructorNumber ( 0xbec268ef ) , :: ConstructorNumber ( 0xebe46819 ) , :: ConstructorNumber ( 0xee3b272a ) , :: ConstructorNumber ( 0x12b9417b ) , :: ConstructorNumber ( 0x9961fd5c ) , :: ConstructorNumber ( 0x2f2f21bf ) , :: ConstructorNumber ( 0x7f891213 ) , :: ConstructorNumber ( 0x68c13933 ) , :: ConstructorNumber ( 0xeb0467fb ) , :: ConstructorNumber ( 0xb6d45656 ) , :: ConstructorNumber ( 0x62ba04d9 ) , :: ConstructorNumber ( 0x4214f37f ) , :: ConstructorNumber ( 0xc37521c9 ) , :: ConstructorNumber ( 0x98a12b4b ) , :: ConstructorNumber ( 0x6e947941 ) , :: ConstructorNumber ( 0xb6901959 ) , :: ConstructorNumber ( 0x688a30aa ) , :: ConstructorNumber ( 0x0bb2d201 ) , :: ConstructorNumber ( 0x43ae3dec ) , :: ConstructorNumber ( 0x9375341e ) , :: ConstructorNumber ( 0x54826690 ) , :: ConstructorNumber ( 0x0e48f964 ) , :: ConstructorNumber ( 0x1b3f4df7 ) , :: ConstructorNumber ( 0x98592475 ) , :: ConstructorNumber ( 0xe73547e1 ) , :: ConstructorNumber ( 0xe40370a3 ) , :: ConstructorNumber ( 0xf9d27a5a ) , :: ConstructorNumber ( 0x25d6c9c7 ) , :: ConstructorNumber ( 0xee2bb969 ) , :: ConstructorNumber ( 0x571d2742 ) , :: ConstructorNumber ( 0x9a422c20 ) , :: ConstructorNumber ( 0xa229dd06 ) , :: ConstructorNumber ( 0x3354678f ) , :: ConstructorNumber ( 0x40771900 ) , :: ConstructorNumber ( 0xd711a2cc ) , :: ConstructorNumber ( 0xd8caf68d ) , :: ConstructorNumber ( 0x8317c0c3 ) , :: ConstructorNumber ( 0x9b9240a6 ) , :: ConstructorNumber ( 0xe0cdc940 ) , :: ConstructorNumber ( 0x5d2f3aa9 ) , :: ConstructorNumber ( 0xab0f6b1e ) , :: ConstructorNumber ( 0x10c2404b ) , :: ConstructorNumber ( 0x56022f4d ) , :: ConstructorNumber ( 0xe511996d ) , :: ConstructorNumber ( 0x89893b45 ) , :: ConstructorNumber ( 0x7084a7be ) , :: ConstructorNumber ( 0x70db6837 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x1f2b0afd ) => Ok ( Update :: NewMessage ( _de . read_bare :: < :: mtproto :: update :: NewMessage > ( ) ? ) ) , :: ConstructorNumber ( 0x4e90bfd6 ) => Ok ( Update :: MessageID ( _de . read_bare :: < :: mtproto :: update :: MessageID > ( ) ? ) ) , :: ConstructorNumber ( 0xa20db0e5 ) => Ok ( Update :: DeleteMessages ( _de . read_bare :: < :: mtproto :: update :: DeleteMessages > ( ) ? ) ) , :: ConstructorNumber ( 0x5c486927 ) => Ok ( Update :: UserTyping ( _de . read_bare :: < :: mtproto :: update :: UserTyping > ( ) ? ) ) , :: ConstructorNumber ( 0x9a65ea1f ) => Ok ( Update :: ChatUserTyping ( _de . read_bare :: < :: mtproto :: update :: ChatUserTyping > ( ) ? ) ) , :: ConstructorNumber ( 0x07761198 ) => Ok ( Update :: ChatParticipants ( _de . read_bare :: < :: mtproto :: update :: ChatParticipants > ( ) ? ) ) , :: ConstructorNumber ( 0x1bfbd823 ) => Ok ( Update :: UserStatus ( _de . read_bare :: < :: mtproto :: update :: UserStatus > ( ) ? ) ) , :: ConstructorNumber ( 0xa7332b73 ) => Ok ( Update :: UserName ( _de . read_bare :: < :: mtproto :: update :: UserName > ( ) ? ) ) , :: ConstructorNumber ( 0x95313b0c ) => Ok ( Update :: UserPhoto ( _de . read_bare :: < :: mtproto :: update :: UserPhoto > ( ) ? ) ) , :: ConstructorNumber ( 0x2575bbb9 ) => Ok ( Update :: ContactRegistered ( _de . read_bare :: < :: mtproto :: update :: ContactRegistered > ( ) ? ) ) , :: ConstructorNumber ( 0x9d2e67c5 ) => Ok ( Update :: ContactLink ( _de . read_bare :: < :: mtproto :: update :: ContactLink > ( ) ? ) ) , :: ConstructorNumber ( 0x12bcbd9a ) => Ok ( Update :: NewEncryptedMessage ( _de . read_bare :: < :: mtproto :: update :: NewEncryptedMessage > ( ) ? ) ) , :: ConstructorNumber ( 0x1710f156 ) => Ok ( Update :: EncryptedChatTyping ( _de . read_bare :: < :: mtproto :: update :: EncryptedChatTyping > ( ) ? ) ) , :: ConstructorNumber ( 0xb4a2e88d ) => Ok ( Update :: Encryption ( _de . read_bare :: < :: mtproto :: update :: Encryption > ( ) ? ) ) , :: ConstructorNumber ( 0x38fe25b7 ) => Ok ( Update :: EncryptedMessagesRead ( _de . read_bare :: < :: mtproto :: update :: EncryptedMessagesRead > ( ) ? ) ) , :: ConstructorNumber ( 0xea4b0e5c ) => Ok ( Update :: ChatParticipantAdd ( _de . read_bare :: < :: mtproto :: update :: ChatParticipantAdd > ( ) ? ) ) , :: ConstructorNumber ( 0x6e5f8c22 ) => Ok ( Update :: ChatParticipantDelete ( _de . read_bare :: < :: mtproto :: update :: ChatParticipantDelete > ( ) ? ) ) , :: ConstructorNumber ( 0x8e5e9873 ) => Ok ( Update :: DcOptions ( _de . read_bare :: < :: mtproto :: update :: DcOptions > ( ) ? ) ) , :: ConstructorNumber ( 0x80ece81a ) => Ok ( Update :: UserBlocked ( _de . read_bare :: < :: mtproto :: update :: UserBlocked > ( ) ? ) ) , :: ConstructorNumber ( 0xbec268ef ) => Ok ( Update :: NotifySettings ( _de . read_bare :: < :: mtproto :: update :: NotifySettings > ( ) ? ) ) , :: ConstructorNumber ( 0xebe46819 ) => Ok ( Update :: ServiceNotification ( _de . read_bare :: < :: mtproto :: update :: ServiceNotification > ( ) ? ) ) , :: ConstructorNumber ( 0xee3b272a ) => Ok ( Update :: Privacy ( _de . read_bare :: < :: mtproto :: update :: Privacy > ( ) ? ) ) , :: ConstructorNumber ( 0x12b9417b ) => Ok ( Update :: UserPhone ( _de . read_bare :: < :: mtproto :: update :: UserPhone > ( ) ? ) ) , :: ConstructorNumber ( 0x9961fd5c ) => Ok ( Update :: ReadHistoryInbox ( _de . read_bare :: < :: mtproto :: update :: ReadHistoryInbox > ( ) ? ) ) , :: ConstructorNumber ( 0x2f2f21bf ) => Ok ( Update :: ReadHistoryOutbox ( _de . read_bare :: < :: mtproto :: update :: ReadHistoryOutbox > ( ) ? ) ) , :: ConstructorNumber ( 0x7f891213 ) => Ok ( Update :: WebPage ( _de . read_bare :: < :: mtproto :: update :: WebPage > ( ) ? ) ) , :: ConstructorNumber ( 0x68c13933 ) => Ok ( Update :: ReadMessagesContents ( _de . read_bare :: < :: mtproto :: update :: ReadMessagesContents > ( ) ? ) ) , :: ConstructorNumber ( 0xeb0467fb ) => Ok ( Update :: ChannelTooLong ( _de . read_bare :: < :: mtproto :: update :: ChannelTooLong > ( ) ? ) ) , :: ConstructorNumber ( 0xb6d45656 ) => Ok ( Update :: Channel ( _de . read_bare :: < :: mtproto :: update :: Channel > ( ) ? ) ) , :: ConstructorNumber ( 0x62ba04d9 ) => Ok ( Update :: NewChannelMessage ( _de . read_bare :: < :: mtproto :: update :: NewChannelMessage > ( ) ? ) ) , :: ConstructorNumber ( 0x4214f37f ) => Ok ( Update :: ReadChannelInbox ( _de . read_bare :: < :: mtproto :: update :: ReadChannelInbox > ( ) ? ) ) , :: ConstructorNumber ( 0xc37521c9 ) => Ok ( Update :: DeleteChannelMessages ( _de . read_bare :: < :: mtproto :: update :: DeleteChannelMessages > ( ) ? ) ) , :: ConstructorNumber ( 0x98a12b4b ) => Ok ( Update :: ChannelMessageViews ( _de . read_bare :: < :: mtproto :: update :: ChannelMessageViews > ( ) ? ) ) , :: ConstructorNumber ( 0x6e947941 ) => Ok ( Update :: ChatAdmins ( _de . read_bare :: < :: mtproto :: update :: ChatAdmins > ( ) ? ) ) , :: ConstructorNumber ( 0xb6901959 ) => Ok ( Update :: ChatParticipantAdmin ( _de . read_bare :: < :: mtproto :: update :: ChatParticipantAdmin > ( ) ? ) ) , :: ConstructorNumber ( 0x688a30aa ) => Ok ( Update :: NewStickerSet ( _de . read_bare :: < :: mtproto :: update :: NewStickerSet > ( ) ? ) ) , :: ConstructorNumber ( 0x0bb2d201 ) => Ok ( Update :: StickerSetsOrder ( _de . read_bare :: < :: mtproto :: update :: StickerSetsOrder > ( ) ? ) ) , :: ConstructorNumber ( 0x43ae3dec ) => Ok ( Update :: StickerSets ) , :: ConstructorNumber ( 0x9375341e ) => Ok ( Update :: SavedGifs ) , :: ConstructorNumber ( 0x54826690 ) => Ok ( Update :: BotInlineQuery ( _de . read_bare :: < :: mtproto :: update :: BotInlineQuery > ( ) ? ) ) , :: ConstructorNumber ( 0x0e48f964 ) => Ok ( Update :: BotInlineSend ( _de . read_bare :: < :: mtproto :: update :: BotInlineSend > ( ) ? ) ) , :: ConstructorNumber ( 0x1b3f4df7 ) => Ok ( Update :: EditChannelMessage ( _de . read_bare :: < :: mtproto :: update :: EditChannelMessage > ( ) ? ) ) , :: ConstructorNumber ( 0x98592475 ) => Ok ( Update :: ChannelPinnedMessage ( _de . read_bare :: < :: mtproto :: update :: ChannelPinnedMessage > ( ) ? ) ) , :: ConstructorNumber ( 0xe73547e1 ) => Ok ( Update :: BotCallbackQuery ( _de . read_bare :: < :: mtproto :: update :: BotCallbackQuery > ( ) ? ) ) , :: ConstructorNumber ( 0xe40370a3 ) => Ok ( Update :: EditMessage ( _de . read_bare :: < :: mtproto :: update :: EditMessage > ( ) ? ) ) , :: ConstructorNumber ( 0xf9d27a5a ) => Ok ( Update :: InlineBotCallbackQuery ( _de . read_bare :: < :: mtproto :: update :: InlineBotCallbackQuery > ( ) ? ) ) , :: ConstructorNumber ( 0x25d6c9c7 ) => Ok ( Update :: ReadChannelOutbox ( _de . read_bare :: < :: mtproto :: update :: ReadChannelOutbox > ( ) ? ) ) , :: ConstructorNumber ( 0xee2bb969 ) => Ok ( Update :: DraftMessage ( _de . read_bare :: < :: mtproto :: update :: DraftMessage > ( ) ? ) ) , :: ConstructorNumber ( 0x571d2742 ) => Ok ( Update :: ReadFeaturedStickers ) , :: ConstructorNumber ( 0x9a422c20 ) => Ok ( Update :: RecentStickers ) , :: ConstructorNumber ( 0xa229dd06 ) => Ok ( Update :: Config ) , :: ConstructorNumber ( 0x3354678f ) => Ok ( Update :: PtsChanged ) , :: ConstructorNumber ( 0x40771900 ) => Ok ( Update :: ChannelWebPage ( _de . read_bare :: < :: mtproto :: update :: ChannelWebPage > ( ) ? ) ) , :: ConstructorNumber ( 0xd711a2cc ) => Ok ( Update :: DialogPinned ( _de . read_bare :: < :: mtproto :: update :: DialogPinned > ( ) ? ) ) , :: ConstructorNumber ( 0xd8caf68d ) => Ok ( Update :: PinnedDialogs ( _de . read_bare :: < :: mtproto :: update :: PinnedDialogs > ( ) ? ) ) , :: ConstructorNumber ( 0x8317c0c3 ) => Ok ( Update :: BotWebhookJSON ( _de . read_bare :: < :: mtproto :: update :: BotWebhookJSON > ( ) ? ) ) , :: ConstructorNumber ( 0x9b9240a6 ) => Ok ( Update :: BotWebhookJSONQuery ( _de . read_bare :: < :: mtproto :: update :: BotWebhookJSONQuery > ( ) ? ) ) , :: ConstructorNumber ( 0xe0cdc940 ) => Ok ( Update :: BotShippingQuery ( _de . read_bare :: < :: mtproto :: update :: BotShippingQuery > ( ) ? ) ) , :: ConstructorNumber ( 0x5d2f3aa9 ) => Ok ( Update :: BotPrecheckoutQuery ( _de . read_bare :: < :: mtproto :: update :: BotPrecheckoutQuery > ( ) ? ) ) , :: ConstructorNumber ( 0xab0f6b1e ) => Ok ( Update :: PhoneCall ( _de . read_bare :: < :: mtproto :: update :: PhoneCall > ( ) ? ) ) , :: ConstructorNumber ( 0x10c2404b ) => Ok ( Update :: LangPackTooLong ) , :: ConstructorNumber ( 0x56022f4d ) => Ok ( Update :: LangPack ( _de . read_bare :: < :: mtproto :: update :: LangPack > ( ) ? ) ) , :: ConstructorNumber ( 0xe511996d ) => Ok ( Update :: FavedStickers ) , :: ConstructorNumber ( 0x89893b45 ) => Ok ( Update :: ChannelReadMessagesContents ( _de . read_bare :: < :: mtproto :: update :: ChannelReadMessagesContents > ( ) ? ) ) , :: ConstructorNumber ( 0x7084a7be ) => Ok ( Update :: ContactsReset ) , :: ConstructorNumber ( 0x70db6837 ) => Ok ( Update :: ChannelAvailableMessages ( _de . read_bare :: < :: mtproto :: update :: ChannelAvailableMessages > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `Updates`\n\n```text\nupdatesTooLong#e317af7e = Updates;\n\nupdateShortMessage#914fbf11 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int user_id:int message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to_msg_id:flags.3?int entities:flags.7?Vector<MessageEntity> = Updates;\n\nupdateShortChatMessage#16812688 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int from_id:int chat_id:int message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to_msg_id:flags.3?int entities:flags.7?Vector<MessageEntity> = Updates;\n\nupdateShort#78d4dec1 update:Update date:int = Updates;\n\nupdatesCombined#725b04c3 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq_start:int seq:int = Updates;\n\nupdates#74ae4240 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq:int = Updates;\n\nupdateShortSentMessage#11f1331c flags:# out:flags.1?true id:int pts:int pts_count:int date:int media:flags.9?MessageMedia entities:flags.7?Vector<MessageEntity> = Updates;\n```\n" ] pub enum Updates { UpdatesTooLong , UpdateShortMessage ( :: mtproto :: updates :: UpdateShortMessage ) , UpdateShortChatMessage ( :: mtproto :: updates :: UpdateShortChatMessage ) , UpdateShort ( :: mtproto :: updates :: UpdateShort ) , UpdatesCombined ( :: mtproto :: updates :: UpdatesCombined ) , Updates ( :: mtproto :: updates :: Updates ) , UpdateShortSentMessage ( :: mtproto :: updates :: UpdateShortSentMessage ) , } impl Updates { pub fn chat_id ( & self ) -> Option < & :: mtproto :: int > { match self { & Updates :: UpdateShortChatMessage ( ref x ) => Some ( & x . chat_id ) , _ => None } } pub fn chats ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > { match self { & Updates :: UpdatesCombined ( ref x ) => Some ( & x . chats ) , & Updates :: Updates ( ref x ) => Some ( & x . chats ) , _ => None } } pub fn date ( & self ) -> Option < & :: mtproto :: int > { match self { & Updates :: UpdateShortChatMessage ( ref x ) => Some ( & x . date ) , & Updates :: UpdateShortMessage ( ref x ) => Some ( & x . date ) , & Updates :: Updates ( ref x ) => Some ( & x . date ) , & Updates :: UpdateShortSentMessage ( ref x ) => Some ( & x . date ) , & Updates :: UpdateShort ( ref x ) => Some ( & x . date ) , & Updates :: UpdatesCombined ( ref x ) => Some ( & x . date ) , _ => None } } pub fn entities ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: MessageEntity > > { match self { & Updates :: UpdateShortChatMessage ( ref x ) => x . entities . as_ref ( ) , & Updates :: UpdateShortSentMessage ( ref x ) => x . entities . as_ref ( ) , & Updates :: UpdateShortMessage ( ref x ) => x . entities . as_ref ( ) , _ => None } } pub fn from_id ( & self ) -> Option < & :: mtproto :: int > { match self { & Updates :: UpdateShortChatMessage ( ref x ) => Some ( & x . from_id ) , _ => None } } pub fn fwd_from ( & self ) -> Option < & :: mtproto :: MessageFwdHeader > { match self { & Updates :: UpdateShortChatMessage ( ref x ) => x . fwd_from . as_ref ( ) , & Updates :: UpdateShortMessage ( ref x ) => x . fwd_from . as_ref ( ) , _ => None } } pub fn id ( & self ) -> Option < & :: mtproto :: int > { match self { & Updates :: UpdateShortMessage ( ref x ) => Some ( & x . id ) , & Updates :: UpdateShortSentMessage ( ref x ) => Some ( & x . id ) , & Updates :: UpdateShortChatMessage ( ref x ) => Some ( & x . id ) , _ => None } } pub fn media ( & self ) -> Option < & :: mtproto :: MessageMedia > { match self { & Updates :: UpdateShortSentMessage ( ref x ) => x . media . as_ref ( ) , _ => None } } pub fn media_unread ( & self ) -> Option < bool > { match self { & Updates :: UpdateShortMessage ( ref x ) => Some ( x . media_unread ) , & Updates :: UpdateShortChatMessage ( ref x ) => Some ( x . media_unread ) , _ => None } } pub fn mentioned ( & self ) -> Option < bool > { match self { & Updates :: UpdateShortChatMessage ( ref x ) => Some ( x . mentioned ) , & Updates :: UpdateShortMessage ( ref x ) => Some ( x . mentioned ) , _ => None } } pub fn message ( & self ) -> Option < & :: mtproto :: string > { match self { & Updates :: UpdateShortMessage ( ref x ) => Some ( & x . message ) , & Updates :: UpdateShortChatMessage ( ref x ) => Some ( & x . message ) , _ => None } } pub fn out ( & self ) -> Option < bool > { match self { & Updates :: UpdateShortChatMessage ( ref x ) => Some ( x . out ) , & Updates :: UpdateShortMessage ( ref x ) => Some ( x . out ) , & Updates :: UpdateShortSentMessage ( ref x ) => Some ( x . out ) , _ => None } } pub fn pts ( & self ) -> Option < & :: mtproto :: int > { match self { & Updates :: UpdateShortMessage ( ref x ) => Some ( & x . pts ) , & Updates :: UpdateShortChatMessage ( ref x ) => Some ( & x . pts ) , & Updates :: UpdateShortSentMessage ( ref x ) => Some ( & x . pts ) , _ => None } } pub fn pts_count ( & self ) -> Option < & :: mtproto :: int > { match self { & Updates :: UpdateShortSentMessage ( ref x ) => Some ( & x . pts_count ) , & Updates :: UpdateShortChatMessage ( ref x ) => Some ( & x . pts_count ) , & Updates :: UpdateShortMessage ( ref x ) => Some ( & x . pts_count ) , _ => None } } pub fn reply_to_msg_id ( & self ) -> Option < & :: mtproto :: int > { match self { & Updates :: UpdateShortChatMessage ( ref x ) => x . reply_to_msg_id . as_ref ( ) , & Updates :: UpdateShortMessage ( ref x ) => x . reply_to_msg_id . as_ref ( ) , _ => None } } pub fn seq ( & self ) -> Option < & :: mtproto :: int > { match self { & Updates :: Updates ( ref x ) => Some ( & x . seq ) , & Updates :: UpdatesCombined ( ref x ) => Some ( & x . seq ) , _ => None } } pub fn seq_start ( & self ) -> Option < & :: mtproto :: int > { match self { & Updates :: UpdatesCombined ( ref x ) => Some ( & x . seq_start ) , _ => None } } pub fn silent ( & self ) -> Option < bool > { match self { & Updates :: UpdateShortMessage ( ref x ) => Some ( x . silent ) , & Updates :: UpdateShortChatMessage ( ref x ) => Some ( x . silent ) , _ => None } } pub fn update ( & self ) -> Option < & :: mtproto :: Update > { match self { & Updates :: UpdateShort ( ref x ) => Some ( & x . update ) , _ => None } } pub fn updates ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Update > > { match self { & Updates :: UpdatesCombined ( ref x ) => Some ( & x . updates ) , & Updates :: Updates ( ref x ) => Some ( & x . updates ) , _ => None } } pub fn user_id ( & self ) -> Option < & :: mtproto :: int > { match self { & Updates :: UpdateShortMessage ( ref x ) => Some ( & x . user_id ) , _ => None } } pub fn users ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > { match self { & Updates :: UpdatesCombined ( ref x ) => Some ( & x . users ) , & Updates :: Updates ( ref x ) => Some ( & x . users ) , _ => None } } pub fn via_bot_id ( & self ) -> Option < & :: mtproto :: int > { match self { & Updates :: UpdateShortMessage ( ref x ) => x . via_bot_id . as_ref ( ) , & Updates :: UpdateShortChatMessage ( ref x ) => x . via_bot_id . as_ref ( ) , _ => None } } } impl :: BoxedSerialize for Updates { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Updates :: UpdatesTooLong => ( :: ConstructorNumber ( 0xe317af7e ) , & ( ) ) , & Updates :: UpdateShortMessage ( ref x ) => ( :: ConstructorNumber ( 0x914fbf11 ) , x ) , & Updates :: UpdateShortChatMessage ( ref x ) => ( :: ConstructorNumber ( 0x16812688 ) , x ) , & Updates :: UpdateShort ( ref x ) => ( :: ConstructorNumber ( 0x78d4dec1 ) , x ) , & Updates :: UpdatesCombined ( ref x ) => ( :: ConstructorNumber ( 0x725b04c3 ) , x ) , & Updates :: Updates ( ref x ) => ( :: ConstructorNumber ( 0x74ae4240 ) , x ) , & Updates :: UpdateShortSentMessage ( ref x ) => ( :: ConstructorNumber ( 0x11f1331c ) , x ) , } } } impl :: BoxedDeserialize for Updates { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xe317af7e ) , :: ConstructorNumber ( 0x914fbf11 ) , :: ConstructorNumber ( 0x16812688 ) , :: ConstructorNumber ( 0x78d4dec1 ) , :: ConstructorNumber ( 0x725b04c3 ) , :: ConstructorNumber ( 0x74ae4240 ) , :: ConstructorNumber ( 0x11f1331c ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xe317af7e ) => Ok ( Updates :: UpdatesTooLong ) , :: ConstructorNumber ( 0x914fbf11 ) => Ok ( Updates :: UpdateShortMessage ( _de . read_bare :: < :: mtproto :: updates :: UpdateShortMessage > ( ) ? ) ) , :: ConstructorNumber ( 0x16812688 ) => Ok ( Updates :: UpdateShortChatMessage ( _de . read_bare :: < :: mtproto :: updates :: UpdateShortChatMessage > ( ) ? ) ) , :: ConstructorNumber ( 0x78d4dec1 ) => Ok ( Updates :: UpdateShort ( _de . read_bare :: < :: mtproto :: updates :: UpdateShort > ( ) ? ) ) , :: ConstructorNumber ( 0x725b04c3 ) => Ok ( Updates :: UpdatesCombined ( _de . read_bare :: < :: mtproto :: updates :: UpdatesCombined > ( ) ? ) ) , :: ConstructorNumber ( 0x74ae4240 ) => Ok ( Updates :: Updates ( _de . read_bare :: < :: mtproto :: updates :: Updates > ( ) ? ) ) , :: ConstructorNumber ( 0x11f1331c ) => Ok ( Updates :: UpdateShortSentMessage ( _de . read_bare :: < :: mtproto :: updates :: UpdateShortSentMessage > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `User`\n\n```text\nuserEmpty#200250ba id:int = User;\n\nuser#2e13f4c3 flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true id:int access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?string bot_inline_placeholder:flags.19?string lang_code:flags.22?string = User;\n```\n" ] pub enum User { Empty ( :: mtproto :: user :: Empty ) , User ( :: mtproto :: user :: User ) , } impl User { pub fn access_hash ( & self ) -> Option < & :: mtproto :: long > { match self { & User :: User ( ref x ) => x . access_hash . as_ref ( ) , _ => None } } pub fn bot ( & self ) -> Option < bool > { match self { & User :: User ( ref x ) => Some ( x . bot ) , _ => None } } pub fn bot_chat_history ( & self ) -> Option < bool > { match self { & User :: User ( ref x ) => Some ( x . bot_chat_history ) , _ => None } } pub fn bot_info_version ( & self ) -> Option < & :: mtproto :: int > { match self { & User :: User ( ref x ) => x . bot_info_version . as_ref ( ) , _ => None } } pub fn bot_inline_geo ( & self ) -> Option < bool > { match self { & User :: User ( ref x ) => Some ( x . bot_inline_geo ) , _ => None } } pub fn bot_inline_placeholder ( & self ) -> Option < & :: mtproto :: string > { match self { & User :: User ( ref x ) => x . bot_inline_placeholder . as_ref ( ) , _ => None } } pub fn bot_nochats ( & self ) -> Option < bool > { match self { & User :: User ( ref x ) => Some ( x . bot_nochats ) , _ => None } } pub fn contact ( & self ) -> Option < bool > { match self { & User :: User ( ref x ) => Some ( x . contact ) , _ => None } } pub fn deleted ( & self ) -> Option < bool > { match self { & User :: User ( ref x ) => Some ( x . deleted ) , _ => None } } pub fn first_name ( & self ) -> Option < & :: mtproto :: string > { match self { & User :: User ( ref x ) => x . first_name . as_ref ( ) , _ => None } } pub fn id ( & self ) -> & :: mtproto :: int { match self { & User :: Empty ( ref x ) => & x . id , & User :: User ( ref x ) => & x . id , } } pub fn lang_code ( & self ) -> Option < & :: mtproto :: string > { match self { & User :: User ( ref x ) => x . lang_code . as_ref ( ) , _ => None } } pub fn last_name ( & self ) -> Option < & :: mtproto :: string > { match self { & User :: User ( ref x ) => x . last_name . as_ref ( ) , _ => None } } pub fn min ( & self ) -> Option < bool > { match self { & User :: User ( ref x ) => Some ( x . min ) , _ => None } } pub fn mutual_contact ( & self ) -> Option < bool > { match self { & User :: User ( ref x ) => Some ( x . mutual_contact ) , _ => None } } pub fn phone ( & self ) -> Option < & :: mtproto :: string > { match self { & User :: User ( ref x ) => x . phone . as_ref ( ) , _ => None } } pub fn photo ( & self ) -> Option < & :: mtproto :: UserProfilePhoto > { match self { & User :: User ( ref x ) => x . photo . as_ref ( ) , _ => None } } pub fn restricted ( & self ) -> Option < bool > { match self { & User :: User ( ref x ) => Some ( x . restricted ) , _ => None } } pub fn restriction_reason ( & self ) -> Option < & :: mtproto :: string > { match self { & User :: User ( ref x ) => x . restriction_reason . as_ref ( ) , _ => None } } pub fn self_ ( & self ) -> Option < bool > { match self { & User :: User ( ref x ) => Some ( x . self_ ) , _ => None } } pub fn status ( & self ) -> Option < & :: mtproto :: UserStatus > { match self { & User :: User ( ref x ) => x . status . as_ref ( ) , _ => None } } pub fn username ( & self ) -> Option < & :: mtproto :: string > { match self { & User :: User ( ref x ) => x . username . as_ref ( ) , _ => None } } pub fn verified ( & self ) -> Option < bool > { match self { & User :: User ( ref x ) => Some ( x . verified ) , _ => None } } } impl :: BoxedSerialize for User { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & User :: Empty ( ref x ) => ( :: ConstructorNumber ( 0x200250ba ) , x ) , & User :: User ( ref x ) => ( :: ConstructorNumber ( 0x2e13f4c3 ) , x ) , } } } impl :: BoxedDeserialize for User { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x200250ba ) , :: ConstructorNumber ( 0x2e13f4c3 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x200250ba ) => Ok ( User :: Empty ( _de . read_bare :: < :: mtproto :: user :: Empty > ( ) ? ) ) , :: ConstructorNumber ( 0x2e13f4c3 ) => Ok ( User :: User ( _de . read_bare :: < :: mtproto :: user :: User > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `UserFull`\n\n```text\nuserFull#f220f3f flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true user:User about:flags.1?string link:contacts.Link profile_photo:flags.2?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo common_chats_count:int = UserFull;\n```\n" ] pub enum UserFull { UserFull ( :: mtproto :: user_full :: UserFull ) , } impl UserFull { pub fn about ( & self ) -> Option < & :: mtproto :: string > { match self { & UserFull :: UserFull ( ref x ) => x . about . as_ref ( ) , } } pub fn blocked ( & self ) -> bool { match self { & UserFull :: UserFull ( ref x ) => x . blocked , } } pub fn bot_info ( & self ) -> Option < & :: mtproto :: BotInfo > { match self { & UserFull :: UserFull ( ref x ) => x . bot_info . as_ref ( ) , } } pub fn common_chats_count ( & self ) -> & :: mtproto :: int { match self { & UserFull :: UserFull ( ref x ) => & x . common_chats_count , } } pub fn link ( & self ) -> & :: mtproto :: contacts :: Link { match self { & UserFull :: UserFull ( ref x ) => & x . link , } } pub fn notify_settings ( & self ) -> & :: mtproto :: PeerNotifySettings { match self { & UserFull :: UserFull ( ref x ) => & x . notify_settings , } } pub fn phone_calls_available ( & self ) -> bool { match self { & UserFull :: UserFull ( ref x ) => x . phone_calls_available , } } pub fn phone_calls_private ( & self ) -> bool { match self { & UserFull :: UserFull ( ref x ) => x . phone_calls_private , } } pub fn profile_photo ( & self ) -> Option < & :: mtproto :: Photo > { match self { & UserFull :: UserFull ( ref x ) => x . profile_photo . as_ref ( ) , } } pub fn user ( & self ) -> & :: mtproto :: User { match self { & UserFull :: UserFull ( ref x ) => & x . user , } } } impl :: BoxedSerialize for UserFull { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & UserFull :: UserFull ( ref x ) => ( :: ConstructorNumber ( 0x0f220f3f ) , x ) , } } } impl :: BoxedDeserialize for UserFull { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x0f220f3f ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x0f220f3f ) => Ok ( UserFull :: UserFull ( _de . read_bare :: < :: mtproto :: user_full :: UserFull > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `UserProfilePhoto`\n\n```text\nuserProfilePhotoEmpty#4f11bae1 = UserProfilePhoto;\n\nuserProfilePhoto#d559d8c8 photo_id:long photo_small:FileLocation photo_big:FileLocation = UserProfilePhoto;\n```\n" ] pub enum UserProfilePhoto { Empty , UserProfilePhoto ( :: mtproto :: user_profile_photo :: UserProfilePhoto ) , } impl UserProfilePhoto { pub fn photo_big ( & self ) -> Option < & :: mtproto :: FileLocation > { match self { & UserProfilePhoto :: UserProfilePhoto ( ref x ) => Some ( & x . photo_big ) , _ => None } } pub fn photo_id ( & self ) -> Option < & :: mtproto :: long > { match self { & UserProfilePhoto :: UserProfilePhoto ( ref x ) => Some ( & x . photo_id ) , _ => None } } pub fn photo_small ( & self ) -> Option < & :: mtproto :: FileLocation > { match self { & UserProfilePhoto :: UserProfilePhoto ( ref x ) => Some ( & x . photo_small ) , _ => None } } } impl :: BoxedSerialize for UserProfilePhoto { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & UserProfilePhoto :: Empty => ( :: ConstructorNumber ( 0x4f11bae1 ) , & ( ) ) , & UserProfilePhoto :: UserProfilePhoto ( ref x ) => ( :: ConstructorNumber ( 0xd559d8c8 ) , x ) , } } } impl :: BoxedDeserialize for UserProfilePhoto { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x4f11bae1 ) , :: ConstructorNumber ( 0xd559d8c8 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x4f11bae1 ) => Ok ( UserProfilePhoto :: Empty ) , :: ConstructorNumber ( 0xd559d8c8 ) => Ok ( UserProfilePhoto :: UserProfilePhoto ( _de . read_bare :: < :: mtproto :: user_profile_photo :: UserProfilePhoto > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } impl :: BoxedSerialize for Option < :: mtproto :: user_profile_photo :: UserProfilePhoto > { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match * self { None => ( :: ConstructorNumber ( 0x4f11bae1 ) , & ( ) ) , Some ( ref x ) => ( :: ConstructorNumber ( 0xd559d8c8 ) , x ) , } } } impl :: BoxedDeserialize for Option < :: mtproto :: user_profile_photo :: UserProfilePhoto > { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x4f11bae1 ) , :: ConstructorNumber ( 0xd559d8c8 ) ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x4f11bae1 ) => Ok ( None ) , :: ConstructorNumber ( 0xd559d8c8 ) => Ok ( Some ( _de . read_bare :: < :: mtproto :: user_profile_photo :: UserProfilePhoto > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `UserStatus`\n\n```text\nuserStatusEmpty#9d05049 = UserStatus;\n\nuserStatusOnline#edb93949 expires:int = UserStatus;\n\nuserStatusOffline#8c703f was_online:int = UserStatus;\n\nuserStatusRecently#e26f42f1 = UserStatus;\n\nuserStatusLastWeek#7bf09fc = UserStatus;\n\nuserStatusLastMonth#77ebc742 = UserStatus;\n```\n" ] pub enum UserStatus { Empty , Online ( :: mtproto :: user_status :: Online ) , Offline ( :: mtproto :: user_status :: Offline ) , Recently , LastWeek , LastMonth , } impl UserStatus { pub fn expires ( & self ) -> Option < & :: mtproto :: int > { match self { & UserStatus :: Online ( ref x ) => Some ( & x . expires ) , _ => None } } pub fn was_online ( & self ) -> Option < & :: mtproto :: int > { match self { & UserStatus :: Offline ( ref x ) => Some ( & x . was_online ) , _ => None } } } impl :: BoxedSerialize for UserStatus { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & UserStatus :: Empty => ( :: ConstructorNumber ( 0x09d05049 ) , & ( ) ) , & UserStatus :: Online ( ref x ) => ( :: ConstructorNumber ( 0xedb93949 ) , x ) , & UserStatus :: Offline ( ref x ) => ( :: ConstructorNumber ( 0x008c703f ) , x ) , & UserStatus :: Recently => ( :: ConstructorNumber ( 0xe26f42f1 ) , & ( ) ) , & UserStatus :: LastWeek => ( :: ConstructorNumber ( 0x07bf09fc ) , & ( ) ) , & UserStatus :: LastMonth => ( :: ConstructorNumber ( 0x77ebc742 ) , & ( ) ) , } } } impl :: BoxedDeserialize for UserStatus { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x09d05049 ) , :: ConstructorNumber ( 0xedb93949 ) , :: ConstructorNumber ( 0x008c703f ) , :: ConstructorNumber ( 0xe26f42f1 ) , :: ConstructorNumber ( 0x07bf09fc ) , :: ConstructorNumber ( 0x77ebc742 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x09d05049 ) => Ok ( UserStatus :: Empty ) , :: ConstructorNumber ( 0xedb93949 ) => Ok ( UserStatus :: Online ( _de . read_bare :: < :: mtproto :: user_status :: Online > ( ) ? ) ) , :: ConstructorNumber ( 0x008c703f ) => Ok ( UserStatus :: Offline ( _de . read_bare :: < :: mtproto :: user_status :: Offline > ( ) ? ) ) , :: ConstructorNumber ( 0xe26f42f1 ) => Ok ( UserStatus :: Recently ) , :: ConstructorNumber ( 0x07bf09fc ) => Ok ( UserStatus :: LastWeek ) , :: ConstructorNumber ( 0x77ebc742 ) => Ok ( UserStatus :: LastMonth ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `WallPaper`\n\n```text\nwallPaper#ccb03657 id:int title:string sizes:Vector<PhotoSize> color:int = WallPaper;\n\nwallPaperSolid#63117f24 id:int title:string bg_color:int color:int = WallPaper;\n```\n" ] pub enum WallPaper { WallPaper ( :: mtproto :: wall_paper :: WallPaper ) , Solid ( :: mtproto :: wall_paper :: Solid ) , } impl WallPaper { pub fn bg_color ( & self ) -> Option < & :: mtproto :: int > { match self { & WallPaper :: Solid ( ref x ) => Some ( & x . bg_color ) , _ => None } } pub fn color ( & self ) -> & :: mtproto :: int { match self { & WallPaper :: Solid ( ref x ) => & x . color , & WallPaper :: WallPaper ( ref x ) => & x . color , } } pub fn id ( & self ) -> & :: mtproto :: int { match self { & WallPaper :: Solid ( ref x ) => & x . id , & WallPaper :: WallPaper ( ref x ) => & x . id , } } pub fn sizes ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PhotoSize > > { match self { & WallPaper :: WallPaper ( ref x ) => Some ( & x . sizes ) , _ => None } } pub fn title ( & self ) -> & :: mtproto :: string { match self { & WallPaper :: Solid ( ref x ) => & x . title , & WallPaper :: WallPaper ( ref x ) => & x . title , } } } impl :: BoxedSerialize for WallPaper { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & WallPaper :: WallPaper ( ref x ) => ( :: ConstructorNumber ( 0xccb03657 ) , x ) , & WallPaper :: Solid ( ref x ) => ( :: ConstructorNumber ( 0x63117f24 ) , x ) , } } } impl :: BoxedDeserialize for WallPaper { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xccb03657 ) , :: ConstructorNumber ( 0x63117f24 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xccb03657 ) => Ok ( WallPaper :: WallPaper ( _de . read_bare :: < :: mtproto :: wall_paper :: WallPaper > ( ) ? ) ) , :: ConstructorNumber ( 0x63117f24 ) => Ok ( WallPaper :: Solid ( _de . read_bare :: < :: mtproto :: wall_paper :: Solid > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `WebDocument`\n\n```text\nwebDocument#c61acbd8 url:string access_hash:long size:int mime_type:string attributes:Vector<DocumentAttribute> dc_id:int = WebDocument;\n```\n" ] pub enum WebDocument { WebDocument ( :: mtproto :: web_document :: WebDocument ) , } impl WebDocument { pub fn access_hash ( & self ) -> & :: mtproto :: long { match self { & WebDocument :: WebDocument ( ref x ) => & x . access_hash , } } pub fn attributes ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: DocumentAttribute > { match self { & WebDocument :: WebDocument ( ref x ) => & x . attributes , } } pub fn dc_id ( & self ) -> & :: mtproto :: int { match self { & WebDocument :: WebDocument ( ref x ) => & x . dc_id , } } pub fn mime_type ( & self ) -> & :: mtproto :: string { match self { & WebDocument :: WebDocument ( ref x ) => & x . mime_type , } } pub fn size ( & self ) -> & :: mtproto :: int { match self { & WebDocument :: WebDocument ( ref x ) => & x . size , } } pub fn url ( & self ) -> & :: mtproto :: string { match self { & WebDocument :: WebDocument ( ref x ) => & x . url , } } } impl :: BoxedSerialize for WebDocument { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & WebDocument :: WebDocument ( ref x ) => ( :: ConstructorNumber ( 0xc61acbd8 ) , x ) , } } } impl :: BoxedDeserialize for WebDocument { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xc61acbd8 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xc61acbd8 ) => Ok ( WebDocument :: WebDocument ( _de . read_bare :: < :: mtproto :: web_document :: WebDocument > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `WebPage`\n\n```text\nwebPageEmpty#eb1477e8 id:long = WebPage;\n\nwebPagePending#c586da1c id:long date:int = WebPage;\n\nwebPage#5f07b4bc flags:# id:long url:string display_url:string hash:int type:flags.0?string site_name:flags.1?string title:flags.2?string description:flags.3?string photo:flags.4?Photo embed_url:flags.5?string embed_type:flags.5?string embed_width:flags.6?int embed_height:flags.6?int duration:flags.7?int author:flags.8?string document:flags.9?Document cached_page:flags.10?Page = WebPage;\n\nwebPageNotModified#85849473 = WebPage;\n```\n" ] pub enum WebPage { Empty ( :: mtproto :: web_page :: Empty ) , Pending ( :: mtproto :: web_page :: Pending ) , WebPage ( :: mtproto :: web_page :: WebPage ) , NotModified , } impl WebPage { pub fn author ( & self ) -> Option < & :: mtproto :: string > { match self { & WebPage :: WebPage ( ref x ) => x . author . as_ref ( ) , _ => None } } pub fn cached_page ( & self ) -> Option < & :: mtproto :: Page > { match self { & WebPage :: WebPage ( ref x ) => x . cached_page . as_ref ( ) , _ => None } } pub fn date ( & self ) -> Option < & :: mtproto :: int > { match self { & WebPage :: Pending ( ref x ) => Some ( & x . date ) , _ => None } } pub fn description ( & self ) -> Option < & :: mtproto :: string > { match self { & WebPage :: WebPage ( ref x ) => x . description . as_ref ( ) , _ => None } } pub fn display_url ( & self ) -> Option < & :: mtproto :: string > { match self { & WebPage :: WebPage ( ref x ) => Some ( & x . display_url ) , _ => None } } pub fn document ( & self ) -> Option < & :: mtproto :: Document > { match self { & WebPage :: WebPage ( ref x ) => x . document . as_ref ( ) , _ => None } } pub fn duration ( & self ) -> Option < & :: mtproto :: int > { match self { & WebPage :: WebPage ( ref x ) => x . duration . as_ref ( ) , _ => None } } pub fn embed_height ( & self ) -> Option < & :: mtproto :: int > { match self { & WebPage :: WebPage ( ref x ) => x . embed_height . as_ref ( ) , _ => None } } pub fn embed_type ( & self ) -> Option < & :: mtproto :: string > { match self { & WebPage :: WebPage ( ref x ) => x . embed_type . as_ref ( ) , _ => None } } pub fn embed_url ( & self ) -> Option < & :: mtproto :: string > { match self { & WebPage :: WebPage ( ref x ) => x . embed_url . as_ref ( ) , _ => None } } pub fn embed_width ( & self ) -> Option < & :: mtproto :: int > { match self { & WebPage :: WebPage ( ref x ) => x . embed_width . as_ref ( ) , _ => None } } pub fn hash ( & self ) -> Option < & :: mtproto :: int > { match self { & WebPage :: WebPage ( ref x ) => Some ( & x . hash ) , _ => None } } pub fn id ( & self ) -> Option < & :: mtproto :: long > { match self { & WebPage :: Pending ( ref x ) => Some ( & x . id ) , & WebPage :: Empty ( ref x ) => Some ( & x . id ) , & WebPage :: WebPage ( ref x ) => Some ( & x . id ) , _ => None } } pub fn photo ( & self ) -> Option < & :: mtproto :: Photo > { match self { & WebPage :: WebPage ( ref x ) => x . photo . as_ref ( ) , _ => None } } pub fn site_name ( & self ) -> Option < & :: mtproto :: string > { match self { & WebPage :: WebPage ( ref x ) => x . site_name . as_ref ( ) , _ => None } } pub fn title ( & self ) -> Option < & :: mtproto :: string > { match self { & WebPage :: WebPage ( ref x ) => x . title . as_ref ( ) , _ => None } } pub fn type_ ( & self ) -> Option < & :: mtproto :: string > { match self { & WebPage :: WebPage ( ref x ) => x . type_ . as_ref ( ) , _ => None } } pub fn url ( & self ) -> Option < & :: mtproto :: string > { match self { & WebPage :: WebPage ( ref x ) => Some ( & x . url ) , _ => None } } } impl :: BoxedSerialize for WebPage { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & WebPage :: Empty ( ref x ) => ( :: ConstructorNumber ( 0xeb1477e8 ) , x ) , & WebPage :: Pending ( ref x ) => ( :: ConstructorNumber ( 0xc586da1c ) , x ) , & WebPage :: WebPage ( ref x ) => ( :: ConstructorNumber ( 0x5f07b4bc ) , x ) , & WebPage :: NotModified => ( :: ConstructorNumber ( 0x85849473 ) , & ( ) ) , } } } impl :: BoxedDeserialize for WebPage { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xeb1477e8 ) , :: ConstructorNumber ( 0xc586da1c ) , :: ConstructorNumber ( 0x5f07b4bc ) , :: ConstructorNumber ( 0x85849473 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xeb1477e8 ) => Ok ( WebPage :: Empty ( _de . read_bare :: < :: mtproto :: web_page :: Empty > ( ) ? ) ) , :: ConstructorNumber ( 0xc586da1c ) => Ok ( WebPage :: Pending ( _de . read_bare :: < :: mtproto :: web_page :: Pending > ( ) ? ) ) , :: ConstructorNumber ( 0x5f07b4bc ) => Ok ( WebPage :: WebPage ( _de . read_bare :: < :: mtproto :: web_page :: WebPage > ( ) ? ) ) , :: ConstructorNumber ( 0x85849473 ) => Ok ( WebPage :: NotModified ) , id => _invalid_id ! ( id ) , } } } pub mod account { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `account.Authorizations`\n\n```text\naccount.authorizations#1250abde authorizations:Vector<Authorization> = account.Authorizations;\n```\n" ] pub enum Authorizations { Authorizations ( :: mtproto :: account :: authorizations :: Authorizations ) , } impl Authorizations { pub fn authorizations ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Authorization > { match self { & Authorizations :: Authorizations ( ref x ) => & x . authorizations , } } } impl :: BoxedSerialize for Authorizations { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Authorizations :: Authorizations ( ref x ) => ( :: ConstructorNumber ( 0x1250abde ) , x ) , } } } impl :: BoxedDeserialize for Authorizations { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x1250abde ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x1250abde ) => Ok ( Authorizations :: Authorizations ( _de . read_bare :: < :: mtproto :: account :: authorizations :: Authorizations > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `account.Password`\n\n```text\naccount.noPassword#96dabc18 new_salt:bytes email_unconfirmed_pattern:string = account.Password;\n\naccount.password#7c18141c current_salt:bytes new_salt:bytes hint:string has_recovery:Bool email_unconfirmed_pattern:string = account.Password;\n```\n" ] pub enum Password { NoPassword ( :: mtproto :: account :: password :: NoPassword ) , Password ( :: mtproto :: account :: password :: Password ) , } impl Password { pub fn current_salt ( & self ) -> Option < & :: mtproto :: bytes > { match self { & Password :: Password ( ref x ) => Some ( & x . current_salt ) , _ => None } } pub fn email_unconfirmed_pattern ( & self ) -> & :: mtproto :: string { match self { & Password :: Password ( ref x ) => & x . email_unconfirmed_pattern , & Password :: NoPassword ( ref x ) => & x . email_unconfirmed_pattern , } } pub fn has_recovery ( & self ) -> Option < & :: mtproto :: Bool > { match self { & Password :: Password ( ref x ) => Some ( & x . has_recovery ) , _ => None } } pub fn hint ( & self ) -> Option < & :: mtproto :: string > { match self { & Password :: Password ( ref x ) => Some ( & x . hint ) , _ => None } } pub fn new_salt ( & self ) -> & :: mtproto :: bytes { match self { & Password :: NoPassword ( ref x ) => & x . new_salt , & Password :: Password ( ref x ) => & x . new_salt , } } } impl :: BoxedSerialize for Password { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Password :: NoPassword ( ref x ) => ( :: ConstructorNumber ( 0x96dabc18 ) , x ) , & Password :: Password ( ref x ) => ( :: ConstructorNumber ( 0x7c18141c ) , x ) , } } } impl :: BoxedDeserialize for Password { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x96dabc18 ) , :: ConstructorNumber ( 0x7c18141c ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x96dabc18 ) => Ok ( Password :: NoPassword ( _de . read_bare :: < :: mtproto :: account :: password :: NoPassword > ( ) ? ) ) , :: ConstructorNumber ( 0x7c18141c ) => Ok ( Password :: Password ( _de . read_bare :: < :: mtproto :: account :: password :: Password > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `account.PasswordInputSettings`\n\n```text\naccount.passwordInputSettings#86916deb flags:# new_salt:flags.0?bytes new_password_hash:flags.0?bytes hint:flags.0?string email:flags.1?string = account.PasswordInputSettings;\n```\n" ] pub enum PasswordInputSettings { PasswordInputSettings ( :: mtproto :: account :: password_input_settings :: PasswordInputSettings ) , } impl PasswordInputSettings { pub fn email ( & self ) -> Option < & :: mtproto :: string > { match self { & PasswordInputSettings :: PasswordInputSettings ( ref x ) => x . email . as_ref ( ) , } } pub fn hint ( & self ) -> Option < & :: mtproto :: string > { match self { & PasswordInputSettings :: PasswordInputSettings ( ref x ) => x . hint . as_ref ( ) , } } pub fn new_password_hash ( & self ) -> Option < & :: mtproto :: bytes > { match self { & PasswordInputSettings :: PasswordInputSettings ( ref x ) => x . new_password_hash . as_ref ( ) , } } pub fn new_salt ( & self ) -> Option < & :: mtproto :: bytes > { match self { & PasswordInputSettings :: PasswordInputSettings ( ref x ) => x . new_salt . as_ref ( ) , } } } impl :: BoxedSerialize for PasswordInputSettings { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & PasswordInputSettings :: PasswordInputSettings ( ref x ) => ( :: ConstructorNumber ( 0x86916deb ) , x ) , } } } impl :: BoxedDeserialize for PasswordInputSettings { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x86916deb ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x86916deb ) => Ok ( PasswordInputSettings :: PasswordInputSettings ( _de . read_bare :: < :: mtproto :: account :: password_input_settings :: PasswordInputSettings > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `account.PasswordSettings`\n\n```text\naccount.passwordSettings#b7b72ab3 email:string = account.PasswordSettings;\n```\n" ] pub enum PasswordSettings { PasswordSettings ( :: mtproto :: account :: password_settings :: PasswordSettings ) , } impl PasswordSettings { pub fn email ( & self ) -> & :: mtproto :: string { match self { & PasswordSettings :: PasswordSettings ( ref x ) => & x . email , } } } impl :: BoxedSerialize for PasswordSettings { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & PasswordSettings :: PasswordSettings ( ref x ) => ( :: ConstructorNumber ( 0xb7b72ab3 ) , x ) , } } } impl :: BoxedDeserialize for PasswordSettings { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xb7b72ab3 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xb7b72ab3 ) => Ok ( PasswordSettings :: PasswordSettings ( _de . read_bare :: < :: mtproto :: account :: password_settings :: PasswordSettings > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `account.PrivacyRules`\n\n```text\naccount.privacyRules#554abb6f rules:Vector<PrivacyRule> users:Vector<User> = account.PrivacyRules;\n```\n" ] pub enum PrivacyRules { PrivacyRules ( :: mtproto :: account :: privacy_rules :: PrivacyRules ) , } impl PrivacyRules { pub fn rules ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PrivacyRule > { match self { & PrivacyRules :: PrivacyRules ( ref x ) => & x . rules , } } pub fn users ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > { match self { & PrivacyRules :: PrivacyRules ( ref x ) => & x . users , } } } impl :: BoxedSerialize for PrivacyRules { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & PrivacyRules :: PrivacyRules ( ref x ) => ( :: ConstructorNumber ( 0x554abb6f ) , x ) , } } } impl :: BoxedDeserialize for PrivacyRules { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x554abb6f ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x554abb6f ) => Ok ( PrivacyRules :: PrivacyRules ( _de . read_bare :: < :: mtproto :: account :: privacy_rules :: PrivacyRules > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `account.TmpPassword`\n\n```text\naccount.tmpPassword#db64fd34 tmp_password:bytes valid_until:int = account.TmpPassword;\n```\n" ] pub enum TmpPassword { TmpPassword ( :: mtproto :: account :: tmp_password :: TmpPassword ) , } impl TmpPassword { pub fn tmp_password ( & self ) -> & :: mtproto :: bytes { match self { & TmpPassword :: TmpPassword ( ref x ) => & x . tmp_password , } } pub fn valid_until ( & self ) -> & :: mtproto :: int { match self { & TmpPassword :: TmpPassword ( ref x ) => & x . valid_until , } } } impl :: BoxedSerialize for TmpPassword { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & TmpPassword :: TmpPassword ( ref x ) => ( :: ConstructorNumber ( 0xdb64fd34 ) , x ) , } } } impl :: BoxedDeserialize for TmpPassword { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xdb64fd34 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xdb64fd34 ) => Ok ( TmpPassword :: TmpPassword ( _de . read_bare :: < :: mtproto :: account :: tmp_password :: TmpPassword > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } pub mod authorizations { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `account.authorizations`\n\n```text\naccount.authorizations#1250abde authorizations:Vector<Authorization> = account.Authorizations;\n```\n" ] pub struct Authorizations { pub authorizations : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Authorization > , } impl :: BareSerialize for Authorizations { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Authorizations { ref authorizations } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Authorization > > ( authorizations ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Authorizations { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Authorizations { authorizations : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Authorization > > ( ) ? , } ) } } impl :: IntoBoxed for Authorizations { type Boxed = :: mtproto :: account :: Authorizations ; fn into_boxed ( self ) -> :: mtproto :: account :: Authorizations { :: mtproto :: account :: Authorizations :: Authorizations ( self ) } } } pub mod password { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `account.noPassword`\n\n```text\naccount.noPassword#96dabc18 new_salt:bytes email_unconfirmed_pattern:string = account.Password;\n```\n" ] pub struct NoPassword { pub new_salt : :: mtproto :: bytes , pub email_unconfirmed_pattern : :: mtproto :: string , } impl :: BareSerialize for NoPassword { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & NoPassword { ref new_salt , ref email_unconfirmed_pattern } = self ; _ser . write_bare :: < :: mtproto :: bytes > ( new_salt ) ? ; _ser . write_bare :: < :: mtproto :: string > ( email_unconfirmed_pattern ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for NoPassword { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( NoPassword { new_salt : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , email_unconfirmed_pattern : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for NoPassword { type Boxed = :: mtproto :: account :: Password ; fn into_boxed ( self ) -> :: mtproto :: account :: Password { :: mtproto :: account :: Password :: NoPassword ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `account.password`\n\n```text\naccount.password#7c18141c current_salt:bytes new_salt:bytes hint:string has_recovery:Bool email_unconfirmed_pattern:string = account.Password;\n```\n" ] pub struct Password { pub current_salt : :: mtproto :: bytes , pub new_salt : :: mtproto :: bytes , pub hint : :: mtproto :: string , pub has_recovery : :: mtproto :: Bool , pub email_unconfirmed_pattern : :: mtproto :: string , } impl :: BareSerialize for Password { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Password { ref current_salt , ref new_salt , ref hint , ref has_recovery , ref email_unconfirmed_pattern } = self ; _ser . write_bare :: < :: mtproto :: bytes > ( current_salt ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( new_salt ) ? ; _ser . write_bare :: < :: mtproto :: string > ( hint ) ? ; _ser . write_boxed :: < :: mtproto :: Bool > ( has_recovery ) ? ; _ser . write_bare :: < :: mtproto :: string > ( email_unconfirmed_pattern ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Password { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Password { current_salt : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , new_salt : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , hint : _de . read_bare :: < :: mtproto :: string > ( ) ? , has_recovery : _de . read_boxed :: < :: mtproto :: Bool > ( ) ? , email_unconfirmed_pattern : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for Password { type Boxed = :: mtproto :: account :: Password ; fn into_boxed ( self ) -> :: mtproto :: account :: Password { :: mtproto :: account :: Password :: Password ( self ) } } } pub mod password_input_settings { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `account.passwordInputSettings`\n\n```text\naccount.passwordInputSettings#86916deb flags:# new_salt:flags.0?bytes new_password_hash:flags.0?bytes hint:flags.0?string email:flags.1?string = account.PasswordInputSettings;\n```\n" ] pub struct PasswordInputSettings { pub new_salt : Option < :: mtproto :: bytes > , pub new_password_hash : Option < :: mtproto :: bytes > , pub hint : Option < :: mtproto :: string > , pub email : Option < :: mtproto :: string > , } impl :: BareSerialize for PasswordInputSettings { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & PasswordInputSettings { ref new_salt , ref new_password_hash , ref hint , ref email } = self ; let mut _flags = 0i32 ; if new_salt . is_some ( ) { _flags |= 1 << 0u32 ; } if new_password_hash . is_some ( ) { _flags |= 1 << 0u32 ; } if hint . is_some ( ) { _flags |= 1 << 0u32 ; } if email . is_some ( ) { _flags |= 1 << 1u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; if let & Some ( ref inner ) = new_salt { _ser . write_bare :: < :: mtproto :: bytes > ( inner ) ? ; } if let & Some ( ref inner ) = new_password_hash { _ser . write_bare :: < :: mtproto :: bytes > ( inner ) ? ; } if let & Some ( ref inner ) = hint { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = email { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for PasswordInputSettings { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( PasswordInputSettings { new_salt : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; if _flags & ( 1 << 0u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: bytes > ( ) ? ) } else { None } } , new_password_hash : if _flags & ( 1 << 0u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: bytes > ( ) ? ) } else { None } , hint : if _flags & ( 1 << 0u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , email : if _flags & ( 1 << 1u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for PasswordInputSettings { type Boxed = :: mtproto :: account :: PasswordInputSettings ; fn into_boxed ( self ) -> :: mtproto :: account :: PasswordInputSettings { :: mtproto :: account :: PasswordInputSettings :: PasswordInputSettings ( self ) } } } pub mod password_settings { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `account.passwordSettings`\n\n```text\naccount.passwordSettings#b7b72ab3 email:string = account.PasswordSettings;\n```\n" ] pub struct PasswordSettings { pub email : :: mtproto :: string , } impl :: BareSerialize for PasswordSettings { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & PasswordSettings { ref email } = self ; _ser . write_bare :: < :: mtproto :: string > ( email ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for PasswordSettings { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( PasswordSettings { email : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for PasswordSettings { type Boxed = :: mtproto :: account :: PasswordSettings ; fn into_boxed ( self ) -> :: mtproto :: account :: PasswordSettings { :: mtproto :: account :: PasswordSettings :: PasswordSettings ( self ) } } } pub mod privacy_rules { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `account.privacyRules`\n\n```text\naccount.privacyRules#554abb6f rules:Vector<PrivacyRule> users:Vector<User> = account.PrivacyRules;\n```\n" ] pub struct PrivacyRules { pub rules : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PrivacyRule > , pub users : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > , } impl :: BareSerialize for PrivacyRules { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & PrivacyRules { ref rules , ref users } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PrivacyRule > > ( rules ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( users ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for PrivacyRules { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( PrivacyRules { rules : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PrivacyRule > > ( ) ? , users : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( ) ? , } ) } } impl :: IntoBoxed for PrivacyRules { type Boxed = :: mtproto :: account :: PrivacyRules ; fn into_boxed ( self ) -> :: mtproto :: account :: PrivacyRules { :: mtproto :: account :: PrivacyRules :: PrivacyRules ( self ) } } } pub mod tmp_password { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `account.tmpPassword`\n\n```text\naccount.tmpPassword#db64fd34 tmp_password:bytes valid_until:int = account.TmpPassword;\n```\n" ] pub struct TmpPassword { pub tmp_password : :: mtproto :: bytes , pub valid_until : :: mtproto :: int , } impl :: BareSerialize for TmpPassword { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & TmpPassword { ref tmp_password , ref valid_until } = self ; _ser . write_bare :: < :: mtproto :: bytes > ( tmp_password ) ? ; _ser . write_bare :: < :: mtproto :: int > ( valid_until ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for TmpPassword { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( TmpPassword { tmp_password : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , valid_until : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for TmpPassword { type Boxed = :: mtproto :: account :: TmpPassword ; fn into_boxed ( self ) -> :: mtproto :: account :: TmpPassword { :: mtproto :: account :: TmpPassword :: TmpPassword ( self ) } } } } pub mod account_days_ttl { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `accountDaysTTL`\n\n```text\naccountDaysTTL#b8d0afdf days:int = AccountDaysTTL;\n```\n" ] pub struct AccountDaysTTL { pub days : :: mtproto :: int , } impl :: BareSerialize for AccountDaysTTL { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & AccountDaysTTL { ref days } = self ; _ser . write_bare :: < :: mtproto :: int > ( days ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for AccountDaysTTL { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( AccountDaysTTL { days : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for AccountDaysTTL { type Boxed = :: mtproto :: AccountDaysTTL ; fn into_boxed ( self ) -> :: mtproto :: AccountDaysTTL { :: mtproto :: AccountDaysTTL :: AccountDaysTTL ( self ) } } } pub mod auth { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `auth.Authorization`\n\n```text\nauth.authorization#cd050916 flags:# tmp_sessions:flags.0?int user:User = auth.Authorization;\n```\n" ] pub enum Authorization { Authorization ( :: mtproto :: auth :: authorization :: Authorization ) , } impl Authorization { pub fn tmp_sessions ( & self ) -> Option < & :: mtproto :: int > { match self { & Authorization :: Authorization ( ref x ) => x . tmp_sessions . as_ref ( ) , } } pub fn user ( & self ) -> & :: mtproto :: User { match self { & Authorization :: Authorization ( ref x ) => & x . user , } } } impl :: BoxedSerialize for Authorization { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Authorization :: Authorization ( ref x ) => ( :: ConstructorNumber ( 0xcd050916 ) , x ) , } } } impl :: BoxedDeserialize for Authorization { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xcd050916 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xcd050916 ) => Ok ( Authorization :: Authorization ( _de . read_bare :: < :: mtproto :: auth :: authorization :: Authorization > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `auth.CheckedPhone`\n\n```text\nauth.checkedPhone#811ea28e phone_registered:Bool = auth.CheckedPhone;\n```\n" ] pub enum CheckedPhone { CheckedPhone ( :: mtproto :: auth :: checked_phone :: CheckedPhone ) , } impl CheckedPhone { pub fn phone_registered ( & self ) -> & :: mtproto :: Bool { match self { & CheckedPhone :: CheckedPhone ( ref x ) => & x . phone_registered , } } } impl :: BoxedSerialize for CheckedPhone { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & CheckedPhone :: CheckedPhone ( ref x ) => ( :: ConstructorNumber ( 0x811ea28e ) , x ) , } } } impl :: BoxedDeserialize for CheckedPhone { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x811ea28e ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x811ea28e ) => Ok ( CheckedPhone :: CheckedPhone ( _de . read_bare :: < :: mtproto :: auth :: checked_phone :: CheckedPhone > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `auth.CodeType`\n\n```text\nauth.codeTypeSms#72a3158c = auth.CodeType;\n\nauth.codeTypeCall#741cd3e3 = auth.CodeType;\n\nauth.codeTypeFlashCall#226ccefb = auth.CodeType;\n```\n" ] pub enum CodeType { Sms , Call , FlashCall , } impl :: BoxedSerialize for CodeType { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & CodeType :: Sms => ( :: ConstructorNumber ( 0x72a3158c ) , & ( ) ) , & CodeType :: Call => ( :: ConstructorNumber ( 0x741cd3e3 ) , & ( ) ) , & CodeType :: FlashCall => ( :: ConstructorNumber ( 0x226ccefb ) , & ( ) ) , } } } impl :: BoxedDeserialize for CodeType { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x72a3158c ) , :: ConstructorNumber ( 0x741cd3e3 ) , :: ConstructorNumber ( 0x226ccefb ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x72a3158c ) => Ok ( CodeType :: Sms ) , :: ConstructorNumber ( 0x741cd3e3 ) => Ok ( CodeType :: Call ) , :: ConstructorNumber ( 0x226ccefb ) => Ok ( CodeType :: FlashCall ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `auth.ExportedAuthorization`\n\n```text\nauth.exportedAuthorization#df969c2d id:int bytes:bytes = auth.ExportedAuthorization;\n```\n" ] pub enum ExportedAuthorization { ExportedAuthorization ( :: mtproto :: auth :: exported_authorization :: ExportedAuthorization ) , } impl ExportedAuthorization { pub fn bytes ( & self ) -> & :: mtproto :: bytes { match self { & ExportedAuthorization :: ExportedAuthorization ( ref x ) => & x . bytes , } } pub fn id ( & self ) -> & :: mtproto :: int { match self { & ExportedAuthorization :: ExportedAuthorization ( ref x ) => & x . id , } } } impl :: BoxedSerialize for ExportedAuthorization { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ExportedAuthorization :: ExportedAuthorization ( ref x ) => ( :: ConstructorNumber ( 0xdf969c2d ) , x ) , } } } impl :: BoxedDeserialize for ExportedAuthorization { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xdf969c2d ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xdf969c2d ) => Ok ( ExportedAuthorization :: ExportedAuthorization ( _de . read_bare :: < :: mtproto :: auth :: exported_authorization :: ExportedAuthorization > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `auth.PasswordRecovery`\n\n```text\nauth.passwordRecovery#137948a5 email_pattern:string = auth.PasswordRecovery;\n```\n" ] pub enum PasswordRecovery { PasswordRecovery ( :: mtproto :: auth :: password_recovery :: PasswordRecovery ) , } impl PasswordRecovery { pub fn email_pattern ( & self ) -> & :: mtproto :: string { match self { & PasswordRecovery :: PasswordRecovery ( ref x ) => & x . email_pattern , } } } impl :: BoxedSerialize for PasswordRecovery { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & PasswordRecovery :: PasswordRecovery ( ref x ) => ( :: ConstructorNumber ( 0x137948a5 ) , x ) , } } } impl :: BoxedDeserialize for PasswordRecovery { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x137948a5 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x137948a5 ) => Ok ( PasswordRecovery :: PasswordRecovery ( _de . read_bare :: < :: mtproto :: auth :: password_recovery :: PasswordRecovery > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `auth.SentCode`\n\n```text\nauth.sentCode#5e002502 flags:# phone_registered:flags.0?true type:auth.SentCodeType phone_code_hash:string next_type:flags.1?auth.CodeType timeout:flags.2?int = auth.SentCode;\n```\n" ] pub enum SentCode { SentCode ( :: mtproto :: auth :: sent_code :: SentCode ) , } impl SentCode { pub fn next_type ( & self ) -> Option < & :: mtproto :: auth :: CodeType > { match self { & SentCode :: SentCode ( ref x ) => x . next_type . as_ref ( ) , } } pub fn phone_code_hash ( & self ) -> & :: mtproto :: string { match self { & SentCode :: SentCode ( ref x ) => & x . phone_code_hash , } } pub fn phone_registered ( & self ) -> bool { match self { & SentCode :: SentCode ( ref x ) => x . phone_registered , } } pub fn timeout ( & self ) -> Option < & :: mtproto :: int > { match self { & SentCode :: SentCode ( ref x ) => x . timeout . as_ref ( ) , } } pub fn type_ ( & self ) -> & :: mtproto :: auth :: SentCodeType { match self { & SentCode :: SentCode ( ref x ) => & x . type_ , } } } impl :: BoxedSerialize for SentCode { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & SentCode :: SentCode ( ref x ) => ( :: ConstructorNumber ( 0x5e002502 ) , x ) , } } } impl :: BoxedDeserialize for SentCode { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x5e002502 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x5e002502 ) => Ok ( SentCode :: SentCode ( _de . read_bare :: < :: mtproto :: auth :: sent_code :: SentCode > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `auth.SentCodeType`\n\n```text\nauth.sentCodeTypeApp#3dbb5986 length:int = auth.SentCodeType;\n\nauth.sentCodeTypeSms#c000bba2 length:int = auth.SentCodeType;\n\nauth.sentCodeTypeCall#5353e5a7 length:int = auth.SentCodeType;\n\nauth.sentCodeTypeFlashCall#ab03c6d9 pattern:string = auth.SentCodeType;\n```\n" ] pub enum SentCodeType { App ( :: mtproto :: auth :: sent_code_type :: App ) , Sms ( :: mtproto :: auth :: sent_code_type :: Sms ) , Call ( :: mtproto :: auth :: sent_code_type :: Call ) , FlashCall ( :: mtproto :: auth :: sent_code_type :: FlashCall ) , } impl SentCodeType { pub fn length ( & self ) -> Option < & :: mtproto :: int > { match self { & SentCodeType :: Call ( ref x ) => Some ( & x . length ) , & SentCodeType :: App ( ref x ) => Some ( & x . length ) , & SentCodeType :: Sms ( ref x ) => Some ( & x . length ) , _ => None } } pub fn pattern ( & self ) -> Option < & :: mtproto :: string > { match self { & SentCodeType :: FlashCall ( ref x ) => Some ( & x . pattern ) , _ => None } } } impl :: BoxedSerialize for SentCodeType { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & SentCodeType :: App ( ref x ) => ( :: ConstructorNumber ( 0x3dbb5986 ) , x ) , & SentCodeType :: Sms ( ref x ) => ( :: ConstructorNumber ( 0xc000bba2 ) , x ) , & SentCodeType :: Call ( ref x ) => ( :: ConstructorNumber ( 0x5353e5a7 ) , x ) , & SentCodeType :: FlashCall ( ref x ) => ( :: ConstructorNumber ( 0xab03c6d9 ) , x ) , } } } impl :: BoxedDeserialize for SentCodeType { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x3dbb5986 ) , :: ConstructorNumber ( 0xc000bba2 ) , :: ConstructorNumber ( 0x5353e5a7 ) , :: ConstructorNumber ( 0xab03c6d9 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x3dbb5986 ) => Ok ( SentCodeType :: App ( _de . read_bare :: < :: mtproto :: auth :: sent_code_type :: App > ( ) ? ) ) , :: ConstructorNumber ( 0xc000bba2 ) => Ok ( SentCodeType :: Sms ( _de . read_bare :: < :: mtproto :: auth :: sent_code_type :: Sms > ( ) ? ) ) , :: ConstructorNumber ( 0x5353e5a7 ) => Ok ( SentCodeType :: Call ( _de . read_bare :: < :: mtproto :: auth :: sent_code_type :: Call > ( ) ? ) ) , :: ConstructorNumber ( 0xab03c6d9 ) => Ok ( SentCodeType :: FlashCall ( _de . read_bare :: < :: mtproto :: auth :: sent_code_type :: FlashCall > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } pub mod authorization { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `auth.authorization`\n\n```text\nauth.authorization#cd050916 flags:# tmp_sessions:flags.0?int user:User = auth.Authorization;\n```\n" ] pub struct Authorization { pub tmp_sessions : Option < :: mtproto :: int > , pub user : :: mtproto :: User , } impl :: BareSerialize for Authorization { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Authorization { ref tmp_sessions , ref user } = self ; let mut _flags = 0i32 ; if tmp_sessions . is_some ( ) { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; if let & Some ( ref inner ) = tmp_sessions { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } _ser . write_boxed :: < :: mtproto :: User > ( user ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Authorization { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( Authorization { tmp_sessions : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; if _flags & ( 1 << 0u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } } , user : _de . read_boxed :: < :: mtproto :: User > ( ) ? , } ) } } impl :: IntoBoxed for Authorization { type Boxed = :: mtproto :: auth :: Authorization ; fn into_boxed ( self ) -> :: mtproto :: auth :: Authorization { :: mtproto :: auth :: Authorization :: Authorization ( self ) } } } pub mod checked_phone { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `auth.checkedPhone`\n\n```text\nauth.checkedPhone#811ea28e phone_registered:Bool = auth.CheckedPhone;\n```\n" ] pub struct CheckedPhone { pub phone_registered : :: mtproto :: Bool , } impl :: BareSerialize for CheckedPhone { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & CheckedPhone { ref phone_registered } = self ; _ser . write_boxed :: < :: mtproto :: Bool > ( phone_registered ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for CheckedPhone { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( CheckedPhone { phone_registered : _de . read_boxed :: < :: mtproto :: Bool > ( ) ? , } ) } } impl :: IntoBoxed for CheckedPhone { type Boxed = :: mtproto :: auth :: CheckedPhone ; fn into_boxed ( self ) -> :: mtproto :: auth :: CheckedPhone { :: mtproto :: auth :: CheckedPhone :: CheckedPhone ( self ) } } } pub mod code_type { } pub mod exported_authorization { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `auth.exportedAuthorization`\n\n```text\nauth.exportedAuthorization#df969c2d id:int bytes:bytes = auth.ExportedAuthorization;\n```\n" ] pub struct ExportedAuthorization { pub id : :: mtproto :: int , pub bytes : :: mtproto :: bytes , } impl :: BareSerialize for ExportedAuthorization { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ExportedAuthorization { ref id , bytes : ref bytes_ } = self ; _ser . write_bare :: < :: mtproto :: int > ( id ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( bytes_ ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ExportedAuthorization { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ExportedAuthorization { id : _de . read_bare :: < :: mtproto :: int > ( ) ? , bytes : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , } ) } } impl :: IntoBoxed for ExportedAuthorization { type Boxed = :: mtproto :: auth :: ExportedAuthorization ; fn into_boxed ( self ) -> :: mtproto :: auth :: ExportedAuthorization { :: mtproto :: auth :: ExportedAuthorization :: ExportedAuthorization ( self ) } } } pub mod password_recovery { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `auth.passwordRecovery`\n\n```text\nauth.passwordRecovery#137948a5 email_pattern:string = auth.PasswordRecovery;\n```\n" ] pub struct PasswordRecovery { pub email_pattern : :: mtproto :: string , } impl :: BareSerialize for PasswordRecovery { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & PasswordRecovery { ref email_pattern } = self ; _ser . write_bare :: < :: mtproto :: string > ( email_pattern ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for PasswordRecovery { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( PasswordRecovery { email_pattern : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for PasswordRecovery { type Boxed = :: mtproto :: auth :: PasswordRecovery ; fn into_boxed ( self ) -> :: mtproto :: auth :: PasswordRecovery { :: mtproto :: auth :: PasswordRecovery :: PasswordRecovery ( self ) } } } pub mod sent_code { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `auth.sentCode`\n\n```text\nauth.sentCode#5e002502 flags:# phone_registered:flags.0?true type:auth.SentCodeType phone_code_hash:string next_type:flags.1?auth.CodeType timeout:flags.2?int = auth.SentCode;\n```\n" ] pub struct SentCode { pub phone_registered : bool , pub type_ : :: mtproto :: auth :: SentCodeType , pub phone_code_hash : :: mtproto :: string , pub next_type : Option < :: mtproto :: auth :: CodeType > , pub timeout : Option < :: mtproto :: int > , } impl :: BareSerialize for SentCode { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & SentCode { phone_registered , ref type_ , ref phone_code_hash , ref next_type , ref timeout } = self ; let mut _flags = 0i32 ; if phone_registered { _flags |= 1 << 0u32 ; } if next_type . is_some ( ) { _flags |= 1 << 1u32 ; } if timeout . is_some ( ) { _flags |= 1 << 2u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_boxed :: < :: mtproto :: auth :: SentCodeType > ( type_ ) ? ; _ser . write_bare :: < :: mtproto :: string > ( phone_code_hash ) ? ; if let & Some ( ref inner ) = next_type { _ser . write_boxed :: < :: mtproto :: auth :: CodeType > ( inner ) ? ; } if let & Some ( ref inner ) = timeout { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for SentCode { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( SentCode { phone_registered : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 0u32 ) != 0 } , type_ : _de . read_boxed :: < :: mtproto :: auth :: SentCodeType > ( ) ? , phone_code_hash : _de . read_bare :: < :: mtproto :: string > ( ) ? , next_type : if _flags & ( 1 << 1u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: auth :: CodeType > ( ) ? ) } else { None } , timeout : if _flags & ( 1 << 2u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for SentCode { type Boxed = :: mtproto :: auth :: SentCode ; fn into_boxed ( self ) -> :: mtproto :: auth :: SentCode { :: mtproto :: auth :: SentCode :: SentCode ( self ) } } } pub mod sent_code_type { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `auth.sentCodeTypeApp`\n\n```text\nauth.sentCodeTypeApp#3dbb5986 length:int = auth.SentCodeType;\n```\n" ] pub struct App { pub length : :: mtproto :: int , } impl :: BareSerialize for App { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & App { ref length } = self ; _ser . write_bare :: < :: mtproto :: int > ( length ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for App { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( App { length : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for App { type Boxed = :: mtproto :: auth :: SentCodeType ; fn into_boxed ( self ) -> :: mtproto :: auth :: SentCodeType { :: mtproto :: auth :: SentCodeType :: App ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `auth.sentCodeTypeCall`\n\n```text\nauth.sentCodeTypeCall#5353e5a7 length:int = auth.SentCodeType;\n```\n" ] pub struct Call { pub length : :: mtproto :: int , } impl :: BareSerialize for Call { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Call { ref length } = self ; _ser . write_bare :: < :: mtproto :: int > ( length ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Call { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Call { length : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for Call { type Boxed = :: mtproto :: auth :: SentCodeType ; fn into_boxed ( self ) -> :: mtproto :: auth :: SentCodeType { :: mtproto :: auth :: SentCodeType :: Call ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `auth.sentCodeTypeFlashCall`\n\n```text\nauth.sentCodeTypeFlashCall#ab03c6d9 pattern:string = auth.SentCodeType;\n```\n" ] pub struct FlashCall { pub pattern : :: mtproto :: string , } impl :: BareSerialize for FlashCall { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & FlashCall { ref pattern } = self ; _ser . write_bare :: < :: mtproto :: string > ( pattern ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for FlashCall { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( FlashCall { pattern : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for FlashCall { type Boxed = :: mtproto :: auth :: SentCodeType ; fn into_boxed ( self ) -> :: mtproto :: auth :: SentCodeType { :: mtproto :: auth :: SentCodeType :: FlashCall ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `auth.sentCodeTypeSms`\n\n```text\nauth.sentCodeTypeSms#c000bba2 length:int = auth.SentCodeType;\n```\n" ] pub struct Sms { pub length : :: mtproto :: int , } impl :: BareSerialize for Sms { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Sms { ref length } = self ; _ser . write_bare :: < :: mtproto :: int > ( length ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Sms { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Sms { length : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for Sms { type Boxed = :: mtproto :: auth :: SentCodeType ; fn into_boxed ( self ) -> :: mtproto :: auth :: SentCodeType { :: mtproto :: auth :: SentCodeType :: Sms ( self ) } } } } pub mod authorization { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `authorization`\n\n```text\nauthorization#7bf2e6f6 hash:long flags:int device_model:string platform:string system_version:string api_id:int app_name:string app_version:string date_created:int date_active:int ip:string country:string region:string = Authorization;\n```\n" ] pub struct Authorization { pub hash : :: mtproto :: long , pub flags : :: mtproto :: int , pub device_model : :: mtproto :: string , pub platform : :: mtproto :: string , pub system_version : :: mtproto :: string , pub api_id : :: mtproto :: int , pub app_name : :: mtproto :: string , pub app_version : :: mtproto :: string , pub date_created : :: mtproto :: int , pub date_active : :: mtproto :: int , pub ip : :: mtproto :: string , pub country : :: mtproto :: string , pub region : :: mtproto :: string , } impl :: BareSerialize for Authorization { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Authorization { ref hash , ref flags , ref device_model , ref platform , ref system_version , ref api_id , ref app_name , ref app_version , ref date_created , ref date_active , ref ip , ref country , ref region } = self ; _ser . write_bare :: < :: mtproto :: long > ( hash ) ? ; _ser . write_bare :: < :: mtproto :: int > ( flags ) ? ; _ser . write_bare :: < :: mtproto :: string > ( device_model ) ? ; _ser . write_bare :: < :: mtproto :: string > ( platform ) ? ; _ser . write_bare :: < :: mtproto :: string > ( system_version ) ? ; _ser . write_bare :: < :: mtproto :: int > ( api_id ) ? ; _ser . write_bare :: < :: mtproto :: string > ( app_name ) ? ; _ser . write_bare :: < :: mtproto :: string > ( app_version ) ? ; _ser . write_bare :: < :: mtproto :: int > ( date_created ) ? ; _ser . write_bare :: < :: mtproto :: int > ( date_active ) ? ; _ser . write_bare :: < :: mtproto :: string > ( ip ) ? ; _ser . write_bare :: < :: mtproto :: string > ( country ) ? ; _ser . write_bare :: < :: mtproto :: string > ( region ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Authorization { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Authorization { hash : _de . read_bare :: < :: mtproto :: long > ( ) ? , flags : _de . read_bare :: < :: mtproto :: int > ( ) ? , device_model : _de . read_bare :: < :: mtproto :: string > ( ) ? , platform : _de . read_bare :: < :: mtproto :: string > ( ) ? , system_version : _de . read_bare :: < :: mtproto :: string > ( ) ? , api_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , app_name : _de . read_bare :: < :: mtproto :: string > ( ) ? , app_version : _de . read_bare :: < :: mtproto :: string > ( ) ? , date_created : _de . read_bare :: < :: mtproto :: int > ( ) ? , date_active : _de . read_bare :: < :: mtproto :: int > ( ) ? , ip : _de . read_bare :: < :: mtproto :: string > ( ) ? , country : _de . read_bare :: < :: mtproto :: string > ( ) ? , region : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for Authorization { type Boxed = :: mtproto :: Authorization ; fn into_boxed ( self ) -> :: mtproto :: Authorization { :: mtproto :: Authorization :: Authorization ( self ) } } } pub mod bad { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `bad_msg_notification`\n\n```text\nbad_msg_notification#a7eff811 bad_msg_id:long bad_msg_seqno:int error_code:int = BadMsgNotification;\n```\n" ] pub struct MsgNotification { pub bad_msg_id : :: mtproto :: long , pub bad_msg_seqno : :: mtproto :: int , pub error_code : :: mtproto :: int , } impl :: BareSerialize for MsgNotification { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & MsgNotification { ref bad_msg_id , ref bad_msg_seqno , ref error_code } = self ; _ser . write_bare :: < :: mtproto :: long > ( bad_msg_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( bad_msg_seqno ) ? ; _ser . write_bare :: < :: mtproto :: int > ( error_code ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for MsgNotification { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( MsgNotification { bad_msg_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , bad_msg_seqno : _de . read_bare :: < :: mtproto :: int > ( ) ? , error_code : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for MsgNotification { type Boxed = :: mtproto :: BadMsgNotification ; fn into_boxed ( self ) -> :: mtproto :: BadMsgNotification { :: mtproto :: BadMsgNotification :: MsgNotification ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `bad_server_salt`\n\n```text\nbad_server_salt#edab447b bad_msg_id:long bad_msg_seqno:int error_code:int new_server_salt:long = BadMsgNotification;\n```\n" ] pub struct ServerSalt { pub bad_msg_id : :: mtproto :: long , pub bad_msg_seqno : :: mtproto :: int , pub error_code : :: mtproto :: int , pub new_server_salt : :: mtproto :: long , } impl :: BareSerialize for ServerSalt { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ServerSalt { ref bad_msg_id , ref bad_msg_seqno , ref error_code , ref new_server_salt } = self ; _ser . write_bare :: < :: mtproto :: long > ( bad_msg_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( bad_msg_seqno ) ? ; _ser . write_bare :: < :: mtproto :: int > ( error_code ) ? ; _ser . write_bare :: < :: mtproto :: long > ( new_server_salt ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ServerSalt { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ServerSalt { bad_msg_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , bad_msg_seqno : _de . read_bare :: < :: mtproto :: int > ( ) ? , error_code : _de . read_bare :: < :: mtproto :: int > ( ) ? , new_server_salt : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for ServerSalt { type Boxed = :: mtproto :: BadMsgNotification ; fn into_boxed ( self ) -> :: mtproto :: BadMsgNotification { :: mtproto :: BadMsgNotification :: ServerSalt ( self ) } } } pub mod bool { } pub mod bot_command { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `botCommand`\n\n```text\nbotCommand#c27ac8c7 command:string description:string = BotCommand;\n```\n" ] pub struct BotCommand { pub command : :: mtproto :: string , pub description : :: mtproto :: string , } impl :: BareSerialize for BotCommand { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & BotCommand { ref command , ref description } = self ; _ser . write_bare :: < :: mtproto :: string > ( command ) ? ; _ser . write_bare :: < :: mtproto :: string > ( description ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for BotCommand { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( BotCommand { command : _de . read_bare :: < :: mtproto :: string > ( ) ? , description : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for BotCommand { type Boxed = :: mtproto :: BotCommand ; fn into_boxed ( self ) -> :: mtproto :: BotCommand { :: mtproto :: BotCommand :: BotCommand ( self ) } } } pub mod bot_info { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `botInfo`\n\n```text\nbotInfo#98e81d3a user_id:int description:string commands:Vector<BotCommand> = BotInfo;\n```\n" ] pub struct BotInfo { pub user_id : :: mtproto :: int , pub description : :: mtproto :: string , pub commands : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: BotCommand > , } impl :: BareSerialize for BotInfo { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & BotInfo { ref user_id , ref description , ref commands } = self ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; _ser . write_bare :: < :: mtproto :: string > ( description ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: BotCommand > > ( commands ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for BotInfo { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( BotInfo { user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , description : _de . read_bare :: < :: mtproto :: string > ( ) ? , commands : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: BotCommand > > ( ) ? , } ) } } impl :: IntoBoxed for BotInfo { type Boxed = :: mtproto :: BotInfo ; fn into_boxed ( self ) -> :: mtproto :: BotInfo { :: mtproto :: BotInfo :: BotInfo ( self ) } } } pub mod bot_inline { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `botInlineMediaResult`\n\n```text\nbotInlineMediaResult#17db940b flags:# id:string type:string photo:flags.0?Photo document:flags.1?Document title:flags.2?string description:flags.3?string send_message:BotInlineMessage = BotInlineResult;\n```\n" ] pub struct MediaResult { pub id : :: mtproto :: string , pub type_ : :: mtproto :: string , pub photo : Option < :: mtproto :: Photo > , pub document : Option < :: mtproto :: Document > , pub title : Option < :: mtproto :: string > , pub description : Option < :: mtproto :: string > , pub send_message : :: mtproto :: BotInlineMessage , } impl :: BareSerialize for MediaResult { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & MediaResult { ref id , ref type_ , ref photo , ref document , ref title , ref description , ref send_message } = self ; let mut _flags = 0i32 ; if photo . is_some ( ) { _flags |= 1 << 0u32 ; } if document . is_some ( ) { _flags |= 1 << 1u32 ; } if title . is_some ( ) { _flags |= 1 << 2u32 ; } if description . is_some ( ) { _flags |= 1 << 3u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: string > ( id ) ? ; _ser . write_bare :: < :: mtproto :: string > ( type_ ) ? ; if let & Some ( ref inner ) = photo { _ser . write_boxed :: < :: mtproto :: Photo > ( inner ) ? ; } if let & Some ( ref inner ) = document { _ser . write_boxed :: < :: mtproto :: Document > ( inner ) ? ; } if let & Some ( ref inner ) = title { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = description { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } _ser . write_boxed :: < :: mtproto :: BotInlineMessage > ( send_message ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for MediaResult { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( MediaResult { id : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _de . read_bare :: < :: mtproto :: string > ( ) ? } , type_ : _de . read_bare :: < :: mtproto :: string > ( ) ? , photo : if _flags & ( 1 << 0u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: Photo > ( ) ? ) } else { None } , document : if _flags & ( 1 << 1u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: Document > ( ) ? ) } else { None } , title : if _flags & ( 1 << 2u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , description : if _flags & ( 1 << 3u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , send_message : _de . read_boxed :: < :: mtproto :: BotInlineMessage > ( ) ? , } ) } } impl :: IntoBoxed for MediaResult { type Boxed = :: mtproto :: BotInlineResult ; fn into_boxed ( self ) -> :: mtproto :: BotInlineResult { :: mtproto :: BotInlineResult :: MediaResult ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `botInlineResult`\n\n```text\nbotInlineResult#9bebaeb9 flags:# id:string type:string title:flags.1?string description:flags.2?string url:flags.3?string thumb_url:flags.4?string content_url:flags.5?string content_type:flags.5?string w:flags.6?int h:flags.6?int duration:flags.7?int send_message:BotInlineMessage = BotInlineResult;\n```\n" ] pub struct Result { pub id : :: mtproto :: string , pub type_ : :: mtproto :: string , pub title : Option < :: mtproto :: string > , pub description : Option < :: mtproto :: string > , pub url : Option < :: mtproto :: string > , pub thumb_url : Option < :: mtproto :: string > , pub content_url : Option < :: mtproto :: string > , pub content_type : Option < :: mtproto :: string > , pub w : Option < :: mtproto :: int > , pub h : Option < :: mtproto :: int > , pub duration : Option < :: mtproto :: int > , pub send_message : :: mtproto :: BotInlineMessage , } impl :: BareSerialize for Result { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Result { ref id , ref type_ , ref title , ref description , ref url , ref thumb_url , ref content_url , ref content_type , ref w , ref h , ref duration , ref send_message } = self ; let mut _flags = 0i32 ; if title . is_some ( ) { _flags |= 1 << 1u32 ; } if description . is_some ( ) { _flags |= 1 << 2u32 ; } if url . is_some ( ) { _flags |= 1 << 3u32 ; } if thumb_url . is_some ( ) { _flags |= 1 << 4u32 ; } if content_url . is_some ( ) { _flags |= 1 << 5u32 ; } if content_type . is_some ( ) { _flags |= 1 << 5u32 ; } if w . is_some ( ) { _flags |= 1 << 6u32 ; } if h . is_some ( ) { _flags |= 1 << 6u32 ; } if duration . is_some ( ) { _flags |= 1 << 7u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: string > ( id ) ? ; _ser . write_bare :: < :: mtproto :: string > ( type_ ) ? ; if let & Some ( ref inner ) = title { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = description { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = url { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = thumb_url { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = content_url { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = content_type { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = w { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } if let & Some ( ref inner ) = h { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } if let & Some ( ref inner ) = duration { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } _ser . write_boxed :: < :: mtproto :: BotInlineMessage > ( send_message ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Result { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( Result { id : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _de . read_bare :: < :: mtproto :: string > ( ) ? } , type_ : _de . read_bare :: < :: mtproto :: string > ( ) ? , title : if _flags & ( 1 << 1u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , description : if _flags & ( 1 << 2u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , url : if _flags & ( 1 << 3u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , thumb_url : if _flags & ( 1 << 4u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , content_url : if _flags & ( 1 << 5u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , content_type : if _flags & ( 1 << 5u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , w : if _flags & ( 1 << 6u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , h : if _flags & ( 1 << 6u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , duration : if _flags & ( 1 << 7u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , send_message : _de . read_boxed :: < :: mtproto :: BotInlineMessage > ( ) ? , } ) } } impl :: IntoBoxed for Result { type Boxed = :: mtproto :: BotInlineResult ; fn into_boxed ( self ) -> :: mtproto :: BotInlineResult { :: mtproto :: BotInlineResult :: Result ( self ) } } } pub mod bot_inline_message { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `botInlineMessageMediaAuto`\n\n```text\nbotInlineMessageMediaAuto#a74b15b flags:# caption:string reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\n```\n" ] pub struct MediaAuto { pub caption : :: mtproto :: string , pub reply_markup : Option < :: mtproto :: ReplyMarkup > , } impl :: BareSerialize for MediaAuto { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & MediaAuto { ref caption , ref reply_markup } = self ; let mut _flags = 0i32 ; if reply_markup . is_some ( ) { _flags |= 1 << 2u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: string > ( caption ) ? ; if let & Some ( ref inner ) = reply_markup { _ser . write_boxed :: < :: mtproto :: ReplyMarkup > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for MediaAuto { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( MediaAuto { caption : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _de . read_bare :: < :: mtproto :: string > ( ) ? } , reply_markup : if _flags & ( 1 << 2u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: ReplyMarkup > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for MediaAuto { type Boxed = :: mtproto :: BotInlineMessage ; fn into_boxed ( self ) -> :: mtproto :: BotInlineMessage { :: mtproto :: BotInlineMessage :: MediaAuto ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `botInlineMessageMediaContact`\n\n```text\nbotInlineMessageMediaContact#35edb4d4 flags:# phone_number:string first_name:string last_name:string reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\n```\n" ] pub struct MediaContact { pub phone_number : :: mtproto :: string , pub first_name : :: mtproto :: string , pub last_name : :: mtproto :: string , pub reply_markup : Option < :: mtproto :: ReplyMarkup > , } impl :: BareSerialize for MediaContact { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & MediaContact { ref phone_number , ref first_name , ref last_name , ref reply_markup } = self ; let mut _flags = 0i32 ; if reply_markup . is_some ( ) { _flags |= 1 << 2u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: string > ( phone_number ) ? ; _ser . write_bare :: < :: mtproto :: string > ( first_name ) ? ; _ser . write_bare :: < :: mtproto :: string > ( last_name ) ? ; if let & Some ( ref inner ) = reply_markup { _ser . write_boxed :: < :: mtproto :: ReplyMarkup > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for MediaContact { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( MediaContact { phone_number : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _de . read_bare :: < :: mtproto :: string > ( ) ? } , first_name : _de . read_bare :: < :: mtproto :: string > ( ) ? , last_name : _de . read_bare :: < :: mtproto :: string > ( ) ? , reply_markup : if _flags & ( 1 << 2u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: ReplyMarkup > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for MediaContact { type Boxed = :: mtproto :: BotInlineMessage ; fn into_boxed ( self ) -> :: mtproto :: BotInlineMessage { :: mtproto :: BotInlineMessage :: MediaContact ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `botInlineMessageMediaGeo`\n\n```text\nbotInlineMessageMediaGeo#b722de65 flags:# geo:GeoPoint period:int reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\n```\n" ] pub struct MediaGeo { pub geo : :: mtproto :: GeoPoint , pub period : :: mtproto :: int , pub reply_markup : Option < :: mtproto :: ReplyMarkup > , } impl :: BareSerialize for MediaGeo { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & MediaGeo { ref geo , ref period , ref reply_markup } = self ; let mut _flags = 0i32 ; if reply_markup . is_some ( ) { _flags |= 1 << 2u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_boxed :: < :: mtproto :: GeoPoint > ( geo ) ? ; _ser . write_bare :: < :: mtproto :: int > ( period ) ? ; if let & Some ( ref inner ) = reply_markup { _ser . write_boxed :: < :: mtproto :: ReplyMarkup > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for MediaGeo { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( MediaGeo { geo : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _de . read_boxed :: < :: mtproto :: GeoPoint > ( ) ? } , period : _de . read_bare :: < :: mtproto :: int > ( ) ? , reply_markup : if _flags & ( 1 << 2u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: ReplyMarkup > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for MediaGeo { type Boxed = :: mtproto :: BotInlineMessage ; fn into_boxed ( self ) -> :: mtproto :: BotInlineMessage { :: mtproto :: BotInlineMessage :: MediaGeo ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `botInlineMessageMediaVenue`\n\n```text\nbotInlineMessageMediaVenue#4366232e flags:# geo:GeoPoint title:string address:string provider:string venue_id:string reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\n```\n" ] pub struct MediaVenue { pub geo : :: mtproto :: GeoPoint , pub title : :: mtproto :: string , pub address : :: mtproto :: string , pub provider : :: mtproto :: string , pub venue_id : :: mtproto :: string , pub reply_markup : Option < :: mtproto :: ReplyMarkup > , } impl :: BareSerialize for MediaVenue { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & MediaVenue { ref geo , ref title , ref address , ref provider , ref venue_id , ref reply_markup } = self ; let mut _flags = 0i32 ; if reply_markup . is_some ( ) { _flags |= 1 << 2u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_boxed :: < :: mtproto :: GeoPoint > ( geo ) ? ; _ser . write_bare :: < :: mtproto :: string > ( title ) ? ; _ser . write_bare :: < :: mtproto :: string > ( address ) ? ; _ser . write_bare :: < :: mtproto :: string > ( provider ) ? ; _ser . write_bare :: < :: mtproto :: string > ( venue_id ) ? ; if let & Some ( ref inner ) = reply_markup { _ser . write_boxed :: < :: mtproto :: ReplyMarkup > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for MediaVenue { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( MediaVenue { geo : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _de . read_boxed :: < :: mtproto :: GeoPoint > ( ) ? } , title : _de . read_bare :: < :: mtproto :: string > ( ) ? , address : _de . read_bare :: < :: mtproto :: string > ( ) ? , provider : _de . read_bare :: < :: mtproto :: string > ( ) ? , venue_id : _de . read_bare :: < :: mtproto :: string > ( ) ? , reply_markup : if _flags & ( 1 << 2u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: ReplyMarkup > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for MediaVenue { type Boxed = :: mtproto :: BotInlineMessage ; fn into_boxed ( self ) -> :: mtproto :: BotInlineMessage { :: mtproto :: BotInlineMessage :: MediaVenue ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `botInlineMessageText`\n\n```text\nbotInlineMessageText#8c7f65e2 flags:# no_webpage:flags.0?true message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\n```\n" ] pub struct Text { pub no_webpage : bool , pub message : :: mtproto :: string , pub entities : Option < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: MessageEntity > > , pub reply_markup : Option < :: mtproto :: ReplyMarkup > , } impl :: BareSerialize for Text { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Text { no_webpage , ref message , ref entities , ref reply_markup } = self ; let mut _flags = 0i32 ; if no_webpage { _flags |= 1 << 0u32 ; } if entities . is_some ( ) { _flags |= 1 << 1u32 ; } if reply_markup . is_some ( ) { _flags |= 1 << 2u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: string > ( message ) ? ; if let & Some ( ref inner ) = entities { _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: MessageEntity > > ( inner ) ? ; } if let & Some ( ref inner ) = reply_markup { _ser . write_boxed :: < :: mtproto :: ReplyMarkup > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for Text { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( Text { no_webpage : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 0u32 ) != 0 } , message : _de . read_bare :: < :: mtproto :: string > ( ) ? , entities : if _flags & ( 1 << 1u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: MessageEntity > > ( ) ? ) } else { None } , reply_markup : if _flags & ( 1 << 2u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: ReplyMarkup > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for Text { type Boxed = :: mtproto :: BotInlineMessage ; fn into_boxed ( self ) -> :: mtproto :: BotInlineMessage { :: mtproto :: BotInlineMessage :: Text ( self ) } } } pub mod cdn_config { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `cdnConfig`\n\n```text\ncdnConfig#5725e40a public_keys:Vector<CdnPublicKey> = CdnConfig;\n```\n" ] pub struct CdnConfig { pub public_keys : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: CdnPublicKey > , } impl :: BareSerialize for CdnConfig { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & CdnConfig { ref public_keys } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: CdnPublicKey > > ( public_keys ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for CdnConfig { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( CdnConfig { public_keys : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: CdnPublicKey > > ( ) ? , } ) } } impl :: IntoBoxed for CdnConfig { type Boxed = :: mtproto :: CdnConfig ; fn into_boxed ( self ) -> :: mtproto :: CdnConfig { :: mtproto :: CdnConfig :: CdnConfig ( self ) } } } pub mod cdn_file_hash { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `cdnFileHash`\n\n```text\ncdnFileHash#77eec38f offset:int limit:int hash:bytes = CdnFileHash;\n```\n" ] pub struct CdnFileHash { pub offset : :: mtproto :: int , pub limit : :: mtproto :: int , pub hash : :: mtproto :: bytes , } impl :: BareSerialize for CdnFileHash { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & CdnFileHash { ref offset , ref limit , ref hash } = self ; _ser . write_bare :: < :: mtproto :: int > ( offset ) ? ; _ser . write_bare :: < :: mtproto :: int > ( limit ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( hash ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for CdnFileHash { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( CdnFileHash { offset : _de . read_bare :: < :: mtproto :: int > ( ) ? , limit : _de . read_bare :: < :: mtproto :: int > ( ) ? , hash : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , } ) } } impl :: IntoBoxed for CdnFileHash { type Boxed = :: mtproto :: CdnFileHash ; fn into_boxed ( self ) -> :: mtproto :: CdnFileHash { :: mtproto :: CdnFileHash :: CdnFileHash ( self ) } } } pub mod cdn_public_key { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `cdnPublicKey`\n\n```text\ncdnPublicKey#c982eaba dc_id:int public_key:string = CdnPublicKey;\n```\n" ] pub struct CdnPublicKey { pub dc_id : :: mtproto :: int , pub public_key : :: mtproto :: string , } impl :: BareSerialize for CdnPublicKey { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & CdnPublicKey { ref dc_id , ref public_key } = self ; _ser . write_bare :: < :: mtproto :: int > ( dc_id ) ? ; _ser . write_bare :: < :: mtproto :: string > ( public_key ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for CdnPublicKey { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( CdnPublicKey { dc_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , public_key : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for CdnPublicKey { type Boxed = :: mtproto :: CdnPublicKey ; fn into_boxed ( self ) -> :: mtproto :: CdnPublicKey { :: mtproto :: CdnPublicKey :: CdnPublicKey ( self ) } } } pub mod channel_admin_log_event { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channelAdminLogEvent`\n\n```text\nchannelAdminLogEvent#3b5a3e40 id:long date:int user_id:int action:ChannelAdminLogEventAction = ChannelAdminLogEvent;\n```\n" ] pub struct ChannelAdminLogEvent { pub id : :: mtproto :: long , pub date : :: mtproto :: int , pub user_id : :: mtproto :: int , pub action : :: mtproto :: ChannelAdminLogEventAction , } impl :: BareSerialize for ChannelAdminLogEvent { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChannelAdminLogEvent { ref id , ref date , ref user_id , ref action } = self ; _ser . write_bare :: < :: mtproto :: long > ( id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; _ser . write_boxed :: < :: mtproto :: ChannelAdminLogEventAction > ( action ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ChannelAdminLogEvent { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ChannelAdminLogEvent { id : _de . read_bare :: < :: mtproto :: long > ( ) ? , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , action : _de . read_boxed :: < :: mtproto :: ChannelAdminLogEventAction > ( ) ? , } ) } } impl :: IntoBoxed for ChannelAdminLogEvent { type Boxed = :: mtproto :: ChannelAdminLogEvent ; fn into_boxed ( self ) -> :: mtproto :: ChannelAdminLogEvent { :: mtproto :: ChannelAdminLogEvent :: ChannelAdminLogEvent ( self ) } } } pub mod channel_admin_log_event_action { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channelAdminLogEventActionChangeAbout`\n\n```text\nchannelAdminLogEventActionChangeAbout#55188a2e prev_value:string new_value:string = ChannelAdminLogEventAction;\n```\n" ] pub struct ChangeAbout { pub prev_value : :: mtproto :: string , pub new_value : :: mtproto :: string , } impl :: BareSerialize for ChangeAbout { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChangeAbout { ref prev_value , ref new_value } = self ; _ser . write_bare :: < :: mtproto :: string > ( prev_value ) ? ; _ser . write_bare :: < :: mtproto :: string > ( new_value ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ChangeAbout { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ChangeAbout { prev_value : _de . read_bare :: < :: mtproto :: string > ( ) ? , new_value : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for ChangeAbout { type Boxed = :: mtproto :: ChannelAdminLogEventAction ; fn into_boxed ( self ) -> :: mtproto :: ChannelAdminLogEventAction { :: mtproto :: ChannelAdminLogEventAction :: ChangeAbout ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channelAdminLogEventActionChangePhoto`\n\n```text\nchannelAdminLogEventActionChangePhoto#b82f55c3 prev_photo:ChatPhoto new_photo:ChatPhoto = ChannelAdminLogEventAction;\n```\n" ] pub struct ChangePhoto { pub prev_photo : :: mtproto :: ChatPhoto , pub new_photo : :: mtproto :: ChatPhoto , } impl :: BareSerialize for ChangePhoto { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChangePhoto { ref prev_photo , ref new_photo } = self ; _ser . write_boxed :: < :: mtproto :: ChatPhoto > ( prev_photo ) ? ; _ser . write_boxed :: < :: mtproto :: ChatPhoto > ( new_photo ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ChangePhoto { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ChangePhoto { prev_photo : _de . read_boxed :: < :: mtproto :: ChatPhoto > ( ) ? , new_photo : _de . read_boxed :: < :: mtproto :: ChatPhoto > ( ) ? , } ) } } impl :: IntoBoxed for ChangePhoto { type Boxed = :: mtproto :: ChannelAdminLogEventAction ; fn into_boxed ( self ) -> :: mtproto :: ChannelAdminLogEventAction { :: mtproto :: ChannelAdminLogEventAction :: ChangePhoto ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channelAdminLogEventActionChangeStickerSet`\n\n```text\nchannelAdminLogEventActionChangeStickerSet#b1c3caa7 prev_stickerset:InputStickerSet new_stickerset:InputStickerSet = ChannelAdminLogEventAction;\n```\n" ] pub struct ChangeStickerSet { pub prev_stickerset : :: mtproto :: InputStickerSet , pub new_stickerset : :: mtproto :: InputStickerSet , } impl :: BareSerialize for ChangeStickerSet { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChangeStickerSet { ref prev_stickerset , ref new_stickerset } = self ; _ser . write_boxed :: < :: mtproto :: InputStickerSet > ( prev_stickerset ) ? ; _ser . write_boxed :: < :: mtproto :: InputStickerSet > ( new_stickerset ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ChangeStickerSet { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ChangeStickerSet { prev_stickerset : _de . read_boxed :: < :: mtproto :: InputStickerSet > ( ) ? , new_stickerset : _de . read_boxed :: < :: mtproto :: InputStickerSet > ( ) ? , } ) } } impl :: IntoBoxed for ChangeStickerSet { type Boxed = :: mtproto :: ChannelAdminLogEventAction ; fn into_boxed ( self ) -> :: mtproto :: ChannelAdminLogEventAction { :: mtproto :: ChannelAdminLogEventAction :: ChangeStickerSet ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channelAdminLogEventActionChangeTitle`\n\n```text\nchannelAdminLogEventActionChangeTitle#e6dfb825 prev_value:string new_value:string = ChannelAdminLogEventAction;\n```\n" ] pub struct ChangeTitle { pub prev_value : :: mtproto :: string , pub new_value : :: mtproto :: string , } impl :: BareSerialize for ChangeTitle { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChangeTitle { ref prev_value , ref new_value } = self ; _ser . write_bare :: < :: mtproto :: string > ( prev_value ) ? ; _ser . write_bare :: < :: mtproto :: string > ( new_value ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ChangeTitle { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ChangeTitle { prev_value : _de . read_bare :: < :: mtproto :: string > ( ) ? , new_value : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for ChangeTitle { type Boxed = :: mtproto :: ChannelAdminLogEventAction ; fn into_boxed ( self ) -> :: mtproto :: ChannelAdminLogEventAction { :: mtproto :: ChannelAdminLogEventAction :: ChangeTitle ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channelAdminLogEventActionChangeUsername`\n\n```text\nchannelAdminLogEventActionChangeUsername#6a4afc38 prev_value:string new_value:string = ChannelAdminLogEventAction;\n```\n" ] pub struct ChangeUsername { pub prev_value : :: mtproto :: string , pub new_value : :: mtproto :: string , } impl :: BareSerialize for ChangeUsername { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChangeUsername { ref prev_value , ref new_value } = self ; _ser . write_bare :: < :: mtproto :: string > ( prev_value ) ? ; _ser . write_bare :: < :: mtproto :: string > ( new_value ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ChangeUsername { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ChangeUsername { prev_value : _de . read_bare :: < :: mtproto :: string > ( ) ? , new_value : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for ChangeUsername { type Boxed = :: mtproto :: ChannelAdminLogEventAction ; fn into_boxed ( self ) -> :: mtproto :: ChannelAdminLogEventAction { :: mtproto :: ChannelAdminLogEventAction :: ChangeUsername ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channelAdminLogEventActionDeleteMessage`\n\n```text\nchannelAdminLogEventActionDeleteMessage#42e047bb message:Message = ChannelAdminLogEventAction;\n```\n" ] pub struct DeleteMessage { pub message : :: mtproto :: Message , } impl :: BareSerialize for DeleteMessage { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & DeleteMessage { ref message } = self ; _ser . write_boxed :: < :: mtproto :: Message > ( message ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for DeleteMessage { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( DeleteMessage { message : _de . read_boxed :: < :: mtproto :: Message > ( ) ? , } ) } } impl :: IntoBoxed for DeleteMessage { type Boxed = :: mtproto :: ChannelAdminLogEventAction ; fn into_boxed ( self ) -> :: mtproto :: ChannelAdminLogEventAction { :: mtproto :: ChannelAdminLogEventAction :: DeleteMessage ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channelAdminLogEventActionEditMessage`\n\n```text\nchannelAdminLogEventActionEditMessage#709b2405 prev_message:Message new_message:Message = ChannelAdminLogEventAction;\n```\n" ] pub struct EditMessage { pub prev_message : :: mtproto :: Message , pub new_message : :: mtproto :: Message , } impl :: BareSerialize for EditMessage { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & EditMessage { ref prev_message , ref new_message } = self ; _ser . write_boxed :: < :: mtproto :: Message > ( prev_message ) ? ; _ser . write_boxed :: < :: mtproto :: Message > ( new_message ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for EditMessage { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( EditMessage { prev_message : _de . read_boxed :: < :: mtproto :: Message > ( ) ? , new_message : _de . read_boxed :: < :: mtproto :: Message > ( ) ? , } ) } } impl :: IntoBoxed for EditMessage { type Boxed = :: mtproto :: ChannelAdminLogEventAction ; fn into_boxed ( self ) -> :: mtproto :: ChannelAdminLogEventAction { :: mtproto :: ChannelAdminLogEventAction :: EditMessage ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channelAdminLogEventActionParticipantInvite`\n\n```text\nchannelAdminLogEventActionParticipantInvite#e31c34d8 participant:ChannelParticipant = ChannelAdminLogEventAction;\n```\n" ] pub struct ParticipantInvite { pub participant : :: mtproto :: ChannelParticipant , } impl :: BareSerialize for ParticipantInvite { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ParticipantInvite { ref participant } = self ; _ser . write_boxed :: < :: mtproto :: ChannelParticipant > ( participant ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ParticipantInvite { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ParticipantInvite { participant : _de . read_boxed :: < :: mtproto :: ChannelParticipant > ( ) ? , } ) } } impl :: IntoBoxed for ParticipantInvite { type Boxed = :: mtproto :: ChannelAdminLogEventAction ; fn into_boxed ( self ) -> :: mtproto :: ChannelAdminLogEventAction { :: mtproto :: ChannelAdminLogEventAction :: ParticipantInvite ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channelAdminLogEventActionParticipantToggleAdmin`\n\n```text\nchannelAdminLogEventActionParticipantToggleAdmin#d5676710 prev_participant:ChannelParticipant new_participant:ChannelParticipant = ChannelAdminLogEventAction;\n```\n" ] pub struct ParticipantToggleAdmin { pub prev_participant : :: mtproto :: ChannelParticipant , pub new_participant : :: mtproto :: ChannelParticipant , } impl :: BareSerialize for ParticipantToggleAdmin { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ParticipantToggleAdmin { ref prev_participant , ref new_participant } = self ; _ser . write_boxed :: < :: mtproto :: ChannelParticipant > ( prev_participant ) ? ; _ser . write_boxed :: < :: mtproto :: ChannelParticipant > ( new_participant ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ParticipantToggleAdmin { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ParticipantToggleAdmin { prev_participant : _de . read_boxed :: < :: mtproto :: ChannelParticipant > ( ) ? , new_participant : _de . read_boxed :: < :: mtproto :: ChannelParticipant > ( ) ? , } ) } } impl :: IntoBoxed for ParticipantToggleAdmin { type Boxed = :: mtproto :: ChannelAdminLogEventAction ; fn into_boxed ( self ) -> :: mtproto :: ChannelAdminLogEventAction { :: mtproto :: ChannelAdminLogEventAction :: ParticipantToggleAdmin ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channelAdminLogEventActionParticipantToggleBan`\n\n```text\nchannelAdminLogEventActionParticipantToggleBan#e6d83d7e prev_participant:ChannelParticipant new_participant:ChannelParticipant = ChannelAdminLogEventAction;\n```\n" ] pub struct ParticipantToggleBan { pub prev_participant : :: mtproto :: ChannelParticipant , pub new_participant : :: mtproto :: ChannelParticipant , } impl :: BareSerialize for ParticipantToggleBan { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ParticipantToggleBan { ref prev_participant , ref new_participant } = self ; _ser . write_boxed :: < :: mtproto :: ChannelParticipant > ( prev_participant ) ? ; _ser . write_boxed :: < :: mtproto :: ChannelParticipant > ( new_participant ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ParticipantToggleBan { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ParticipantToggleBan { prev_participant : _de . read_boxed :: < :: mtproto :: ChannelParticipant > ( ) ? , new_participant : _de . read_boxed :: < :: mtproto :: ChannelParticipant > ( ) ? , } ) } } impl :: IntoBoxed for ParticipantToggleBan { type Boxed = :: mtproto :: ChannelAdminLogEventAction ; fn into_boxed ( self ) -> :: mtproto :: ChannelAdminLogEventAction { :: mtproto :: ChannelAdminLogEventAction :: ParticipantToggleBan ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channelAdminLogEventActionToggleInvites`\n\n```text\nchannelAdminLogEventActionToggleInvites#1b7907ae new_value:Bool = ChannelAdminLogEventAction;\n```\n" ] pub struct ToggleInvites { pub new_value : :: mtproto :: Bool , } impl :: BareSerialize for ToggleInvites { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ToggleInvites { ref new_value } = self ; _ser . write_boxed :: < :: mtproto :: Bool > ( new_value ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ToggleInvites { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ToggleInvites { new_value : _de . read_boxed :: < :: mtproto :: Bool > ( ) ? , } ) } } impl :: IntoBoxed for ToggleInvites { type Boxed = :: mtproto :: ChannelAdminLogEventAction ; fn into_boxed ( self ) -> :: mtproto :: ChannelAdminLogEventAction { :: mtproto :: ChannelAdminLogEventAction :: ToggleInvites ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channelAdminLogEventActionTogglePreHistoryHidden`\n\n```text\nchannelAdminLogEventActionTogglePreHistoryHidden#5f5c95f1 new_value:Bool = ChannelAdminLogEventAction;\n```\n" ] pub struct TogglePreHistoryHidden { pub new_value : :: mtproto :: Bool , } impl :: BareSerialize for TogglePreHistoryHidden { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & TogglePreHistoryHidden { ref new_value } = self ; _ser . write_boxed :: < :: mtproto :: Bool > ( new_value ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for TogglePreHistoryHidden { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( TogglePreHistoryHidden { new_value : _de . read_boxed :: < :: mtproto :: Bool > ( ) ? , } ) } } impl :: IntoBoxed for TogglePreHistoryHidden { type Boxed = :: mtproto :: ChannelAdminLogEventAction ; fn into_boxed ( self ) -> :: mtproto :: ChannelAdminLogEventAction { :: mtproto :: ChannelAdminLogEventAction :: TogglePreHistoryHidden ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channelAdminLogEventActionToggleSignatures`\n\n```text\nchannelAdminLogEventActionToggleSignatures#26ae0971 new_value:Bool = ChannelAdminLogEventAction;\n```\n" ] pub struct ToggleSignatures { pub new_value : :: mtproto :: Bool , } impl :: BareSerialize for ToggleSignatures { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ToggleSignatures { ref new_value } = self ; _ser . write_boxed :: < :: mtproto :: Bool > ( new_value ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ToggleSignatures { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ToggleSignatures { new_value : _de . read_boxed :: < :: mtproto :: Bool > ( ) ? , } ) } } impl :: IntoBoxed for ToggleSignatures { type Boxed = :: mtproto :: ChannelAdminLogEventAction ; fn into_boxed ( self ) -> :: mtproto :: ChannelAdminLogEventAction { :: mtproto :: ChannelAdminLogEventAction :: ToggleSignatures ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channelAdminLogEventActionUpdatePinned`\n\n```text\nchannelAdminLogEventActionUpdatePinned#e9e82c18 message:Message = ChannelAdminLogEventAction;\n```\n" ] pub struct UpdatePinned { pub message : :: mtproto :: Message , } impl :: BareSerialize for UpdatePinned { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & UpdatePinned { ref message } = self ; _ser . write_boxed :: < :: mtproto :: Message > ( message ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for UpdatePinned { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( UpdatePinned { message : _de . read_boxed :: < :: mtproto :: Message > ( ) ? , } ) } } impl :: IntoBoxed for UpdatePinned { type Boxed = :: mtproto :: ChannelAdminLogEventAction ; fn into_boxed ( self ) -> :: mtproto :: ChannelAdminLogEventAction { :: mtproto :: ChannelAdminLogEventAction :: UpdatePinned ( self ) } } } pub mod channel_admin_log_events_filter { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channelAdminLogEventsFilter`\n\n```text\nchannelAdminLogEventsFilter#ea107ae4 flags:# join:flags.0?true leave:flags.1?true invite:flags.2?true ban:flags.3?true unban:flags.4?true kick:flags.5?true unkick:flags.6?true promote:flags.7?true demote:flags.8?true info:flags.9?true settings:flags.10?true pinned:flags.11?true edit:flags.12?true delete:flags.13?true = ChannelAdminLogEventsFilter;\n```\n" ] pub struct ChannelAdminLogEventsFilter { pub join : bool , pub leave : bool , pub invite : bool , pub ban : bool , pub unban : bool , pub kick : bool , pub unkick : bool , pub promote : bool , pub demote : bool , pub info : bool , pub settings : bool , pub pinned : bool , pub edit : bool , pub delete : bool , } impl :: BareSerialize for ChannelAdminLogEventsFilter { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChannelAdminLogEventsFilter { join , leave , invite , ban , unban , kick , unkick , promote , demote , info , settings , pinned , edit , delete } = self ; let mut _flags = 0i32 ; if join { _flags |= 1 << 0u32 ; } if leave { _flags |= 1 << 1u32 ; } if invite { _flags |= 1 << 2u32 ; } if ban { _flags |= 1 << 3u32 ; } if unban { _flags |= 1 << 4u32 ; } if kick { _flags |= 1 << 5u32 ; } if unkick { _flags |= 1 << 6u32 ; } if promote { _flags |= 1 << 7u32 ; } if demote { _flags |= 1 << 8u32 ; } if info { _flags |= 1 << 9u32 ; } if settings { _flags |= 1 << 10u32 ; } if pinned { _flags |= 1 << 11u32 ; } if edit { _flags |= 1 << 12u32 ; } if delete { _flags |= 1 << 13u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ChannelAdminLogEventsFilter { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( ChannelAdminLogEventsFilter { join : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 0u32 ) != 0 } , leave : _flags & ( 1 << 1u32 ) != 0 , invite : _flags & ( 1 << 2u32 ) != 0 , ban : _flags & ( 1 << 3u32 ) != 0 , unban : _flags & ( 1 << 4u32 ) != 0 , kick : _flags & ( 1 << 5u32 ) != 0 , unkick : _flags & ( 1 << 6u32 ) != 0 , promote : _flags & ( 1 << 7u32 ) != 0 , demote : _flags & ( 1 << 8u32 ) != 0 , info : _flags & ( 1 << 9u32 ) != 0 , settings : _flags & ( 1 << 10u32 ) != 0 , pinned : _flags & ( 1 << 11u32 ) != 0 , edit : _flags & ( 1 << 12u32 ) != 0 , delete : _flags & ( 1 << 13u32 ) != 0 , } ) } } impl :: IntoBoxed for ChannelAdminLogEventsFilter { type Boxed = :: mtproto :: ChannelAdminLogEventsFilter ; fn into_boxed ( self ) -> :: mtproto :: ChannelAdminLogEventsFilter { :: mtproto :: ChannelAdminLogEventsFilter :: ChannelAdminLogEventsFilter ( self ) } } } pub mod channel_admin_rights { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channelAdminRights`\n\n```text\nchannelAdminRights#5d7ceba5 flags:# change_info:flags.0?true post_messages:flags.1?true edit_messages:flags.2?true delete_messages:flags.3?true ban_users:flags.4?true invite_users:flags.5?true invite_link:flags.6?true pin_messages:flags.7?true add_admins:flags.9?true = ChannelAdminRights;\n```\n" ] pub struct ChannelAdminRights { pub change_info : bool , pub post_messages : bool , pub edit_messages : bool , pub delete_messages : bool , pub ban_users : bool , pub invite_users : bool , pub invite_link : bool , pub pin_messages : bool , pub add_admins : bool , } impl :: BareSerialize for ChannelAdminRights { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChannelAdminRights { change_info , post_messages , edit_messages , delete_messages , ban_users , invite_users , invite_link , pin_messages , add_admins } = self ; let mut _flags = 0i32 ; if change_info { _flags |= 1 << 0u32 ; } if post_messages { _flags |= 1 << 1u32 ; } if edit_messages { _flags |= 1 << 2u32 ; } if delete_messages { _flags |= 1 << 3u32 ; } if ban_users { _flags |= 1 << 4u32 ; } if invite_users { _flags |= 1 << 5u32 ; } if invite_link { _flags |= 1 << 6u32 ; } if pin_messages { _flags |= 1 << 7u32 ; } if add_admins { _flags |= 1 << 9u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ChannelAdminRights { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( ChannelAdminRights { change_info : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 0u32 ) != 0 } , post_messages : _flags & ( 1 << 1u32 ) != 0 , edit_messages : _flags & ( 1 << 2u32 ) != 0 , delete_messages : _flags & ( 1 << 3u32 ) != 0 , ban_users : _flags & ( 1 << 4u32 ) != 0 , invite_users : _flags & ( 1 << 5u32 ) != 0 , invite_link : _flags & ( 1 << 6u32 ) != 0 , pin_messages : _flags & ( 1 << 7u32 ) != 0 , add_admins : _flags & ( 1 << 9u32 ) != 0 , } ) } } impl :: IntoBoxed for ChannelAdminRights { type Boxed = :: mtproto :: ChannelAdminRights ; fn into_boxed ( self ) -> :: mtproto :: ChannelAdminRights { :: mtproto :: ChannelAdminRights :: ChannelAdminRights ( self ) } } } pub mod channel_banned_rights { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channelBannedRights`\n\n```text\nchannelBannedRights#58cf4249 flags:# view_messages:flags.0?true send_messages:flags.1?true send_media:flags.2?true send_stickers:flags.3?true send_gifs:flags.4?true send_games:flags.5?true send_inline:flags.6?true embed_links:flags.7?true until_date:int = ChannelBannedRights;\n```\n" ] pub struct ChannelBannedRights { pub view_messages : bool , pub send_messages : bool , pub send_media : bool , pub send_stickers : bool , pub send_gifs : bool , pub send_games : bool , pub send_inline : bool , pub embed_links : bool , pub until_date : :: mtproto :: int , } impl :: BareSerialize for ChannelBannedRights { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChannelBannedRights { view_messages , send_messages , send_media , send_stickers , send_gifs , send_games , send_inline , embed_links , ref until_date } = self ; let mut _flags = 0i32 ; if view_messages { _flags |= 1 << 0u32 ; } if send_messages { _flags |= 1 << 1u32 ; } if send_media { _flags |= 1 << 2u32 ; } if send_stickers { _flags |= 1 << 3u32 ; } if send_gifs { _flags |= 1 << 4u32 ; } if send_games { _flags |= 1 << 5u32 ; } if send_inline { _flags |= 1 << 6u32 ; } if embed_links { _flags |= 1 << 7u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: int > ( until_date ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ChannelBannedRights { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( ChannelBannedRights { view_messages : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 0u32 ) != 0 } , send_messages : _flags & ( 1 << 1u32 ) != 0 , send_media : _flags & ( 1 << 2u32 ) != 0 , send_stickers : _flags & ( 1 << 3u32 ) != 0 , send_gifs : _flags & ( 1 << 4u32 ) != 0 , send_games : _flags & ( 1 << 5u32 ) != 0 , send_inline : _flags & ( 1 << 6u32 ) != 0 , embed_links : _flags & ( 1 << 7u32 ) != 0 , until_date : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for ChannelBannedRights { type Boxed = :: mtproto :: ChannelBannedRights ; fn into_boxed ( self ) -> :: mtproto :: ChannelBannedRights { :: mtproto :: ChannelBannedRights :: ChannelBannedRights ( self ) } } } pub mod channel_messages_filter { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channelMessagesFilter`\n\n```text\nchannelMessagesFilter#cd77d957 flags:# exclude_new_messages:flags.1?true ranges:Vector<MessageRange> = ChannelMessagesFilter;\n```\n" ] pub struct ChannelMessagesFilter { pub exclude_new_messages : bool , pub ranges : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: MessageRange > , } impl :: BareSerialize for ChannelMessagesFilter { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChannelMessagesFilter { exclude_new_messages , ref ranges } = self ; let mut _flags = 0i32 ; if exclude_new_messages { _flags |= 1 << 1u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: MessageRange > > ( ranges ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ChannelMessagesFilter { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( ChannelMessagesFilter { exclude_new_messages : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 1u32 ) != 0 } , ranges : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: MessageRange > > ( ) ? , } ) } } impl :: IntoBoxed for ChannelMessagesFilter { type Boxed = :: mtproto :: ChannelMessagesFilter ; fn into_boxed ( self ) -> :: mtproto :: ChannelMessagesFilter { :: mtproto :: ChannelMessagesFilter :: ChannelMessagesFilter ( self ) } } } pub mod channel_participant { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channelParticipantAdmin`\n\n```text\nchannelParticipantAdmin#a82fa898 flags:# can_edit:flags.0?true user_id:int inviter_id:int promoted_by:int date:int admin_rights:ChannelAdminRights = ChannelParticipant;\n```\n" ] pub struct Admin { pub can_edit : bool , pub user_id : :: mtproto :: int , pub inviter_id : :: mtproto :: int , pub promoted_by : :: mtproto :: int , pub date : :: mtproto :: int , pub admin_rights : :: mtproto :: ChannelAdminRights , } impl :: BareSerialize for Admin { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Admin { can_edit , ref user_id , ref inviter_id , ref promoted_by , ref date , ref admin_rights } = self ; let mut _flags = 0i32 ; if can_edit { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( inviter_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( promoted_by ) ? ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; _ser . write_boxed :: < :: mtproto :: ChannelAdminRights > ( admin_rights ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Admin { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( Admin { can_edit : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 0u32 ) != 0 } , user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , inviter_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , promoted_by : _de . read_bare :: < :: mtproto :: int > ( ) ? , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , admin_rights : _de . read_boxed :: < :: mtproto :: ChannelAdminRights > ( ) ? , } ) } } impl :: IntoBoxed for Admin { type Boxed = :: mtproto :: ChannelParticipant ; fn into_boxed ( self ) -> :: mtproto :: ChannelParticipant { :: mtproto :: ChannelParticipant :: Admin ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channelParticipantBanned`\n\n```text\nchannelParticipantBanned#222c1886 flags:# left:flags.0?true user_id:int kicked_by:int date:int banned_rights:ChannelBannedRights = ChannelParticipant;\n```\n" ] pub struct Banned { pub left : bool , pub user_id : :: mtproto :: int , pub kicked_by : :: mtproto :: int , pub date : :: mtproto :: int , pub banned_rights : :: mtproto :: ChannelBannedRights , } impl :: BareSerialize for Banned { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Banned { left , ref user_id , ref kicked_by , ref date , ref banned_rights } = self ; let mut _flags = 0i32 ; if left { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( kicked_by ) ? ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; _ser . write_boxed :: < :: mtproto :: ChannelBannedRights > ( banned_rights ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Banned { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( Banned { left : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 0u32 ) != 0 } , user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , kicked_by : _de . read_bare :: < :: mtproto :: int > ( ) ? , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , banned_rights : _de . read_boxed :: < :: mtproto :: ChannelBannedRights > ( ) ? , } ) } } impl :: IntoBoxed for Banned { type Boxed = :: mtproto :: ChannelParticipant ; fn into_boxed ( self ) -> :: mtproto :: ChannelParticipant { :: mtproto :: ChannelParticipant :: Banned ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channelParticipant`\n\n```text\nchannelParticipant#15ebac1d user_id:int date:int = ChannelParticipant;\n```\n" ] pub struct ChannelParticipant { pub user_id : :: mtproto :: int , pub date : :: mtproto :: int , } impl :: BareSerialize for ChannelParticipant { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChannelParticipant { ref user_id , ref date } = self ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ChannelParticipant { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ChannelParticipant { user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for ChannelParticipant { type Boxed = :: mtproto :: ChannelParticipant ; fn into_boxed ( self ) -> :: mtproto :: ChannelParticipant { :: mtproto :: ChannelParticipant :: ChannelParticipant ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channelParticipantCreator`\n\n```text\nchannelParticipantCreator#e3e2e1f9 user_id:int = ChannelParticipant;\n```\n" ] pub struct Creator { pub user_id : :: mtproto :: int , } impl :: BareSerialize for Creator { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Creator { ref user_id } = self ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Creator { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Creator { user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for Creator { type Boxed = :: mtproto :: ChannelParticipant ; fn into_boxed ( self ) -> :: mtproto :: ChannelParticipant { :: mtproto :: ChannelParticipant :: Creator ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channelParticipantSelf`\n\n```text\nchannelParticipantSelf#a3289a6d user_id:int inviter_id:int date:int = ChannelParticipant;\n```\n" ] pub struct Self_ { pub user_id : :: mtproto :: int , pub inviter_id : :: mtproto :: int , pub date : :: mtproto :: int , } impl :: BareSerialize for Self_ { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Self_ { ref user_id , ref inviter_id , ref date } = self ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( inviter_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Self_ { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Self_ { user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , inviter_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for Self_ { type Boxed = :: mtproto :: ChannelParticipant ; fn into_boxed ( self ) -> :: mtproto :: ChannelParticipant { :: mtproto :: ChannelParticipant :: Self_ ( self ) } } } pub mod channel_participants { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channelParticipantsBanned`\n\n```text\nchannelParticipantsBanned#1427a5e1 q:string = ChannelParticipantsFilter;\n```\n" ] pub struct Banned { pub q : :: mtproto :: string , } impl :: BareSerialize for Banned { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Banned { ref q } = self ; _ser . write_bare :: < :: mtproto :: string > ( q ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Banned { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Banned { q : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for Banned { type Boxed = :: mtproto :: ChannelParticipantsFilter ; fn into_boxed ( self ) -> :: mtproto :: ChannelParticipantsFilter { :: mtproto :: ChannelParticipantsFilter :: Banned ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channelParticipantsKicked`\n\n```text\nchannelParticipantsKicked#a3b54985 q:string = ChannelParticipantsFilter;\n```\n" ] pub struct Kicked { pub q : :: mtproto :: string , } impl :: BareSerialize for Kicked { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Kicked { ref q } = self ; _ser . write_bare :: < :: mtproto :: string > ( q ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Kicked { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Kicked { q : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for Kicked { type Boxed = :: mtproto :: ChannelParticipantsFilter ; fn into_boxed ( self ) -> :: mtproto :: ChannelParticipantsFilter { :: mtproto :: ChannelParticipantsFilter :: Kicked ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channelParticipantsSearch`\n\n```text\nchannelParticipantsSearch#656ac4b q:string = ChannelParticipantsFilter;\n```\n" ] pub struct Search { pub q : :: mtproto :: string , } impl :: BareSerialize for Search { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Search { ref q } = self ; _ser . write_bare :: < :: mtproto :: string > ( q ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Search { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Search { q : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for Search { type Boxed = :: mtproto :: ChannelParticipantsFilter ; fn into_boxed ( self ) -> :: mtproto :: ChannelParticipantsFilter { :: mtproto :: ChannelParticipantsFilter :: Search ( self ) } } } pub mod channels { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channels.AdminLogResults`\n\n```text\nchannels.adminLogResults#ed8af74d events:Vector<ChannelAdminLogEvent> chats:Vector<Chat> users:Vector<User> = channels.AdminLogResults;\n```\n" ] pub enum AdminLogResults { AdminLogResults ( :: mtproto :: channels :: admin_log_results :: AdminLogResults ) , } impl AdminLogResults { pub fn chats ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > { match self { & AdminLogResults :: AdminLogResults ( ref x ) => & x . chats , } } pub fn events ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: ChannelAdminLogEvent > { match self { & AdminLogResults :: AdminLogResults ( ref x ) => & x . events , } } pub fn users ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > { match self { & AdminLogResults :: AdminLogResults ( ref x ) => & x . users , } } } impl :: BoxedSerialize for AdminLogResults { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & AdminLogResults :: AdminLogResults ( ref x ) => ( :: ConstructorNumber ( 0xed8af74d ) , x ) , } } } impl :: BoxedDeserialize for AdminLogResults { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xed8af74d ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xed8af74d ) => Ok ( AdminLogResults :: AdminLogResults ( _de . read_bare :: < :: mtproto :: channels :: admin_log_results :: AdminLogResults > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channels.ChannelParticipant`\n\n```text\nchannels.channelParticipant#d0d9b163 participant:ChannelParticipant users:Vector<User> = channels.ChannelParticipant;\n```\n" ] pub enum ChannelParticipant { ChannelParticipant ( :: mtproto :: channels :: channel_participant :: ChannelParticipant ) , } impl ChannelParticipant { pub fn participant ( & self ) -> & :: mtproto :: ChannelParticipant { match self { & ChannelParticipant :: ChannelParticipant ( ref x ) => & x . participant , } } pub fn users ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > { match self { & ChannelParticipant :: ChannelParticipant ( ref x ) => & x . users , } } } impl :: BoxedSerialize for ChannelParticipant { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ChannelParticipant :: ChannelParticipant ( ref x ) => ( :: ConstructorNumber ( 0xd0d9b163 ) , x ) , } } } impl :: BoxedDeserialize for ChannelParticipant { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xd0d9b163 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xd0d9b163 ) => Ok ( ChannelParticipant :: ChannelParticipant ( _de . read_bare :: < :: mtproto :: channels :: channel_participant :: ChannelParticipant > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channels.ChannelParticipants`\n\n```text\nchannels.channelParticipants#f56ee2a8 count:int participants:Vector<ChannelParticipant> users:Vector<User> = channels.ChannelParticipants;\n\nchannels.channelParticipantsNotModified#f0173fe9 = channels.ChannelParticipants;\n```\n" ] pub enum ChannelParticipants { ChannelParticipants ( :: mtproto :: channels :: channel_participants :: ChannelParticipants ) , NotModified , } impl ChannelParticipants { pub fn count ( & self ) -> Option < & :: mtproto :: int > { match self { & ChannelParticipants :: ChannelParticipants ( ref x ) => Some ( & x . count ) , _ => None } } pub fn participants ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: ChannelParticipant > > { match self { & ChannelParticipants :: ChannelParticipants ( ref x ) => Some ( & x . participants ) , _ => None } } pub fn users ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > { match self { & ChannelParticipants :: ChannelParticipants ( ref x ) => Some ( & x . users ) , _ => None } } } impl :: BoxedSerialize for ChannelParticipants { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ChannelParticipants :: ChannelParticipants ( ref x ) => ( :: ConstructorNumber ( 0xf56ee2a8 ) , x ) , & ChannelParticipants :: NotModified => ( :: ConstructorNumber ( 0xf0173fe9 ) , & ( ) ) , } } } impl :: BoxedDeserialize for ChannelParticipants { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xf56ee2a8 ) , :: ConstructorNumber ( 0xf0173fe9 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xf56ee2a8 ) => Ok ( ChannelParticipants :: ChannelParticipants ( _de . read_bare :: < :: mtproto :: channels :: channel_participants :: ChannelParticipants > ( ) ? ) ) , :: ConstructorNumber ( 0xf0173fe9 ) => Ok ( ChannelParticipants :: NotModified ) , id => _invalid_id ! ( id ) , } } } impl :: BoxedSerialize for Option < :: mtproto :: channels :: channel_participants :: ChannelParticipants > { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match * self { None => ( :: ConstructorNumber ( 0xf0173fe9 ) , & ( ) ) , Some ( ref x ) => ( :: ConstructorNumber ( 0xf56ee2a8 ) , x ) , } } } impl :: BoxedDeserialize for Option < :: mtproto :: channels :: channel_participants :: ChannelParticipants > { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xf0173fe9 ) , :: ConstructorNumber ( 0xf56ee2a8 ) ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xf0173fe9 ) => Ok ( None ) , :: ConstructorNumber ( 0xf56ee2a8 ) => Ok ( Some ( _de . read_bare :: < :: mtproto :: channels :: channel_participants :: ChannelParticipants > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } pub mod admin_log_results { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channels.adminLogResults`\n\n```text\nchannels.adminLogResults#ed8af74d events:Vector<ChannelAdminLogEvent> chats:Vector<Chat> users:Vector<User> = channels.AdminLogResults;\n```\n" ] pub struct AdminLogResults { pub events : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: ChannelAdminLogEvent > , pub chats : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > , pub users : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > , } impl :: BareSerialize for AdminLogResults { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & AdminLogResults { ref events , ref chats , ref users } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: ChannelAdminLogEvent > > ( events ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > ( chats ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( users ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for AdminLogResults { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( AdminLogResults { events : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: ChannelAdminLogEvent > > ( ) ? , chats : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > ( ) ? , users : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( ) ? , } ) } } impl :: IntoBoxed for AdminLogResults { type Boxed = :: mtproto :: channels :: AdminLogResults ; fn into_boxed ( self ) -> :: mtproto :: channels :: AdminLogResults { :: mtproto :: channels :: AdminLogResults :: AdminLogResults ( self ) } } } pub mod channel_participant { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channels.channelParticipant`\n\n```text\nchannels.channelParticipant#d0d9b163 participant:ChannelParticipant users:Vector<User> = channels.ChannelParticipant;\n```\n" ] pub struct ChannelParticipant { pub participant : :: mtproto :: ChannelParticipant , pub users : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > , } impl :: BareSerialize for ChannelParticipant { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChannelParticipant { ref participant , ref users } = self ; _ser . write_boxed :: < :: mtproto :: ChannelParticipant > ( participant ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( users ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ChannelParticipant { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ChannelParticipant { participant : _de . read_boxed :: < :: mtproto :: ChannelParticipant > ( ) ? , users : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( ) ? , } ) } } impl :: IntoBoxed for ChannelParticipant { type Boxed = :: mtproto :: channels :: ChannelParticipant ; fn into_boxed ( self ) -> :: mtproto :: channels :: ChannelParticipant { :: mtproto :: channels :: ChannelParticipant :: ChannelParticipant ( self ) } } } pub mod channel_participants { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channels.channelParticipants`\n\n```text\nchannels.channelParticipants#f56ee2a8 count:int participants:Vector<ChannelParticipant> users:Vector<User> = channels.ChannelParticipants;\n```\n" ] pub struct ChannelParticipants { pub count : :: mtproto :: int , pub participants : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: ChannelParticipant > , pub users : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > , } impl :: BareSerialize for ChannelParticipants { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChannelParticipants { ref count , ref participants , ref users } = self ; _ser . write_bare :: < :: mtproto :: int > ( count ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: ChannelParticipant > > ( participants ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( users ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ChannelParticipants { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ChannelParticipants { count : _de . read_bare :: < :: mtproto :: int > ( ) ? , participants : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: ChannelParticipant > > ( ) ? , users : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( ) ? , } ) } } impl :: IntoBoxed for ChannelParticipants { type Boxed = :: mtproto :: channels :: ChannelParticipants ; fn into_boxed ( self ) -> :: mtproto :: channels :: ChannelParticipants { :: mtproto :: channels :: ChannelParticipants :: ChannelParticipants ( self ) } } } } pub mod chat { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channel`\n\n```text\nchannel#450b7115 flags:# creator:flags.0?true left:flags.2?true editor:flags.3?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true democracy:flags.10?true signatures:flags.11?true min:flags.12?true id:int access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int version:int restriction_reason:flags.9?string admin_rights:flags.14?ChannelAdminRights banned_rights:flags.15?ChannelBannedRights participants_count:flags.17?int = Chat;\n```\n" ] pub struct Channel { pub creator : bool , pub left : bool , pub editor : bool , pub broadcast : bool , pub verified : bool , pub megagroup : bool , pub restricted : bool , pub democracy : bool , pub signatures : bool , pub min : bool , pub id : :: mtproto :: int , pub access_hash : Option < :: mtproto :: long > , pub title : :: mtproto :: string , pub username : Option < :: mtproto :: string > , pub photo : :: mtproto :: ChatPhoto , pub date : :: mtproto :: int , pub version : :: mtproto :: int , pub restriction_reason : Option < :: mtproto :: string > , pub admin_rights : Option < :: mtproto :: ChannelAdminRights > , pub banned_rights : Option < :: mtproto :: ChannelBannedRights > , pub participants_count : Option < :: mtproto :: int > , } impl :: BareSerialize for Channel { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Channel { creator , left , editor , broadcast , verified , megagroup , restricted , democracy , signatures , min , ref id , ref access_hash , ref title , ref username , ref photo , ref date , ref version , ref restriction_reason , ref admin_rights , ref banned_rights , ref participants_count } = self ; let mut _flags = 0i32 ; if creator { _flags |= 1 << 0u32 ; } if left { _flags |= 1 << 2u32 ; } if editor { _flags |= 1 << 3u32 ; } if broadcast { _flags |= 1 << 5u32 ; } if verified { _flags |= 1 << 7u32 ; } if megagroup { _flags |= 1 << 8u32 ; } if restricted { _flags |= 1 << 9u32 ; } if democracy { _flags |= 1 << 10u32 ; } if signatures { _flags |= 1 << 11u32 ; } if min { _flags |= 1 << 12u32 ; } if access_hash . is_some ( ) { _flags |= 1 << 13u32 ; } if username . is_some ( ) { _flags |= 1 << 6u32 ; } if restriction_reason . is_some ( ) { _flags |= 1 << 9u32 ; } if admin_rights . is_some ( ) { _flags |= 1 << 14u32 ; } if banned_rights . is_some ( ) { _flags |= 1 << 15u32 ; } if participants_count . is_some ( ) { _flags |= 1 << 17u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: int > ( id ) ? ; if let & Some ( ref inner ) = access_hash { _ser . write_bare :: < :: mtproto :: long > ( inner ) ? ; } _ser . write_bare :: < :: mtproto :: string > ( title ) ? ; if let & Some ( ref inner ) = username { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } _ser . write_boxed :: < :: mtproto :: ChatPhoto > ( photo ) ? ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; _ser . write_bare :: < :: mtproto :: int > ( version ) ? ; if let & Some ( ref inner ) = restriction_reason { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = admin_rights { _ser . write_boxed :: < :: mtproto :: ChannelAdminRights > ( inner ) ? ; } if let & Some ( ref inner ) = banned_rights { _ser . write_boxed :: < :: mtproto :: ChannelBannedRights > ( inner ) ? ; } if let & Some ( ref inner ) = participants_count { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for Channel { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( Channel { creator : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 0u32 ) != 0 } , left : _flags & ( 1 << 2u32 ) != 0 , editor : _flags & ( 1 << 3u32 ) != 0 , broadcast : _flags & ( 1 << 5u32 ) != 0 , verified : _flags & ( 1 << 7u32 ) != 0 , megagroup : _flags & ( 1 << 8u32 ) != 0 , restricted : _flags & ( 1 << 9u32 ) != 0 , democracy : _flags & ( 1 << 10u32 ) != 0 , signatures : _flags & ( 1 << 11u32 ) != 0 , min : _flags & ( 1 << 12u32 ) != 0 , id : _de . read_bare :: < :: mtproto :: int > ( ) ? , access_hash : if _flags & ( 1 << 13u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: long > ( ) ? ) } else { None } , title : _de . read_bare :: < :: mtproto :: string > ( ) ? , username : if _flags & ( 1 << 6u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , photo : _de . read_boxed :: < :: mtproto :: ChatPhoto > ( ) ? , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , version : _de . read_bare :: < :: mtproto :: int > ( ) ? , restriction_reason : if _flags & ( 1 << 9u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , admin_rights : if _flags & ( 1 << 14u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: ChannelAdminRights > ( ) ? ) } else { None } , banned_rights : if _flags & ( 1 << 15u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: ChannelBannedRights > ( ) ? ) } else { None } , participants_count : if _flags & ( 1 << 17u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for Channel { type Boxed = :: mtproto :: Chat ; fn into_boxed ( self ) -> :: mtproto :: Chat { :: mtproto :: Chat :: Channel ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channelForbidden`\n\n```text\nchannelForbidden#289da732 flags:# broadcast:flags.5?true megagroup:flags.8?true id:int access_hash:long title:string until_date:flags.16?int = Chat;\n```\n" ] pub struct ChannelForbidden { pub broadcast : bool , pub megagroup : bool , pub id : :: mtproto :: int , pub access_hash : :: mtproto :: long , pub title : :: mtproto :: string , pub until_date : Option < :: mtproto :: int > , } impl :: BareSerialize for ChannelForbidden { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChannelForbidden { broadcast , megagroup , ref id , ref access_hash , ref title , ref until_date } = self ; let mut _flags = 0i32 ; if broadcast { _flags |= 1 << 5u32 ; } if megagroup { _flags |= 1 << 8u32 ; } if until_date . is_some ( ) { _flags |= 1 << 16u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: int > ( id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( access_hash ) ? ; _ser . write_bare :: < :: mtproto :: string > ( title ) ? ; if let & Some ( ref inner ) = until_date { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for ChannelForbidden { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( ChannelForbidden { broadcast : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 5u32 ) != 0 } , megagroup : _flags & ( 1 << 8u32 ) != 0 , id : _de . read_bare :: < :: mtproto :: int > ( ) ? , access_hash : _de . read_bare :: < :: mtproto :: long > ( ) ? , title : _de . read_bare :: < :: mtproto :: string > ( ) ? , until_date : if _flags & ( 1 << 16u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for ChannelForbidden { type Boxed = :: mtproto :: Chat ; fn into_boxed ( self ) -> :: mtproto :: Chat { :: mtproto :: Chat :: ChannelForbidden ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `chat`\n\n```text\nchat#d91cdd54 flags:# creator:flags.0?true kicked:flags.1?true left:flags.2?true admins_enabled:flags.3?true admin:flags.4?true deactivated:flags.5?true id:int title:string photo:ChatPhoto participants_count:int date:int version:int migrated_to:flags.6?InputChannel = Chat;\n```\n" ] pub struct Chat { pub creator : bool , pub kicked : bool , pub left : bool , pub admins_enabled : bool , pub admin : bool , pub deactivated : bool , pub id : :: mtproto :: int , pub title : :: mtproto :: string , pub photo : :: mtproto :: ChatPhoto , pub participants_count : :: mtproto :: int , pub date : :: mtproto :: int , pub version : :: mtproto :: int , pub migrated_to : Option < :: mtproto :: InputChannel > , } impl :: BareSerialize for Chat { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Chat { creator , kicked , left , admins_enabled , admin , deactivated , ref id , ref title , ref photo , ref participants_count , ref date , ref version , ref migrated_to } = self ; let mut _flags = 0i32 ; if creator { _flags |= 1 << 0u32 ; } if kicked { _flags |= 1 << 1u32 ; } if left { _flags |= 1 << 2u32 ; } if admins_enabled { _flags |= 1 << 3u32 ; } if admin { _flags |= 1 << 4u32 ; } if deactivated { _flags |= 1 << 5u32 ; } if migrated_to . is_some ( ) { _flags |= 1 << 6u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: int > ( id ) ? ; _ser . write_bare :: < :: mtproto :: string > ( title ) ? ; _ser . write_boxed :: < :: mtproto :: ChatPhoto > ( photo ) ? ; _ser . write_bare :: < :: mtproto :: int > ( participants_count ) ? ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; _ser . write_bare :: < :: mtproto :: int > ( version ) ? ; if let & Some ( ref inner ) = migrated_to { _ser . write_boxed :: < :: mtproto :: InputChannel > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for Chat { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( Chat { creator : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 0u32 ) != 0 } , kicked : _flags & ( 1 << 1u32 ) != 0 , left : _flags & ( 1 << 2u32 ) != 0 , admins_enabled : _flags & ( 1 << 3u32 ) != 0 , admin : _flags & ( 1 << 4u32 ) != 0 , deactivated : _flags & ( 1 << 5u32 ) != 0 , id : _de . read_bare :: < :: mtproto :: int > ( ) ? , title : _de . read_bare :: < :: mtproto :: string > ( ) ? , photo : _de . read_boxed :: < :: mtproto :: ChatPhoto > ( ) ? , participants_count : _de . read_bare :: < :: mtproto :: int > ( ) ? , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , version : _de . read_bare :: < :: mtproto :: int > ( ) ? , migrated_to : if _flags & ( 1 << 6u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: InputChannel > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for Chat { type Boxed = :: mtproto :: Chat ; fn into_boxed ( self ) -> :: mtproto :: Chat { :: mtproto :: Chat :: Chat ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `chatEmpty`\n\n```text\nchatEmpty#9ba2d800 id:int = Chat;\n```\n" ] pub struct ChatEmpty { pub id : :: mtproto :: int , } impl :: BareSerialize for ChatEmpty { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChatEmpty { ref id } = self ; _ser . write_bare :: < :: mtproto :: int > ( id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ChatEmpty { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ChatEmpty { id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for ChatEmpty { type Boxed = :: mtproto :: Chat ; fn into_boxed ( self ) -> :: mtproto :: Chat { :: mtproto :: Chat :: ChatEmpty ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `chatForbidden`\n\n```text\nchatForbidden#7328bdb id:int title:string = Chat;\n```\n" ] pub struct ChatForbidden { pub id : :: mtproto :: int , pub title : :: mtproto :: string , } impl :: BareSerialize for ChatForbidden { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChatForbidden { ref id , ref title } = self ; _ser . write_bare :: < :: mtproto :: int > ( id ) ? ; _ser . write_bare :: < :: mtproto :: string > ( title ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ChatForbidden { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ChatForbidden { id : _de . read_bare :: < :: mtproto :: int > ( ) ? , title : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for ChatForbidden { type Boxed = :: mtproto :: Chat ; fn into_boxed ( self ) -> :: mtproto :: Chat { :: mtproto :: Chat :: ChatForbidden ( self ) } } } pub mod chat_full { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channelFull`\n\n```text\nchannelFull#76af5481 flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true id:int about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:ExportedChatInvite bot_info:Vector<BotInfo> migrated_from_chat_id:flags.4?int migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int = ChatFull;\n```\n" ] pub struct ChannelFull { pub can_view_participants : bool , pub can_set_username : bool , pub can_set_stickers : bool , pub hidden_prehistory : bool , pub id : :: mtproto :: int , pub about : :: mtproto :: string , pub participants_count : Option < :: mtproto :: int > , pub admins_count : Option < :: mtproto :: int > , pub kicked_count : Option < :: mtproto :: int > , pub banned_count : Option < :: mtproto :: int > , pub read_inbox_max_id : :: mtproto :: int , pub read_outbox_max_id : :: mtproto :: int , pub unread_count : :: mtproto :: int , pub chat_photo : :: mtproto :: Photo , pub notify_settings : :: mtproto :: PeerNotifySettings , pub exported_invite : :: mtproto :: ExportedChatInvite , pub bot_info : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: BotInfo > , pub migrated_from_chat_id : Option < :: mtproto :: int > , pub migrated_from_max_id : Option < :: mtproto :: int > , pub pinned_msg_id : Option < :: mtproto :: int > , pub stickerset : Option < :: mtproto :: StickerSet > , pub available_min_id : Option < :: mtproto :: int > , } impl :: BareSerialize for ChannelFull { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChannelFull { can_view_participants , can_set_username , can_set_stickers , hidden_prehistory , ref id , ref about , ref participants_count , ref admins_count , ref kicked_count , ref banned_count , ref read_inbox_max_id , ref read_outbox_max_id , ref unread_count , ref chat_photo , ref notify_settings , ref exported_invite , ref bot_info , ref migrated_from_chat_id , ref migrated_from_max_id , ref pinned_msg_id , ref stickerset , ref available_min_id } = self ; let mut _flags = 0i32 ; if can_view_participants { _flags |= 1 << 3u32 ; } if can_set_username { _flags |= 1 << 6u32 ; } if can_set_stickers { _flags |= 1 << 7u32 ; } if hidden_prehistory { _flags |= 1 << 10u32 ; } if participants_count . is_some ( ) { _flags |= 1 << 0u32 ; } if admins_count . is_some ( ) { _flags |= 1 << 1u32 ; } if kicked_count . is_some ( ) { _flags |= 1 << 2u32 ; } if banned_count . is_some ( ) { _flags |= 1 << 2u32 ; } if migrated_from_chat_id . is_some ( ) { _flags |= 1 << 4u32 ; } if migrated_from_max_id . is_some ( ) { _flags |= 1 << 4u32 ; } if pinned_msg_id . is_some ( ) { _flags |= 1 << 5u32 ; } if stickerset . is_some ( ) { _flags |= 1 << 8u32 ; } if available_min_id . is_some ( ) { _flags |= 1 << 9u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: int > ( id ) ? ; _ser . write_bare :: < :: mtproto :: string > ( about ) ? ; if let & Some ( ref inner ) = participants_count { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } if let & Some ( ref inner ) = admins_count { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } if let & Some ( ref inner ) = kicked_count { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } if let & Some ( ref inner ) = banned_count { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } _ser . write_bare :: < :: mtproto :: int > ( read_inbox_max_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( read_outbox_max_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( unread_count ) ? ; _ser . write_boxed :: < :: mtproto :: Photo > ( chat_photo ) ? ; _ser . write_boxed :: < :: mtproto :: PeerNotifySettings > ( notify_settings ) ? ; _ser . write_boxed :: < :: mtproto :: ExportedChatInvite > ( exported_invite ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: BotInfo > > ( bot_info ) ? ; if let & Some ( ref inner ) = migrated_from_chat_id { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } if let & Some ( ref inner ) = migrated_from_max_id { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } if let & Some ( ref inner ) = pinned_msg_id { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } if let & Some ( ref inner ) = stickerset { _ser . write_boxed :: < :: mtproto :: StickerSet > ( inner ) ? ; } if let & Some ( ref inner ) = available_min_id { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for ChannelFull { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( ChannelFull { can_view_participants : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 3u32 ) != 0 } , can_set_username : _flags & ( 1 << 6u32 ) != 0 , can_set_stickers : _flags & ( 1 << 7u32 ) != 0 , hidden_prehistory : _flags & ( 1 << 10u32 ) != 0 , id : _de . read_bare :: < :: mtproto :: int > ( ) ? , about : _de . read_bare :: < :: mtproto :: string > ( ) ? , participants_count : if _flags & ( 1 << 0u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , admins_count : if _flags & ( 1 << 1u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , kicked_count : if _flags & ( 1 << 2u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , banned_count : if _flags & ( 1 << 2u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , read_inbox_max_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , read_outbox_max_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , unread_count : _de . read_bare :: < :: mtproto :: int > ( ) ? , chat_photo : _de . read_boxed :: < :: mtproto :: Photo > ( ) ? , notify_settings : _de . read_boxed :: < :: mtproto :: PeerNotifySettings > ( ) ? , exported_invite : _de . read_boxed :: < :: mtproto :: ExportedChatInvite > ( ) ? , bot_info : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: BotInfo > > ( ) ? , migrated_from_chat_id : if _flags & ( 1 << 4u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , migrated_from_max_id : if _flags & ( 1 << 4u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , pinned_msg_id : if _flags & ( 1 << 5u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , stickerset : if _flags & ( 1 << 8u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: StickerSet > ( ) ? ) } else { None } , available_min_id : if _flags & ( 1 << 9u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for ChannelFull { type Boxed = :: mtproto :: ChatFull ; fn into_boxed ( self ) -> :: mtproto :: ChatFull { :: mtproto :: ChatFull :: ChannelFull ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `chatFull`\n\n```text\nchatFull#2e02a614 id:int participants:ChatParticipants chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:ExportedChatInvite bot_info:Vector<BotInfo> = ChatFull;\n```\n" ] pub struct ChatFull { pub id : :: mtproto :: int , pub participants : :: mtproto :: ChatParticipants , pub chat_photo : :: mtproto :: Photo , pub notify_settings : :: mtproto :: PeerNotifySettings , pub exported_invite : :: mtproto :: ExportedChatInvite , pub bot_info : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: BotInfo > , } impl :: BareSerialize for ChatFull { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChatFull { ref id , ref participants , ref chat_photo , ref notify_settings , ref exported_invite , ref bot_info } = self ; _ser . write_bare :: < :: mtproto :: int > ( id ) ? ; _ser . write_boxed :: < :: mtproto :: ChatParticipants > ( participants ) ? ; _ser . write_boxed :: < :: mtproto :: Photo > ( chat_photo ) ? ; _ser . write_boxed :: < :: mtproto :: PeerNotifySettings > ( notify_settings ) ? ; _ser . write_boxed :: < :: mtproto :: ExportedChatInvite > ( exported_invite ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: BotInfo > > ( bot_info ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ChatFull { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ChatFull { id : _de . read_bare :: < :: mtproto :: int > ( ) ? , participants : _de . read_boxed :: < :: mtproto :: ChatParticipants > ( ) ? , chat_photo : _de . read_boxed :: < :: mtproto :: Photo > ( ) ? , notify_settings : _de . read_boxed :: < :: mtproto :: PeerNotifySettings > ( ) ? , exported_invite : _de . read_boxed :: < :: mtproto :: ExportedChatInvite > ( ) ? , bot_info : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: BotInfo > > ( ) ? , } ) } } impl :: IntoBoxed for ChatFull { type Boxed = :: mtproto :: ChatFull ; fn into_boxed ( self ) -> :: mtproto :: ChatFull { :: mtproto :: ChatFull :: ChatFull ( self ) } } } pub mod chat_invite { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `chatInviteAlready`\n\n```text\nchatInviteAlready#5a686d7c chat:Chat = ChatInvite;\n```\n" ] pub struct Already { pub chat : :: mtproto :: Chat , } impl :: BareSerialize for Already { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Already { ref chat } = self ; _ser . write_boxed :: < :: mtproto :: Chat > ( chat ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Already { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Already { chat : _de . read_boxed :: < :: mtproto :: Chat > ( ) ? , } ) } } impl :: IntoBoxed for Already { type Boxed = :: mtproto :: ChatInvite ; fn into_boxed ( self ) -> :: mtproto :: ChatInvite { :: mtproto :: ChatInvite :: Already ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `chatInvite`\n\n```text\nchatInvite#db74f558 flags:# channel:flags.0?true broadcast:flags.1?true public:flags.2?true megagroup:flags.3?true title:string photo:ChatPhoto participants_count:int participants:flags.4?Vector<User> = ChatInvite;\n```\n" ] pub struct ChatInvite { pub channel : bool , pub broadcast : bool , pub public : bool , pub megagroup : bool , pub title : :: mtproto :: string , pub photo : :: mtproto :: ChatPhoto , pub participants_count : :: mtproto :: int , pub participants : Option < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > , } impl :: BareSerialize for ChatInvite { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChatInvite { channel , broadcast , public , megagroup , ref title , ref photo , ref participants_count , ref participants } = self ; let mut _flags = 0i32 ; if channel { _flags |= 1 << 0u32 ; } if broadcast { _flags |= 1 << 1u32 ; } if public { _flags |= 1 << 2u32 ; } if megagroup { _flags |= 1 << 3u32 ; } if participants . is_some ( ) { _flags |= 1 << 4u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: string > ( title ) ? ; _ser . write_boxed :: < :: mtproto :: ChatPhoto > ( photo ) ? ; _ser . write_bare :: < :: mtproto :: int > ( participants_count ) ? ; if let & Some ( ref inner ) = participants { _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for ChatInvite { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( ChatInvite { channel : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 0u32 ) != 0 } , broadcast : _flags & ( 1 << 1u32 ) != 0 , public : _flags & ( 1 << 2u32 ) != 0 , megagroup : _flags & ( 1 << 3u32 ) != 0 , title : _de . read_bare :: < :: mtproto :: string > ( ) ? , photo : _de . read_boxed :: < :: mtproto :: ChatPhoto > ( ) ? , participants_count : _de . read_bare :: < :: mtproto :: int > ( ) ? , participants : if _flags & ( 1 << 4u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for ChatInvite { type Boxed = :: mtproto :: ChatInvite ; fn into_boxed ( self ) -> :: mtproto :: ChatInvite { :: mtproto :: ChatInvite :: ChatInvite ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `chatInviteExported`\n\n```text\nchatInviteExported#fc2e05bc link:string = ExportedChatInvite;\n```\n" ] pub struct Exported { pub link : :: mtproto :: string , } impl :: BareSerialize for Exported { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Exported { ref link } = self ; _ser . write_bare :: < :: mtproto :: string > ( link ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Exported { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Exported { link : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for Exported { type Boxed = :: mtproto :: ExportedChatInvite ; fn into_boxed ( self ) -> :: mtproto :: ExportedChatInvite { :: mtproto :: ExportedChatInvite :: Exported ( self ) } } } pub mod chat_participant { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `chatParticipantAdmin`\n\n```text\nchatParticipantAdmin#e2d6e436 user_id:int inviter_id:int date:int = ChatParticipant;\n```\n" ] pub struct Admin { pub user_id : :: mtproto :: int , pub inviter_id : :: mtproto :: int , pub date : :: mtproto :: int , } impl :: BareSerialize for Admin { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Admin { ref user_id , ref inviter_id , ref date } = self ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( inviter_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Admin { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Admin { user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , inviter_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for Admin { type Boxed = :: mtproto :: ChatParticipant ; fn into_boxed ( self ) -> :: mtproto :: ChatParticipant { :: mtproto :: ChatParticipant :: Admin ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `chatParticipant`\n\n```text\nchatParticipant#c8d7493e user_id:int inviter_id:int date:int = ChatParticipant;\n```\n" ] pub struct ChatParticipant { pub user_id : :: mtproto :: int , pub inviter_id : :: mtproto :: int , pub date : :: mtproto :: int , } impl :: BareSerialize for ChatParticipant { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChatParticipant { ref user_id , ref inviter_id , ref date } = self ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( inviter_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ChatParticipant { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ChatParticipant { user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , inviter_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for ChatParticipant { type Boxed = :: mtproto :: ChatParticipant ; fn into_boxed ( self ) -> :: mtproto :: ChatParticipant { :: mtproto :: ChatParticipant :: ChatParticipant ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `chatParticipantCreator`\n\n```text\nchatParticipantCreator#da13538a user_id:int = ChatParticipant;\n```\n" ] pub struct Creator { pub user_id : :: mtproto :: int , } impl :: BareSerialize for Creator { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Creator { ref user_id } = self ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Creator { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Creator { user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for Creator { type Boxed = :: mtproto :: ChatParticipant ; fn into_boxed ( self ) -> :: mtproto :: ChatParticipant { :: mtproto :: ChatParticipant :: Creator ( self ) } } } pub mod chat_participants { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `chatParticipants`\n\n```text\nchatParticipants#3f460fed chat_id:int participants:Vector<ChatParticipant> version:int = ChatParticipants;\n```\n" ] pub struct ChatParticipants { pub chat_id : :: mtproto :: int , pub participants : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: ChatParticipant > , pub version : :: mtproto :: int , } impl :: BareSerialize for ChatParticipants { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChatParticipants { ref chat_id , ref participants , ref version } = self ; _ser . write_bare :: < :: mtproto :: int > ( chat_id ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: ChatParticipant > > ( participants ) ? ; _ser . write_bare :: < :: mtproto :: int > ( version ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ChatParticipants { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ChatParticipants { chat_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , participants : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: ChatParticipant > > ( ) ? , version : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for ChatParticipants { type Boxed = :: mtproto :: ChatParticipants ; fn into_boxed ( self ) -> :: mtproto :: ChatParticipants { :: mtproto :: ChatParticipants :: ChatParticipants ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `chatParticipantsForbidden`\n\n```text\nchatParticipantsForbidden#fc900c2b flags:# chat_id:int self_participant:flags.0?ChatParticipant = ChatParticipants;\n```\n" ] pub struct Forbidden { pub chat_id : :: mtproto :: int , pub self_participant : Option < :: mtproto :: ChatParticipant > , } impl :: BareSerialize for Forbidden { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Forbidden { ref chat_id , ref self_participant } = self ; let mut _flags = 0i32 ; if self_participant . is_some ( ) { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: int > ( chat_id ) ? ; if let & Some ( ref inner ) = self_participant { _ser . write_boxed :: < :: mtproto :: ChatParticipant > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for Forbidden { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( Forbidden { chat_id : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _de . read_bare :: < :: mtproto :: int > ( ) ? } , self_participant : if _flags & ( 1 << 0u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: ChatParticipant > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for Forbidden { type Boxed = :: mtproto :: ChatParticipants ; fn into_boxed ( self ) -> :: mtproto :: ChatParticipants { :: mtproto :: ChatParticipants :: Forbidden ( self ) } } } pub mod chat_photo { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `chatPhoto`\n\n```text\nchatPhoto#6153276a photo_small:FileLocation photo_big:FileLocation = ChatPhoto;\n```\n" ] pub struct ChatPhoto { pub photo_small : :: mtproto :: FileLocation , pub photo_big : :: mtproto :: FileLocation , } impl :: BareSerialize for ChatPhoto { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChatPhoto { ref photo_small , ref photo_big } = self ; _ser . write_boxed :: < :: mtproto :: FileLocation > ( photo_small ) ? ; _ser . write_boxed :: < :: mtproto :: FileLocation > ( photo_big ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ChatPhoto { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ChatPhoto { photo_small : _de . read_boxed :: < :: mtproto :: FileLocation > ( ) ? , photo_big : _de . read_boxed :: < :: mtproto :: FileLocation > ( ) ? , } ) } } impl :: IntoBoxed for ChatPhoto { type Boxed = :: mtproto :: ChatPhoto ; fn into_boxed ( self ) -> :: mtproto :: ChatPhoto { :: mtproto :: ChatPhoto :: ChatPhoto ( self ) } } } pub mod client_dh_inner_data { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `client_DH_inner_data`\n\n```text\nclient_DH_inner_data#6643b654 nonce:int128 server_nonce:int128 retry_id:long g_b:string = Client_DH_Inner_Data;\n```\n" ] pub struct ClientDHInnerData { pub nonce : :: mtproto :: int128 , pub server_nonce : :: mtproto :: int128 , pub retry_id : :: mtproto :: long , pub g_b : :: mtproto :: bytes , } impl :: BareSerialize for ClientDHInnerData { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ClientDHInnerData { ref nonce , ref server_nonce , ref retry_id , ref g_b } = self ; _ser . write_bare :: < :: mtproto :: int128 > ( nonce ) ? ; _ser . write_bare :: < :: mtproto :: int128 > ( server_nonce ) ? ; _ser . write_bare :: < :: mtproto :: long > ( retry_id ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( g_b ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ClientDHInnerData { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ClientDHInnerData { nonce : _de . read_bare :: < :: mtproto :: int128 > ( ) ? , server_nonce : _de . read_bare :: < :: mtproto :: int128 > ( ) ? , retry_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , g_b : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , } ) } } impl :: IntoBoxed for ClientDHInnerData { type Boxed = :: mtproto :: ClientDHInnerData ; fn into_boxed ( self ) -> :: mtproto :: ClientDHInnerData { :: mtproto :: ClientDHInnerData :: ClientDHInnerData ( self ) } } } pub mod config { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `config`\n\n```text\nconfig#9c840964 flags:# phonecalls_enabled:flags.1?true default_p2p_contacts:flags.3?true date:int expires:int test_mode:Bool this_dc:int dc_options:Vector<DcOption> chat_size_max:int megagroup_size_max:int forwarded_count_max:int online_update_period_ms:int offline_blur_timeout_ms:int offline_idle_timeout_ms:int online_cloud_timeout_ms:int notify_cloud_delay_ms:int notify_default_delay_ms:int chat_big_size:int push_chat_period_ms:int push_chat_limit:int saved_gifs_limit:int edit_time_limit:int rating_e_decay:int stickers_recent_limit:int stickers_faved_limit:int channels_read_media_period:int tmp_sessions:flags.0?int pinned_dialogs_count_max:int call_receive_timeout_ms:int call_ring_timeout_ms:int call_connect_timeout_ms:int call_packet_timeout_ms:int me_url_prefix:string suggested_lang_code:flags.2?string lang_pack_version:flags.2?int disabled_features:Vector<DisabledFeature> = Config;\n```\n" ] pub struct Config { pub phonecalls_enabled : bool , pub default_p2p_contacts : bool , pub date : :: mtproto :: int , pub expires : :: mtproto :: int , pub test_mode : :: mtproto :: Bool , pub this_dc : :: mtproto :: int , pub dc_options : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: DcOption > , pub chat_size_max : :: mtproto :: int , pub megagroup_size_max : :: mtproto :: int , pub forwarded_count_max : :: mtproto :: int , pub online_update_period_ms : :: mtproto :: int , pub offline_blur_timeout_ms : :: mtproto :: int , pub offline_idle_timeout_ms : :: mtproto :: int , pub online_cloud_timeout_ms : :: mtproto :: int , pub notify_cloud_delay_ms : :: mtproto :: int , pub notify_default_delay_ms : :: mtproto :: int , pub chat_big_size : :: mtproto :: int , pub push_chat_period_ms : :: mtproto :: int , pub push_chat_limit : :: mtproto :: int , pub saved_gifs_limit : :: mtproto :: int , pub edit_time_limit : :: mtproto :: int , pub rating_e_decay : :: mtproto :: int , pub stickers_recent_limit : :: mtproto :: int , pub stickers_faved_limit : :: mtproto :: int , pub channels_read_media_period : :: mtproto :: int , pub tmp_sessions : Option < :: mtproto :: int > , pub pinned_dialogs_count_max : :: mtproto :: int , pub call_receive_timeout_ms : :: mtproto :: int , pub call_ring_timeout_ms : :: mtproto :: int , pub call_connect_timeout_ms : :: mtproto :: int , pub call_packet_timeout_ms : :: mtproto :: int , pub me_url_prefix : :: mtproto :: string , pub suggested_lang_code : Option < :: mtproto :: string > , pub lang_pack_version : Option < :: mtproto :: int > , pub disabled_features : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: DisabledFeature > , } impl :: BareSerialize for Config { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Config { phonecalls_enabled , default_p2p_contacts , ref date , ref expires , ref test_mode , ref this_dc , ref dc_options , ref chat_size_max , ref megagroup_size_max , ref forwarded_count_max , ref online_update_period_ms , ref offline_blur_timeout_ms , ref offline_idle_timeout_ms , ref online_cloud_timeout_ms , ref notify_cloud_delay_ms , ref notify_default_delay_ms , ref chat_big_size , ref push_chat_period_ms , ref push_chat_limit , ref saved_gifs_limit , ref edit_time_limit , ref rating_e_decay , ref stickers_recent_limit , ref stickers_faved_limit , ref channels_read_media_period , ref tmp_sessions , ref pinned_dialogs_count_max , ref call_receive_timeout_ms , ref call_ring_timeout_ms , ref call_connect_timeout_ms , ref call_packet_timeout_ms , ref me_url_prefix , ref suggested_lang_code , ref lang_pack_version , ref disabled_features } = self ; let mut _flags = 0i32 ; if phonecalls_enabled { _flags |= 1 << 1u32 ; } if default_p2p_contacts { _flags |= 1 << 3u32 ; } if tmp_sessions . is_some ( ) { _flags |= 1 << 0u32 ; } if suggested_lang_code . is_some ( ) { _flags |= 1 << 2u32 ; } if lang_pack_version . is_some ( ) { _flags |= 1 << 2u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; _ser . write_bare :: < :: mtproto :: int > ( expires ) ? ; _ser . write_boxed :: < :: mtproto :: Bool > ( test_mode ) ? ; _ser . write_bare :: < :: mtproto :: int > ( this_dc ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: DcOption > > ( dc_options ) ? ; _ser . write_bare :: < :: mtproto :: int > ( chat_size_max ) ? ; _ser . write_bare :: < :: mtproto :: int > ( megagroup_size_max ) ? ; _ser . write_bare :: < :: mtproto :: int > ( forwarded_count_max ) ? ; _ser . write_bare :: < :: mtproto :: int > ( online_update_period_ms ) ? ; _ser . write_bare :: < :: mtproto :: int > ( offline_blur_timeout_ms ) ? ; _ser . write_bare :: < :: mtproto :: int > ( offline_idle_timeout_ms ) ? ; _ser . write_bare :: < :: mtproto :: int > ( online_cloud_timeout_ms ) ? ; _ser . write_bare :: < :: mtproto :: int > ( notify_cloud_delay_ms ) ? ; _ser . write_bare :: < :: mtproto :: int > ( notify_default_delay_ms ) ? ; _ser . write_bare :: < :: mtproto :: int > ( chat_big_size ) ? ; _ser . write_bare :: < :: mtproto :: int > ( push_chat_period_ms ) ? ; _ser . write_bare :: < :: mtproto :: int > ( push_chat_limit ) ? ; _ser . write_bare :: < :: mtproto :: int > ( saved_gifs_limit ) ? ; _ser . write_bare :: < :: mtproto :: int > ( edit_time_limit ) ? ; _ser . write_bare :: < :: mtproto :: int > ( rating_e_decay ) ? ; _ser . write_bare :: < :: mtproto :: int > ( stickers_recent_limit ) ? ; _ser . write_bare :: < :: mtproto :: int > ( stickers_faved_limit ) ? ; _ser . write_bare :: < :: mtproto :: int > ( channels_read_media_period ) ? ; if let & Some ( ref inner ) = tmp_sessions { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } _ser . write_bare :: < :: mtproto :: int > ( pinned_dialogs_count_max ) ? ; _ser . write_bare :: < :: mtproto :: int > ( call_receive_timeout_ms ) ? ; _ser . write_bare :: < :: mtproto :: int > ( call_ring_timeout_ms ) ? ; _ser . write_bare :: < :: mtproto :: int > ( call_connect_timeout_ms ) ? ; _ser . write_bare :: < :: mtproto :: int > ( call_packet_timeout_ms ) ? ; _ser . write_bare :: < :: mtproto :: string > ( me_url_prefix ) ? ; if let & Some ( ref inner ) = suggested_lang_code { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = lang_pack_version { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: DisabledFeature > > ( disabled_features ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Config { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( Config { phonecalls_enabled : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 1u32 ) != 0 } , default_p2p_contacts : _flags & ( 1 << 3u32 ) != 0 , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , expires : _de . read_bare :: < :: mtproto :: int > ( ) ? , test_mode : _de . read_boxed :: < :: mtproto :: Bool > ( ) ? , this_dc : _de . read_bare :: < :: mtproto :: int > ( ) ? , dc_options : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: DcOption > > ( ) ? , chat_size_max : _de . read_bare :: < :: mtproto :: int > ( ) ? , megagroup_size_max : _de . read_bare :: < :: mtproto :: int > ( ) ? , forwarded_count_max : _de . read_bare :: < :: mtproto :: int > ( ) ? , online_update_period_ms : _de . read_bare :: < :: mtproto :: int > ( ) ? , offline_blur_timeout_ms : _de . read_bare :: < :: mtproto :: int > ( ) ? , offline_idle_timeout_ms : _de . read_bare :: < :: mtproto :: int > ( ) ? , online_cloud_timeout_ms : _de . read_bare :: < :: mtproto :: int > ( ) ? , notify_cloud_delay_ms : _de . read_bare :: < :: mtproto :: int > ( ) ? , notify_default_delay_ms : _de . read_bare :: < :: mtproto :: int > ( ) ? , chat_big_size : _de . read_bare :: < :: mtproto :: int > ( ) ? , push_chat_period_ms : _de . read_bare :: < :: mtproto :: int > ( ) ? , push_chat_limit : _de . read_bare :: < :: mtproto :: int > ( ) ? , saved_gifs_limit : _de . read_bare :: < :: mtproto :: int > ( ) ? , edit_time_limit : _de . read_bare :: < :: mtproto :: int > ( ) ? , rating_e_decay : _de . read_bare :: < :: mtproto :: int > ( ) ? , stickers_recent_limit : _de . read_bare :: < :: mtproto :: int > ( ) ? , stickers_faved_limit : _de . read_bare :: < :: mtproto :: int > ( ) ? , channels_read_media_period : _de . read_bare :: < :: mtproto :: int > ( ) ? , tmp_sessions : if _flags & ( 1 << 0u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , pinned_dialogs_count_max : _de . read_bare :: < :: mtproto :: int > ( ) ? , call_receive_timeout_ms : _de . read_bare :: < :: mtproto :: int > ( ) ? , call_ring_timeout_ms : _de . read_bare :: < :: mtproto :: int > ( ) ? , call_connect_timeout_ms : _de . read_bare :: < :: mtproto :: int > ( ) ? , call_packet_timeout_ms : _de . read_bare :: < :: mtproto :: int > ( ) ? , me_url_prefix : _de . read_bare :: < :: mtproto :: string > ( ) ? , suggested_lang_code : if _flags & ( 1 << 2u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , lang_pack_version : if _flags & ( 1 << 2u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , disabled_features : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: DisabledFeature > > ( ) ? , } ) } } impl :: IntoBoxed for Config { type Boxed = :: mtproto :: Config ; fn into_boxed ( self ) -> :: mtproto :: Config { :: mtproto :: Config :: Config ( self ) } } } pub mod contact { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `contact`\n\n```text\ncontact#f911c994 user_id:int mutual:Bool = Contact;\n```\n" ] pub struct Contact { pub user_id : :: mtproto :: int , pub mutual : :: mtproto :: Bool , } impl :: BareSerialize for Contact { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Contact { ref user_id , ref mutual } = self ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; _ser . write_boxed :: < :: mtproto :: Bool > ( mutual ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Contact { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Contact { user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , mutual : _de . read_boxed :: < :: mtproto :: Bool > ( ) ? , } ) } } impl :: IntoBoxed for Contact { type Boxed = :: mtproto :: Contact ; fn into_boxed ( self ) -> :: mtproto :: Contact { :: mtproto :: Contact :: Contact ( self ) } } } pub mod contact_blocked { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `contactBlocked`\n\n```text\ncontactBlocked#561bc879 user_id:int date:int = ContactBlocked;\n```\n" ] pub struct ContactBlocked { pub user_id : :: mtproto :: int , pub date : :: mtproto :: int , } impl :: BareSerialize for ContactBlocked { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ContactBlocked { ref user_id , ref date } = self ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ContactBlocked { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ContactBlocked { user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for ContactBlocked { type Boxed = :: mtproto :: ContactBlocked ; fn into_boxed ( self ) -> :: mtproto :: ContactBlocked { :: mtproto :: ContactBlocked :: ContactBlocked ( self ) } } } pub mod contact_link { } pub mod contact_status { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `contactStatus`\n\n```text\ncontactStatus#d3680c61 user_id:int status:UserStatus = ContactStatus;\n```\n" ] pub struct ContactStatus { pub user_id : :: mtproto :: int , pub status : :: mtproto :: UserStatus , } impl :: BareSerialize for ContactStatus { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ContactStatus { ref user_id , ref status } = self ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; _ser . write_boxed :: < :: mtproto :: UserStatus > ( status ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ContactStatus { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ContactStatus { user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , status : _de . read_boxed :: < :: mtproto :: UserStatus > ( ) ? , } ) } } impl :: IntoBoxed for ContactStatus { type Boxed = :: mtproto :: ContactStatus ; fn into_boxed ( self ) -> :: mtproto :: ContactStatus { :: mtproto :: ContactStatus :: ContactStatus ( self ) } } } pub mod contacts { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `contacts.Blocked`\n\n```text\ncontacts.blocked#1c138d15 blocked:Vector<ContactBlocked> users:Vector<User> = contacts.Blocked;\n\ncontacts.blockedSlice#900802a1 count:int blocked:Vector<ContactBlocked> users:Vector<User> = contacts.Blocked;\n```\n" ] pub enum Blocked { Blocked ( :: mtproto :: contacts :: blocked :: Blocked ) , Slice ( :: mtproto :: contacts :: blocked :: Slice ) , } impl Blocked { pub fn blocked ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: ContactBlocked > { match self { & Blocked :: Slice ( ref x ) => & x . blocked , & Blocked :: Blocked ( ref x ) => & x . blocked , } } pub fn count ( & self ) -> Option < & :: mtproto :: int > { match self { & Blocked :: Slice ( ref x ) => Some ( & x . count ) , _ => None } } pub fn users ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > { match self { & Blocked :: Slice ( ref x ) => & x . users , & Blocked :: Blocked ( ref x ) => & x . users , } } } impl :: BoxedSerialize for Blocked { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Blocked :: Blocked ( ref x ) => ( :: ConstructorNumber ( 0x1c138d15 ) , x ) , & Blocked :: Slice ( ref x ) => ( :: ConstructorNumber ( 0x900802a1 ) , x ) , } } } impl :: BoxedDeserialize for Blocked { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x1c138d15 ) , :: ConstructorNumber ( 0x900802a1 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x1c138d15 ) => Ok ( Blocked :: Blocked ( _de . read_bare :: < :: mtproto :: contacts :: blocked :: Blocked > ( ) ? ) ) , :: ConstructorNumber ( 0x900802a1 ) => Ok ( Blocked :: Slice ( _de . read_bare :: < :: mtproto :: contacts :: blocked :: Slice > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `contacts.Contacts`\n\n```text\ncontacts.contactsNotModified#b74ba9d2 = contacts.Contacts;\n\ncontacts.contacts#eae87e42 contacts:Vector<Contact> saved_count:int users:Vector<User> = contacts.Contacts;\n```\n" ] pub enum Contacts { NotModified , Contacts ( :: mtproto :: contacts :: contacts :: Contacts ) , } impl Contacts { pub fn contacts ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Contact > > { match self { & Contacts :: Contacts ( ref x ) => Some ( & x . contacts ) , _ => None } } pub fn saved_count ( & self ) -> Option < & :: mtproto :: int > { match self { & Contacts :: Contacts ( ref x ) => Some ( & x . saved_count ) , _ => None } } pub fn users ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > { match self { & Contacts :: Contacts ( ref x ) => Some ( & x . users ) , _ => None } } } impl :: BoxedSerialize for Contacts { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Contacts :: NotModified => ( :: ConstructorNumber ( 0xb74ba9d2 ) , & ( ) ) , & Contacts :: Contacts ( ref x ) => ( :: ConstructorNumber ( 0xeae87e42 ) , x ) , } } } impl :: BoxedDeserialize for Contacts { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xb74ba9d2 ) , :: ConstructorNumber ( 0xeae87e42 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xb74ba9d2 ) => Ok ( Contacts :: NotModified ) , :: ConstructorNumber ( 0xeae87e42 ) => Ok ( Contacts :: Contacts ( _de . read_bare :: < :: mtproto :: contacts :: contacts :: Contacts > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } impl :: BoxedSerialize for Option < :: mtproto :: contacts :: contacts :: Contacts > { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match * self { None => ( :: ConstructorNumber ( 0xb74ba9d2 ) , & ( ) ) , Some ( ref x ) => ( :: ConstructorNumber ( 0xeae87e42 ) , x ) , } } } impl :: BoxedDeserialize for Option < :: mtproto :: contacts :: contacts :: Contacts > { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xb74ba9d2 ) , :: ConstructorNumber ( 0xeae87e42 ) ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xb74ba9d2 ) => Ok ( None ) , :: ConstructorNumber ( 0xeae87e42 ) => Ok ( Some ( _de . read_bare :: < :: mtproto :: contacts :: contacts :: Contacts > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `contacts.Found`\n\n```text\ncontacts.found#1aa1f784 results:Vector<Peer> chats:Vector<Chat> users:Vector<User> = contacts.Found;\n```\n" ] pub enum Found { Found ( :: mtproto :: contacts :: found :: Found ) , } impl Found { pub fn chats ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > { match self { & Found :: Found ( ref x ) => & x . chats , } } pub fn results ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Peer > { match self { & Found :: Found ( ref x ) => & x . results , } } pub fn users ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > { match self { & Found :: Found ( ref x ) => & x . users , } } } impl :: BoxedSerialize for Found { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Found :: Found ( ref x ) => ( :: ConstructorNumber ( 0x1aa1f784 ) , x ) , } } } impl :: BoxedDeserialize for Found { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x1aa1f784 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x1aa1f784 ) => Ok ( Found :: Found ( _de . read_bare :: < :: mtproto :: contacts :: found :: Found > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `contacts.ImportedContacts`\n\n```text\ncontacts.importedContacts#77d01c3b imported:Vector<ImportedContact> popular_invites:Vector<PopularContact> retry_contacts:Vector<long> users:Vector<User> = contacts.ImportedContacts;\n```\n" ] pub enum ImportedContacts { ImportedContacts ( :: mtproto :: contacts :: imported_contacts :: ImportedContacts ) , } impl ImportedContacts { pub fn imported ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: ImportedContact > { match self { & ImportedContacts :: ImportedContacts ( ref x ) => & x . imported , } } pub fn popular_invites ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PopularContact > { match self { & ImportedContacts :: ImportedContacts ( ref x ) => & x . popular_invites , } } pub fn retry_contacts ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > { match self { & ImportedContacts :: ImportedContacts ( ref x ) => & x . retry_contacts , } } pub fn users ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > { match self { & ImportedContacts :: ImportedContacts ( ref x ) => & x . users , } } } impl :: BoxedSerialize for ImportedContacts { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ImportedContacts :: ImportedContacts ( ref x ) => ( :: ConstructorNumber ( 0x77d01c3b ) , x ) , } } } impl :: BoxedDeserialize for ImportedContacts { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x77d01c3b ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x77d01c3b ) => Ok ( ImportedContacts :: ImportedContacts ( _de . read_bare :: < :: mtproto :: contacts :: imported_contacts :: ImportedContacts > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `contacts.Link`\n\n```text\ncontacts.link#3ace484c my_link:ContactLink foreign_link:ContactLink user:User = contacts.Link;\n```\n" ] pub enum Link { Link ( :: mtproto :: contacts :: link :: Link ) , } impl Link { pub fn foreign_link ( & self ) -> & :: mtproto :: ContactLink { match self { & Link :: Link ( ref x ) => & x . foreign_link , } } pub fn my_link ( & self ) -> & :: mtproto :: ContactLink { match self { & Link :: Link ( ref x ) => & x . my_link , } } pub fn user ( & self ) -> & :: mtproto :: User { match self { & Link :: Link ( ref x ) => & x . user , } } } impl :: BoxedSerialize for Link { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Link :: Link ( ref x ) => ( :: ConstructorNumber ( 0x3ace484c ) , x ) , } } } impl :: BoxedDeserialize for Link { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x3ace484c ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x3ace484c ) => Ok ( Link :: Link ( _de . read_bare :: < :: mtproto :: contacts :: link :: Link > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `contacts.ResolvedPeer`\n\n```text\ncontacts.resolvedPeer#7f077ad9 peer:Peer chats:Vector<Chat> users:Vector<User> = contacts.ResolvedPeer;\n```\n" ] pub enum ResolvedPeer { ResolvedPeer ( :: mtproto :: contacts :: resolved_peer :: ResolvedPeer ) , } impl ResolvedPeer { pub fn chats ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > { match self { & ResolvedPeer :: ResolvedPeer ( ref x ) => & x . chats , } } pub fn peer ( & self ) -> & :: mtproto :: Peer { match self { & ResolvedPeer :: ResolvedPeer ( ref x ) => & x . peer , } } pub fn users ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > { match self { & ResolvedPeer :: ResolvedPeer ( ref x ) => & x . users , } } } impl :: BoxedSerialize for ResolvedPeer { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ResolvedPeer :: ResolvedPeer ( ref x ) => ( :: ConstructorNumber ( 0x7f077ad9 ) , x ) , } } } impl :: BoxedDeserialize for ResolvedPeer { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x7f077ad9 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x7f077ad9 ) => Ok ( ResolvedPeer :: ResolvedPeer ( _de . read_bare :: < :: mtproto :: contacts :: resolved_peer :: ResolvedPeer > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `contacts.TopPeers`\n\n```text\ncontacts.topPeersNotModified#de266ef5 = contacts.TopPeers;\n\ncontacts.topPeers#70b772a8 categories:Vector<TopPeerCategoryPeers> chats:Vector<Chat> users:Vector<User> = contacts.TopPeers;\n```\n" ] pub enum TopPeers { NotModified , TopPeers ( :: mtproto :: contacts :: top_peers :: TopPeers ) , } impl TopPeers { pub fn categories ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: TopPeerCategoryPeers > > { match self { & TopPeers :: TopPeers ( ref x ) => Some ( & x . categories ) , _ => None } } pub fn chats ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > { match self { & TopPeers :: TopPeers ( ref x ) => Some ( & x . chats ) , _ => None } } pub fn users ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > { match self { & TopPeers :: TopPeers ( ref x ) => Some ( & x . users ) , _ => None } } } impl :: BoxedSerialize for TopPeers { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & TopPeers :: NotModified => ( :: ConstructorNumber ( 0xde266ef5 ) , & ( ) ) , & TopPeers :: TopPeers ( ref x ) => ( :: ConstructorNumber ( 0x70b772a8 ) , x ) , } } } impl :: BoxedDeserialize for TopPeers { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xde266ef5 ) , :: ConstructorNumber ( 0x70b772a8 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xde266ef5 ) => Ok ( TopPeers :: NotModified ) , :: ConstructorNumber ( 0x70b772a8 ) => Ok ( TopPeers :: TopPeers ( _de . read_bare :: < :: mtproto :: contacts :: top_peers :: TopPeers > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } impl :: BoxedSerialize for Option < :: mtproto :: contacts :: top_peers :: TopPeers > { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match * self { None => ( :: ConstructorNumber ( 0xde266ef5 ) , & ( ) ) , Some ( ref x ) => ( :: ConstructorNumber ( 0x70b772a8 ) , x ) , } } } impl :: BoxedDeserialize for Option < :: mtproto :: contacts :: top_peers :: TopPeers > { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xde266ef5 ) , :: ConstructorNumber ( 0x70b772a8 ) ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xde266ef5 ) => Ok ( None ) , :: ConstructorNumber ( 0x70b772a8 ) => Ok ( Some ( _de . read_bare :: < :: mtproto :: contacts :: top_peers :: TopPeers > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } pub mod blocked { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `contacts.blocked`\n\n```text\ncontacts.blocked#1c138d15 blocked:Vector<ContactBlocked> users:Vector<User> = contacts.Blocked;\n```\n" ] pub struct Blocked { pub blocked : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: ContactBlocked > , pub users : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > , } impl :: BareSerialize for Blocked { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Blocked { ref blocked , ref users } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: ContactBlocked > > ( blocked ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( users ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Blocked { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Blocked { blocked : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: ContactBlocked > > ( ) ? , users : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( ) ? , } ) } } impl :: IntoBoxed for Blocked { type Boxed = :: mtproto :: contacts :: Blocked ; fn into_boxed ( self ) -> :: mtproto :: contacts :: Blocked { :: mtproto :: contacts :: Blocked :: Blocked ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `contacts.blockedSlice`\n\n```text\ncontacts.blockedSlice#900802a1 count:int blocked:Vector<ContactBlocked> users:Vector<User> = contacts.Blocked;\n```\n" ] pub struct Slice { pub count : :: mtproto :: int , pub blocked : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: ContactBlocked > , pub users : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > , } impl :: BareSerialize for Slice { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Slice { ref count , ref blocked , ref users } = self ; _ser . write_bare :: < :: mtproto :: int > ( count ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: ContactBlocked > > ( blocked ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( users ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Slice { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Slice { count : _de . read_bare :: < :: mtproto :: int > ( ) ? , blocked : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: ContactBlocked > > ( ) ? , users : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( ) ? , } ) } } impl :: IntoBoxed for Slice { type Boxed = :: mtproto :: contacts :: Blocked ; fn into_boxed ( self ) -> :: mtproto :: contacts :: Blocked { :: mtproto :: contacts :: Blocked :: Slice ( self ) } } } pub mod contacts { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `contacts.contacts`\n\n```text\ncontacts.contacts#eae87e42 contacts:Vector<Contact> saved_count:int users:Vector<User> = contacts.Contacts;\n```\n" ] pub struct Contacts { pub contacts : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Contact > , pub saved_count : :: mtproto :: int , pub users : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > , } impl :: BareSerialize for Contacts { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Contacts { ref contacts , ref saved_count , ref users } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Contact > > ( contacts ) ? ; _ser . write_bare :: < :: mtproto :: int > ( saved_count ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( users ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Contacts { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Contacts { contacts : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Contact > > ( ) ? , saved_count : _de . read_bare :: < :: mtproto :: int > ( ) ? , users : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( ) ? , } ) } } impl :: IntoBoxed for Contacts { type Boxed = :: mtproto :: contacts :: Contacts ; fn into_boxed ( self ) -> :: mtproto :: contacts :: Contacts { :: mtproto :: contacts :: Contacts :: Contacts ( self ) } } } pub mod found { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `contacts.found`\n\n```text\ncontacts.found#1aa1f784 results:Vector<Peer> chats:Vector<Chat> users:Vector<User> = contacts.Found;\n```\n" ] pub struct Found { pub results : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Peer > , pub chats : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > , pub users : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > , } impl :: BareSerialize for Found { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Found { ref results , ref chats , ref users } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Peer > > ( results ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > ( chats ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( users ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Found { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Found { results : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Peer > > ( ) ? , chats : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > ( ) ? , users : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( ) ? , } ) } } impl :: IntoBoxed for Found { type Boxed = :: mtproto :: contacts :: Found ; fn into_boxed ( self ) -> :: mtproto :: contacts :: Found { :: mtproto :: contacts :: Found :: Found ( self ) } } } pub mod imported_contacts { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `contacts.importedContacts`\n\n```text\ncontacts.importedContacts#77d01c3b imported:Vector<ImportedContact> popular_invites:Vector<PopularContact> retry_contacts:Vector<long> users:Vector<User> = contacts.ImportedContacts;\n```\n" ] pub struct ImportedContacts { pub imported : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: ImportedContact > , pub popular_invites : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PopularContact > , pub retry_contacts : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > , pub users : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > , } impl :: BareSerialize for ImportedContacts { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ImportedContacts { ref imported , ref popular_invites , ref retry_contacts , ref users } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: ImportedContact > > ( imported ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PopularContact > > ( popular_invites ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > > ( retry_contacts ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( users ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ImportedContacts { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ImportedContacts { imported : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: ImportedContact > > ( ) ? , popular_invites : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PopularContact > > ( ) ? , retry_contacts : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > > ( ) ? , users : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( ) ? , } ) } } impl :: IntoBoxed for ImportedContacts { type Boxed = :: mtproto :: contacts :: ImportedContacts ; fn into_boxed ( self ) -> :: mtproto :: contacts :: ImportedContacts { :: mtproto :: contacts :: ImportedContacts :: ImportedContacts ( self ) } } } pub mod link { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `contacts.link`\n\n```text\ncontacts.link#3ace484c my_link:ContactLink foreign_link:ContactLink user:User = contacts.Link;\n```\n" ] pub struct Link { pub my_link : :: mtproto :: ContactLink , pub foreign_link : :: mtproto :: ContactLink , pub user : :: mtproto :: User , } impl :: BareSerialize for Link { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Link { ref my_link , ref foreign_link , ref user } = self ; _ser . write_boxed :: < :: mtproto :: ContactLink > ( my_link ) ? ; _ser . write_boxed :: < :: mtproto :: ContactLink > ( foreign_link ) ? ; _ser . write_boxed :: < :: mtproto :: User > ( user ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Link { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Link { my_link : _de . read_boxed :: < :: mtproto :: ContactLink > ( ) ? , foreign_link : _de . read_boxed :: < :: mtproto :: ContactLink > ( ) ? , user : _de . read_boxed :: < :: mtproto :: User > ( ) ? , } ) } } impl :: IntoBoxed for Link { type Boxed = :: mtproto :: contacts :: Link ; fn into_boxed ( self ) -> :: mtproto :: contacts :: Link { :: mtproto :: contacts :: Link :: Link ( self ) } } } pub mod resolved_peer { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `contacts.resolvedPeer`\n\n```text\ncontacts.resolvedPeer#7f077ad9 peer:Peer chats:Vector<Chat> users:Vector<User> = contacts.ResolvedPeer;\n```\n" ] pub struct ResolvedPeer { pub peer : :: mtproto :: Peer , pub chats : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > , pub users : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > , } impl :: BareSerialize for ResolvedPeer { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ResolvedPeer { ref peer , ref chats , ref users } = self ; _ser . write_boxed :: < :: mtproto :: Peer > ( peer ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > ( chats ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( users ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ResolvedPeer { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ResolvedPeer { peer : _de . read_boxed :: < :: mtproto :: Peer > ( ) ? , chats : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > ( ) ? , users : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( ) ? , } ) } } impl :: IntoBoxed for ResolvedPeer { type Boxed = :: mtproto :: contacts :: ResolvedPeer ; fn into_boxed ( self ) -> :: mtproto :: contacts :: ResolvedPeer { :: mtproto :: contacts :: ResolvedPeer :: ResolvedPeer ( self ) } } } pub mod top_peers { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `contacts.topPeers`\n\n```text\ncontacts.topPeers#70b772a8 categories:Vector<TopPeerCategoryPeers> chats:Vector<Chat> users:Vector<User> = contacts.TopPeers;\n```\n" ] pub struct TopPeers { pub categories : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: TopPeerCategoryPeers > , pub chats : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > , pub users : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > , } impl :: BareSerialize for TopPeers { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & TopPeers { ref categories , ref chats , ref users } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: TopPeerCategoryPeers > > ( categories ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > ( chats ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( users ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for TopPeers { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( TopPeers { categories : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: TopPeerCategoryPeers > > ( ) ? , chats : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > ( ) ? , users : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( ) ? , } ) } } impl :: IntoBoxed for TopPeers { type Boxed = :: mtproto :: contacts :: TopPeers ; fn into_boxed ( self ) -> :: mtproto :: contacts :: TopPeers { :: mtproto :: contacts :: TopPeers :: TopPeers ( self ) } } } } pub mod data_json { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `dataJSON`\n\n```text\ndataJSON#7d748d04 data:string = DataJSON;\n```\n" ] pub struct DataJSON { pub data : :: mtproto :: string , } impl :: BareSerialize for DataJSON { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & DataJSON { ref data } = self ; _ser . write_bare :: < :: mtproto :: string > ( data ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for DataJSON { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( DataJSON { data : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for DataJSON { type Boxed = :: mtproto :: DataJSON ; fn into_boxed ( self ) -> :: mtproto :: DataJSON { :: mtproto :: DataJSON :: DataJSON ( self ) } } } pub mod dc_option { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `dcOption`\n\n```text\ndcOption#5d8c6cc flags:# ipv6:flags.0?true media_only:flags.1?true tcpo_only:flags.2?true cdn:flags.3?true static:flags.4?true id:int ip_address:string port:int = DcOption;\n```\n" ] pub struct DcOption { pub ipv6 : bool , pub media_only : bool , pub tcpo_only : bool , pub cdn : bool , pub static_ : bool , pub id : :: mtproto :: int , pub ip_address : :: mtproto :: string , pub port : :: mtproto :: int , } impl :: BareSerialize for DcOption { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & DcOption { ipv6 , media_only , tcpo_only , cdn , static_ , ref id , ref ip_address , ref port } = self ; let mut _flags = 0i32 ; if ipv6 { _flags |= 1 << 0u32 ; } if media_only { _flags |= 1 << 1u32 ; } if tcpo_only { _flags |= 1 << 2u32 ; } if cdn { _flags |= 1 << 3u32 ; } if static_ { _flags |= 1 << 4u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: int > ( id ) ? ; _ser . write_bare :: < :: mtproto :: string > ( ip_address ) ? ; _ser . write_bare :: < :: mtproto :: int > ( port ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for DcOption { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( DcOption { ipv6 : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 0u32 ) != 0 } , media_only : _flags & ( 1 << 1u32 ) != 0 , tcpo_only : _flags & ( 1 << 2u32 ) != 0 , cdn : _flags & ( 1 << 3u32 ) != 0 , static_ : _flags & ( 1 << 4u32 ) != 0 , id : _de . read_bare :: < :: mtproto :: int > ( ) ? , ip_address : _de . read_bare :: < :: mtproto :: string > ( ) ? , port : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for DcOption { type Boxed = :: mtproto :: DcOption ; fn into_boxed ( self ) -> :: mtproto :: DcOption { :: mtproto :: DcOption :: DcOption ( self ) } } } pub mod destroy_auth_key { } pub mod destroy_session { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `destroy_session_none`\n\n```text\ndestroy_session_none#62d350c9 session_id:long = DestroySessionRes;\n```\n" ] pub struct None { pub session_id : :: mtproto :: long , } impl :: BareSerialize for None { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & None { ref session_id } = self ; _ser . write_bare :: < :: mtproto :: long > ( session_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for None { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( None { session_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for None { type Boxed = :: mtproto :: DestroySessionRes ; fn into_boxed ( self ) -> :: mtproto :: DestroySessionRes { :: mtproto :: DestroySessionRes :: None ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `destroy_session_ok`\n\n```text\ndestroy_session_ok#e22045fc session_id:long = DestroySessionRes;\n```\n" ] pub struct Ok { pub session_id : :: mtproto :: long , } impl :: BareSerialize for Ok { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Ok { ref session_id } = self ; _ser . write_bare :: < :: mtproto :: long > ( session_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Ok { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Ok { session_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for Ok { type Boxed = :: mtproto :: DestroySessionRes ; fn into_boxed ( self ) -> :: mtproto :: DestroySessionRes { :: mtproto :: DestroySessionRes :: Ok ( self ) } } } pub mod dh_gen { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `dh_gen_fail`\n\n```text\ndh_gen_fail#a69dae02 nonce:int128 server_nonce:int128 new_nonce_hash3:int128 = Set_client_DH_params_answer;\n```\n" ] pub struct Fail { pub nonce : :: mtproto :: int128 , pub server_nonce : :: mtproto :: int128 , pub new_nonce_hash3 : :: mtproto :: int128 , } impl :: BareSerialize for Fail { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Fail { ref nonce , ref server_nonce , ref new_nonce_hash3 } = self ; _ser . write_bare :: < :: mtproto :: int128 > ( nonce ) ? ; _ser . write_bare :: < :: mtproto :: int128 > ( server_nonce ) ? ; _ser . write_bare :: < :: mtproto :: int128 > ( new_nonce_hash3 ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Fail { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Fail { nonce : _de . read_bare :: < :: mtproto :: int128 > ( ) ? , server_nonce : _de . read_bare :: < :: mtproto :: int128 > ( ) ? , new_nonce_hash3 : _de . read_bare :: < :: mtproto :: int128 > ( ) ? , } ) } } impl :: IntoBoxed for Fail { type Boxed = :: mtproto :: SetClientDHParamsAnswer ; fn into_boxed ( self ) -> :: mtproto :: SetClientDHParamsAnswer { :: mtproto :: SetClientDHParamsAnswer :: Fail ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `dh_gen_ok`\n\n```text\ndh_gen_ok#3bcbf734 nonce:int128 server_nonce:int128 new_nonce_hash1:int128 = Set_client_DH_params_answer;\n```\n" ] pub struct Ok { pub nonce : :: mtproto :: int128 , pub server_nonce : :: mtproto :: int128 , pub new_nonce_hash1 : :: mtproto :: int128 , } impl :: BareSerialize for Ok { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Ok { ref nonce , ref server_nonce , ref new_nonce_hash1 } = self ; _ser . write_bare :: < :: mtproto :: int128 > ( nonce ) ? ; _ser . write_bare :: < :: mtproto :: int128 > ( server_nonce ) ? ; _ser . write_bare :: < :: mtproto :: int128 > ( new_nonce_hash1 ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Ok { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Ok { nonce : _de . read_bare :: < :: mtproto :: int128 > ( ) ? , server_nonce : _de . read_bare :: < :: mtproto :: int128 > ( ) ? , new_nonce_hash1 : _de . read_bare :: < :: mtproto :: int128 > ( ) ? , } ) } } impl :: IntoBoxed for Ok { type Boxed = :: mtproto :: SetClientDHParamsAnswer ; fn into_boxed ( self ) -> :: mtproto :: SetClientDHParamsAnswer { :: mtproto :: SetClientDHParamsAnswer :: Ok ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `dh_gen_retry`\n\n```text\ndh_gen_retry#46dc1fb9 nonce:int128 server_nonce:int128 new_nonce_hash2:int128 = Set_client_DH_params_answer;\n```\n" ] pub struct Retry { pub nonce : :: mtproto :: int128 , pub server_nonce : :: mtproto :: int128 , pub new_nonce_hash2 : :: mtproto :: int128 , } impl :: BareSerialize for Retry { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Retry { ref nonce , ref server_nonce , ref new_nonce_hash2 } = self ; _ser . write_bare :: < :: mtproto :: int128 > ( nonce ) ? ; _ser . write_bare :: < :: mtproto :: int128 > ( server_nonce ) ? ; _ser . write_bare :: < :: mtproto :: int128 > ( new_nonce_hash2 ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Retry { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Retry { nonce : _de . read_bare :: < :: mtproto :: int128 > ( ) ? , server_nonce : _de . read_bare :: < :: mtproto :: int128 > ( ) ? , new_nonce_hash2 : _de . read_bare :: < :: mtproto :: int128 > ( ) ? , } ) } } impl :: IntoBoxed for Retry { type Boxed = :: mtproto :: SetClientDHParamsAnswer ; fn into_boxed ( self ) -> :: mtproto :: SetClientDHParamsAnswer { :: mtproto :: SetClientDHParamsAnswer :: Retry ( self ) } } } pub mod dialog { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `dialog`\n\n```text\ndialog#e4def5db flags:# pinned:flags.2?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage = Dialog;\n```\n" ] pub struct Dialog { pub pinned : bool , pub peer : :: mtproto :: Peer , pub top_message : :: mtproto :: int , pub read_inbox_max_id : :: mtproto :: int , pub read_outbox_max_id : :: mtproto :: int , pub unread_count : :: mtproto :: int , pub unread_mentions_count : :: mtproto :: int , pub notify_settings : :: mtproto :: PeerNotifySettings , pub pts : Option < :: mtproto :: int > , pub draft : Option < :: mtproto :: DraftMessage > , } impl :: BareSerialize for Dialog { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Dialog { pinned , ref peer , ref top_message , ref read_inbox_max_id , ref read_outbox_max_id , ref unread_count , ref unread_mentions_count , ref notify_settings , ref pts , ref draft } = self ; let mut _flags = 0i32 ; if pinned { _flags |= 1 << 2u32 ; } if pts . is_some ( ) { _flags |= 1 << 0u32 ; } if draft . is_some ( ) { _flags |= 1 << 1u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_boxed :: < :: mtproto :: Peer > ( peer ) ? ; _ser . write_bare :: < :: mtproto :: int > ( top_message ) ? ; _ser . write_bare :: < :: mtproto :: int > ( read_inbox_max_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( read_outbox_max_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( unread_count ) ? ; _ser . write_bare :: < :: mtproto :: int > ( unread_mentions_count ) ? ; _ser . write_boxed :: < :: mtproto :: PeerNotifySettings > ( notify_settings ) ? ; if let & Some ( ref inner ) = pts { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } if let & Some ( ref inner ) = draft { _ser . write_boxed :: < :: mtproto :: DraftMessage > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for Dialog { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( Dialog { pinned : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 2u32 ) != 0 } , peer : _de . read_boxed :: < :: mtproto :: Peer > ( ) ? , top_message : _de . read_bare :: < :: mtproto :: int > ( ) ? , read_inbox_max_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , read_outbox_max_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , unread_count : _de . read_bare :: < :: mtproto :: int > ( ) ? , unread_mentions_count : _de . read_bare :: < :: mtproto :: int > ( ) ? , notify_settings : _de . read_boxed :: < :: mtproto :: PeerNotifySettings > ( ) ? , pts : if _flags & ( 1 << 0u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , draft : if _flags & ( 1 << 1u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: DraftMessage > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for Dialog { type Boxed = :: mtproto :: Dialog ; fn into_boxed ( self ) -> :: mtproto :: Dialog { :: mtproto :: Dialog :: Dialog ( self ) } } } pub mod disabled_feature { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `disabledFeature`\n\n```text\ndisabledFeature#ae636f24 feature:string description:string = DisabledFeature;\n```\n" ] pub struct DisabledFeature { pub feature : :: mtproto :: string , pub description : :: mtproto :: string , } impl :: BareSerialize for DisabledFeature { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & DisabledFeature { ref feature , ref description } = self ; _ser . write_bare :: < :: mtproto :: string > ( feature ) ? ; _ser . write_bare :: < :: mtproto :: string > ( description ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for DisabledFeature { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( DisabledFeature { feature : _de . read_bare :: < :: mtproto :: string > ( ) ? , description : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for DisabledFeature { type Boxed = :: mtproto :: DisabledFeature ; fn into_boxed ( self ) -> :: mtproto :: DisabledFeature { :: mtproto :: DisabledFeature :: DisabledFeature ( self ) } } } pub mod document { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `document`\n\n```text\ndocument#87232bc7 id:long access_hash:long date:int mime_type:string size:int thumb:PhotoSize dc_id:int version:int attributes:Vector<DocumentAttribute> = Document;\n```\n" ] pub struct Document { pub id : :: mtproto :: long , pub access_hash : :: mtproto :: long , pub date : :: mtproto :: int , pub mime_type : :: mtproto :: string , pub size : :: mtproto :: int , pub thumb : :: mtproto :: PhotoSize , pub dc_id : :: mtproto :: int , pub version : :: mtproto :: int , pub attributes : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: DocumentAttribute > , } impl :: BareSerialize for Document { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Document { ref id , ref access_hash , ref date , ref mime_type , ref size , ref thumb , ref dc_id , ref version , ref attributes } = self ; _ser . write_bare :: < :: mtproto :: long > ( id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( access_hash ) ? ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; _ser . write_bare :: < :: mtproto :: string > ( mime_type ) ? ; _ser . write_bare :: < :: mtproto :: int > ( size ) ? ; _ser . write_boxed :: < :: mtproto :: PhotoSize > ( thumb ) ? ; _ser . write_bare :: < :: mtproto :: int > ( dc_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( version ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: DocumentAttribute > > ( attributes ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Document { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Document { id : _de . read_bare :: < :: mtproto :: long > ( ) ? , access_hash : _de . read_bare :: < :: mtproto :: long > ( ) ? , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , mime_type : _de . read_bare :: < :: mtproto :: string > ( ) ? , size : _de . read_bare :: < :: mtproto :: int > ( ) ? , thumb : _de . read_boxed :: < :: mtproto :: PhotoSize > ( ) ? , dc_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , version : _de . read_bare :: < :: mtproto :: int > ( ) ? , attributes : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: DocumentAttribute > > ( ) ? , } ) } } impl :: IntoBoxed for Document { type Boxed = :: mtproto :: Document ; fn into_boxed ( self ) -> :: mtproto :: Document { :: mtproto :: Document :: Document ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `documentEmpty`\n\n```text\ndocumentEmpty#36f8c871 id:long = Document;\n```\n" ] pub struct Empty { pub id : :: mtproto :: long , } impl :: BareSerialize for Empty { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Empty { ref id } = self ; _ser . write_bare :: < :: mtproto :: long > ( id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Empty { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Empty { id : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for Empty { type Boxed = :: mtproto :: Document ; fn into_boxed ( self ) -> :: mtproto :: Document { :: mtproto :: Document :: Empty ( self ) } } } pub mod document_attribute { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `documentAttributeAudio`\n\n```text\ndocumentAttributeAudio#9852f9c6 flags:# voice:flags.10?true duration:int title:flags.0?string performer:flags.1?string waveform:flags.2?bytes = DocumentAttribute;\n```\n" ] pub struct Audio { pub voice : bool , pub duration : :: mtproto :: int , pub title : Option < :: mtproto :: string > , pub performer : Option < :: mtproto :: string > , pub waveform : Option < :: mtproto :: bytes > , } impl :: BareSerialize for Audio { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Audio { voice , ref duration , ref title , ref performer , ref waveform } = self ; let mut _flags = 0i32 ; if voice { _flags |= 1 << 10u32 ; } if title . is_some ( ) { _flags |= 1 << 0u32 ; } if performer . is_some ( ) { _flags |= 1 << 1u32 ; } if waveform . is_some ( ) { _flags |= 1 << 2u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: int > ( duration ) ? ; if let & Some ( ref inner ) = title { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = performer { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = waveform { _ser . write_bare :: < :: mtproto :: bytes > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for Audio { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( Audio { voice : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 10u32 ) != 0 } , duration : _de . read_bare :: < :: mtproto :: int > ( ) ? , title : if _flags & ( 1 << 0u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , performer : if _flags & ( 1 << 1u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , waveform : if _flags & ( 1 << 2u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: bytes > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for Audio { type Boxed = :: mtproto :: DocumentAttribute ; fn into_boxed ( self ) -> :: mtproto :: DocumentAttribute { :: mtproto :: DocumentAttribute :: Audio ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `documentAttributeFilename`\n\n```text\ndocumentAttributeFilename#15590068 file_name:string = DocumentAttribute;\n```\n" ] pub struct Filename { pub file_name : :: mtproto :: string , } impl :: BareSerialize for Filename { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Filename { ref file_name } = self ; _ser . write_bare :: < :: mtproto :: string > ( file_name ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Filename { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Filename { file_name : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for Filename { type Boxed = :: mtproto :: DocumentAttribute ; fn into_boxed ( self ) -> :: mtproto :: DocumentAttribute { :: mtproto :: DocumentAttribute :: Filename ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `documentAttributeImageSize`\n\n```text\ndocumentAttributeImageSize#6c37c15c w:int h:int = DocumentAttribute;\n```\n" ] pub struct ImageSize { pub w : :: mtproto :: int , pub h : :: mtproto :: int , } impl :: BareSerialize for ImageSize { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ImageSize { ref w , ref h } = self ; _ser . write_bare :: < :: mtproto :: int > ( w ) ? ; _ser . write_bare :: < :: mtproto :: int > ( h ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ImageSize { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ImageSize { w : _de . read_bare :: < :: mtproto :: int > ( ) ? , h : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for ImageSize { type Boxed = :: mtproto :: DocumentAttribute ; fn into_boxed ( self ) -> :: mtproto :: DocumentAttribute { :: mtproto :: DocumentAttribute :: ImageSize ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `documentAttributeSticker`\n\n```text\ndocumentAttributeSticker#6319d612 flags:# mask:flags.1?true alt:string stickerset:InputStickerSet mask_coords:flags.0?MaskCoords = DocumentAttribute;\n```\n" ] pub struct Sticker { pub mask : bool , pub alt : :: mtproto :: string , pub stickerset : :: mtproto :: InputStickerSet , pub mask_coords : Option < :: mtproto :: MaskCoords > , } impl :: BareSerialize for Sticker { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Sticker { mask , ref alt , ref stickerset , ref mask_coords } = self ; let mut _flags = 0i32 ; if mask { _flags |= 1 << 1u32 ; } if mask_coords . is_some ( ) { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: string > ( alt ) ? ; _ser . write_boxed :: < :: mtproto :: InputStickerSet > ( stickerset ) ? ; if let & Some ( ref inner ) = mask_coords { _ser . write_boxed :: < :: mtproto :: MaskCoords > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for Sticker { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( Sticker { mask : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 1u32 ) != 0 } , alt : _de . read_bare :: < :: mtproto :: string > ( ) ? , stickerset : _de . read_boxed :: < :: mtproto :: InputStickerSet > ( ) ? , mask_coords : if _flags & ( 1 << 0u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: MaskCoords > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for Sticker { type Boxed = :: mtproto :: DocumentAttribute ; fn into_boxed ( self ) -> :: mtproto :: DocumentAttribute { :: mtproto :: DocumentAttribute :: Sticker ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `documentAttributeVideo`\n\n```text\ndocumentAttributeVideo#ef02ce6 flags:# round_message:flags.0?true duration:int w:int h:int = DocumentAttribute;\n```\n" ] pub struct Video { pub round_message : bool , pub duration : :: mtproto :: int , pub w : :: mtproto :: int , pub h : :: mtproto :: int , } impl :: BareSerialize for Video { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Video { round_message , ref duration , ref w , ref h } = self ; let mut _flags = 0i32 ; if round_message { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: int > ( duration ) ? ; _ser . write_bare :: < :: mtproto :: int > ( w ) ? ; _ser . write_bare :: < :: mtproto :: int > ( h ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Video { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( Video { round_message : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 0u32 ) != 0 } , duration : _de . read_bare :: < :: mtproto :: int > ( ) ? , w : _de . read_bare :: < :: mtproto :: int > ( ) ? , h : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for Video { type Boxed = :: mtproto :: DocumentAttribute ; fn into_boxed ( self ) -> :: mtproto :: DocumentAttribute { :: mtproto :: DocumentAttribute :: Video ( self ) } } } pub mod draft_message { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `draftMessage`\n\n```text\ndraftMessage#fd8e711f flags:# no_webpage:flags.1?true reply_to_msg_id:flags.0?int message:string entities:flags.3?Vector<MessageEntity> date:int = DraftMessage;\n```\n" ] pub struct DraftMessage { pub no_webpage : bool , pub reply_to_msg_id : Option < :: mtproto :: int > , pub message : :: mtproto :: string , pub entities : Option < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: MessageEntity > > , pub date : :: mtproto :: int , } impl :: BareSerialize for DraftMessage { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & DraftMessage { no_webpage , ref reply_to_msg_id , ref message , ref entities , ref date } = self ; let mut _flags = 0i32 ; if no_webpage { _flags |= 1 << 1u32 ; } if reply_to_msg_id . is_some ( ) { _flags |= 1 << 0u32 ; } if entities . is_some ( ) { _flags |= 1 << 3u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; if let & Some ( ref inner ) = reply_to_msg_id { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } _ser . write_bare :: < :: mtproto :: string > ( message ) ? ; if let & Some ( ref inner ) = entities { _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: MessageEntity > > ( inner ) ? ; } _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for DraftMessage { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( DraftMessage { no_webpage : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 1u32 ) != 0 } , reply_to_msg_id : if _flags & ( 1 << 0u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , message : _de . read_bare :: < :: mtproto :: string > ( ) ? , entities : if _flags & ( 1 << 3u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: MessageEntity > > ( ) ? ) } else { None } , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for DraftMessage { type Boxed = :: mtproto :: DraftMessage ; fn into_boxed ( self ) -> :: mtproto :: DraftMessage { :: mtproto :: DraftMessage :: DraftMessage ( self ) } } } pub mod encrypted_chat { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `encryptedChatDiscarded`\n\n```text\nencryptedChatDiscarded#13d6dd27 id:int = EncryptedChat;\n```\n" ] pub struct Discarded { pub id : :: mtproto :: int , } impl :: BareSerialize for Discarded { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Discarded { ref id } = self ; _ser . write_bare :: < :: mtproto :: int > ( id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Discarded { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Discarded { id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for Discarded { type Boxed = :: mtproto :: EncryptedChat ; fn into_boxed ( self ) -> :: mtproto :: EncryptedChat { :: mtproto :: EncryptedChat :: Discarded ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `encryptedChatEmpty`\n\n```text\nencryptedChatEmpty#ab7ec0a0 id:int = EncryptedChat;\n```\n" ] pub struct Empty { pub id : :: mtproto :: int , } impl :: BareSerialize for Empty { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Empty { ref id } = self ; _ser . write_bare :: < :: mtproto :: int > ( id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Empty { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Empty { id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for Empty { type Boxed = :: mtproto :: EncryptedChat ; fn into_boxed ( self ) -> :: mtproto :: EncryptedChat { :: mtproto :: EncryptedChat :: Empty ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `encryptedChat`\n\n```text\nencryptedChat#fa56ce36 id:int access_hash:long date:int admin_id:int participant_id:int g_a_or_b:bytes key_fingerprint:long = EncryptedChat;\n```\n" ] pub struct EncryptedChat { pub id : :: mtproto :: int , pub access_hash : :: mtproto :: long , pub date : :: mtproto :: int , pub admin_id : :: mtproto :: int , pub participant_id : :: mtproto :: int , pub g_a_or_b : :: mtproto :: bytes , pub key_fingerprint : :: mtproto :: long , } impl :: BareSerialize for EncryptedChat { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & EncryptedChat { ref id , ref access_hash , ref date , ref admin_id , ref participant_id , ref g_a_or_b , ref key_fingerprint } = self ; _ser . write_bare :: < :: mtproto :: int > ( id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( access_hash ) ? ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; _ser . write_bare :: < :: mtproto :: int > ( admin_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( participant_id ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( g_a_or_b ) ? ; _ser . write_bare :: < :: mtproto :: long > ( key_fingerprint ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for EncryptedChat { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( EncryptedChat { id : _de . read_bare :: < :: mtproto :: int > ( ) ? , access_hash : _de . read_bare :: < :: mtproto :: long > ( ) ? , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , admin_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , participant_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , g_a_or_b : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , key_fingerprint : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for EncryptedChat { type Boxed = :: mtproto :: EncryptedChat ; fn into_boxed ( self ) -> :: mtproto :: EncryptedChat { :: mtproto :: EncryptedChat :: EncryptedChat ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `encryptedChatRequested`\n\n```text\nencryptedChatRequested#c878527e id:int access_hash:long date:int admin_id:int participant_id:int g_a:bytes = EncryptedChat;\n```\n" ] pub struct Requested { pub id : :: mtproto :: int , pub access_hash : :: mtproto :: long , pub date : :: mtproto :: int , pub admin_id : :: mtproto :: int , pub participant_id : :: mtproto :: int , pub g_a : :: mtproto :: bytes , } impl :: BareSerialize for Requested { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Requested { ref id , ref access_hash , ref date , ref admin_id , ref participant_id , ref g_a } = self ; _ser . write_bare :: < :: mtproto :: int > ( id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( access_hash ) ? ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; _ser . write_bare :: < :: mtproto :: int > ( admin_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( participant_id ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( g_a ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Requested { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Requested { id : _de . read_bare :: < :: mtproto :: int > ( ) ? , access_hash : _de . read_bare :: < :: mtproto :: long > ( ) ? , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , admin_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , participant_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , g_a : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , } ) } } impl :: IntoBoxed for Requested { type Boxed = :: mtproto :: EncryptedChat ; fn into_boxed ( self ) -> :: mtproto :: EncryptedChat { :: mtproto :: EncryptedChat :: Requested ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `encryptedChatWaiting`\n\n```text\nencryptedChatWaiting#3bf703dc id:int access_hash:long date:int admin_id:int participant_id:int = EncryptedChat;\n```\n" ] pub struct Waiting { pub id : :: mtproto :: int , pub access_hash : :: mtproto :: long , pub date : :: mtproto :: int , pub admin_id : :: mtproto :: int , pub participant_id : :: mtproto :: int , } impl :: BareSerialize for Waiting { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Waiting { ref id , ref access_hash , ref date , ref admin_id , ref participant_id } = self ; _ser . write_bare :: < :: mtproto :: int > ( id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( access_hash ) ? ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; _ser . write_bare :: < :: mtproto :: int > ( admin_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( participant_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Waiting { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Waiting { id : _de . read_bare :: < :: mtproto :: int > ( ) ? , access_hash : _de . read_bare :: < :: mtproto :: long > ( ) ? , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , admin_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , participant_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for Waiting { type Boxed = :: mtproto :: EncryptedChat ; fn into_boxed ( self ) -> :: mtproto :: EncryptedChat { :: mtproto :: EncryptedChat :: Waiting ( self ) } } } pub mod encrypted_file { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `encryptedFile`\n\n```text\nencryptedFile#4a70994c id:long access_hash:long size:int dc_id:int key_fingerprint:int = EncryptedFile;\n```\n" ] pub struct EncryptedFile { pub id : :: mtproto :: long , pub access_hash : :: mtproto :: long , pub size : :: mtproto :: int , pub dc_id : :: mtproto :: int , pub key_fingerprint : :: mtproto :: int , } impl :: BareSerialize for EncryptedFile { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & EncryptedFile { ref id , ref access_hash , ref size , ref dc_id , ref key_fingerprint } = self ; _ser . write_bare :: < :: mtproto :: long > ( id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( access_hash ) ? ; _ser . write_bare :: < :: mtproto :: int > ( size ) ? ; _ser . write_bare :: < :: mtproto :: int > ( dc_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( key_fingerprint ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for EncryptedFile { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( EncryptedFile { id : _de . read_bare :: < :: mtproto :: long > ( ) ? , access_hash : _de . read_bare :: < :: mtproto :: long > ( ) ? , size : _de . read_bare :: < :: mtproto :: int > ( ) ? , dc_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , key_fingerprint : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for EncryptedFile { type Boxed = :: mtproto :: EncryptedFile ; fn into_boxed ( self ) -> :: mtproto :: EncryptedFile { :: mtproto :: EncryptedFile :: EncryptedFile ( self ) } } } pub mod encrypted_message { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `encryptedMessage`\n\n```text\nencryptedMessage#ed18c118 random_id:long chat_id:int date:int bytes:bytes file:EncryptedFile = EncryptedMessage;\n```\n" ] pub struct EncryptedMessage { pub random_id : :: mtproto :: long , pub chat_id : :: mtproto :: int , pub date : :: mtproto :: int , pub bytes : :: mtproto :: bytes , pub file : :: mtproto :: EncryptedFile , } impl :: BareSerialize for EncryptedMessage { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & EncryptedMessage { ref random_id , ref chat_id , ref date , bytes : ref bytes_ , ref file } = self ; _ser . write_bare :: < :: mtproto :: long > ( random_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( chat_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( bytes_ ) ? ; _ser . write_boxed :: < :: mtproto :: EncryptedFile > ( file ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for EncryptedMessage { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( EncryptedMessage { random_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , chat_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , bytes : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , file : _de . read_boxed :: < :: mtproto :: EncryptedFile > ( ) ? , } ) } } impl :: IntoBoxed for EncryptedMessage { type Boxed = :: mtproto :: EncryptedMessage ; fn into_boxed ( self ) -> :: mtproto :: EncryptedMessage { :: mtproto :: EncryptedMessage :: EncryptedMessage ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `encryptedMessageService`\n\n```text\nencryptedMessageService#23734b06 random_id:long chat_id:int date:int bytes:bytes = EncryptedMessage;\n```\n" ] pub struct Service { pub random_id : :: mtproto :: long , pub chat_id : :: mtproto :: int , pub date : :: mtproto :: int , pub bytes : :: mtproto :: bytes , } impl :: BareSerialize for Service { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Service { ref random_id , ref chat_id , ref date , bytes : ref bytes_ } = self ; _ser . write_bare :: < :: mtproto :: long > ( random_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( chat_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( bytes_ ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Service { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Service { random_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , chat_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , bytes : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , } ) } } impl :: IntoBoxed for Service { type Boxed = :: mtproto :: EncryptedMessage ; fn into_boxed ( self ) -> :: mtproto :: EncryptedMessage { :: mtproto :: EncryptedMessage :: Service ( self ) } } } pub mod error { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `error`\n\n```text\nerror#c4b9f9bb code:int text:string = Error;\n```\n" ] pub struct Error { pub code : :: mtproto :: int , pub text : :: mtproto :: string , } impl :: BareSerialize for Error { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Error { ref code , ref text } = self ; _ser . write_bare :: < :: mtproto :: int > ( code ) ? ; _ser . write_bare :: < :: mtproto :: string > ( text ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Error { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Error { code : _de . read_bare :: < :: mtproto :: int > ( ) ? , text : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for Error { type Boxed = :: mtproto :: Error ; fn into_boxed ( self ) -> :: mtproto :: Error { :: mtproto :: Error :: Error ( self ) } } } pub mod exported_message_link { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `exportedMessageLink`\n\n```text\nexportedMessageLink#1f486803 link:string = ExportedMessageLink;\n```\n" ] pub struct ExportedMessageLink { pub link : :: mtproto :: string , } impl :: BareSerialize for ExportedMessageLink { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ExportedMessageLink { ref link } = self ; _ser . write_bare :: < :: mtproto :: string > ( link ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ExportedMessageLink { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ExportedMessageLink { link : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for ExportedMessageLink { type Boxed = :: mtproto :: ExportedMessageLink ; fn into_boxed ( self ) -> :: mtproto :: ExportedMessageLink { :: mtproto :: ExportedMessageLink :: ExportedMessageLink ( self ) } } } pub mod file_location { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `fileLocation`\n\n```text\nfileLocation#53d69076 dc_id:int volume_id:long local_id:int secret:long = FileLocation;\n```\n" ] pub struct FileLocation { pub dc_id : :: mtproto :: int , pub volume_id : :: mtproto :: long , pub local_id : :: mtproto :: int , pub secret : :: mtproto :: long , } impl :: BareSerialize for FileLocation { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & FileLocation { ref dc_id , ref volume_id , ref local_id , ref secret } = self ; _ser . write_bare :: < :: mtproto :: int > ( dc_id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( volume_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( local_id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( secret ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for FileLocation { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( FileLocation { dc_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , volume_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , local_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , secret : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for FileLocation { type Boxed = :: mtproto :: FileLocation ; fn into_boxed ( self ) -> :: mtproto :: FileLocation { :: mtproto :: FileLocation :: FileLocation ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `fileLocationUnavailable`\n\n```text\nfileLocationUnavailable#7c596b46 volume_id:long local_id:int secret:long = FileLocation;\n```\n" ] pub struct Unavailable { pub volume_id : :: mtproto :: long , pub local_id : :: mtproto :: int , pub secret : :: mtproto :: long , } impl :: BareSerialize for Unavailable { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Unavailable { ref volume_id , ref local_id , ref secret } = self ; _ser . write_bare :: < :: mtproto :: long > ( volume_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( local_id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( secret ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Unavailable { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Unavailable { volume_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , local_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , secret : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for Unavailable { type Boxed = :: mtproto :: FileLocation ; fn into_boxed ( self ) -> :: mtproto :: FileLocation { :: mtproto :: FileLocation :: Unavailable ( self ) } } } pub mod found_gif { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `foundGifCached`\n\n```text\nfoundGifCached#9c750409 url:string photo:Photo document:Document = FoundGif;\n```\n" ] pub struct Cached { pub url : :: mtproto :: string , pub photo : :: mtproto :: Photo , pub document : :: mtproto :: Document , } impl :: BareSerialize for Cached { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Cached { ref url , ref photo , ref document } = self ; _ser . write_bare :: < :: mtproto :: string > ( url ) ? ; _ser . write_boxed :: < :: mtproto :: Photo > ( photo ) ? ; _ser . write_boxed :: < :: mtproto :: Document > ( document ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Cached { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Cached { url : _de . read_bare :: < :: mtproto :: string > ( ) ? , photo : _de . read_boxed :: < :: mtproto :: Photo > ( ) ? , document : _de . read_boxed :: < :: mtproto :: Document > ( ) ? , } ) } } impl :: IntoBoxed for Cached { type Boxed = :: mtproto :: FoundGif ; fn into_boxed ( self ) -> :: mtproto :: FoundGif { :: mtproto :: FoundGif :: Cached ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `foundGif`\n\n```text\nfoundGif#162ecc1f url:string thumb_url:string content_url:string content_type:string w:int h:int = FoundGif;\n```\n" ] pub struct FoundGif { pub url : :: mtproto :: string , pub thumb_url : :: mtproto :: string , pub content_url : :: mtproto :: string , pub content_type : :: mtproto :: string , pub w : :: mtproto :: int , pub h : :: mtproto :: int , } impl :: BareSerialize for FoundGif { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & FoundGif { ref url , ref thumb_url , ref content_url , ref content_type , ref w , ref h } = self ; _ser . write_bare :: < :: mtproto :: string > ( url ) ? ; _ser . write_bare :: < :: mtproto :: string > ( thumb_url ) ? ; _ser . write_bare :: < :: mtproto :: string > ( content_url ) ? ; _ser . write_bare :: < :: mtproto :: string > ( content_type ) ? ; _ser . write_bare :: < :: mtproto :: int > ( w ) ? ; _ser . write_bare :: < :: mtproto :: int > ( h ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for FoundGif { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( FoundGif { url : _de . read_bare :: < :: mtproto :: string > ( ) ? , thumb_url : _de . read_bare :: < :: mtproto :: string > ( ) ? , content_url : _de . read_bare :: < :: mtproto :: string > ( ) ? , content_type : _de . read_bare :: < :: mtproto :: string > ( ) ? , w : _de . read_bare :: < :: mtproto :: int > ( ) ? , h : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for FoundGif { type Boxed = :: mtproto :: FoundGif ; fn into_boxed ( self ) -> :: mtproto :: FoundGif { :: mtproto :: FoundGif :: FoundGif ( self ) } } } pub mod future_salt { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `future_salt`\n\n```text\nfuture_salt#0949d9dc valid_since:int valid_until:int salt:long = FutureSalt;\n```\n" ] pub struct FutureSalt { pub valid_since : :: mtproto :: int , pub valid_until : :: mtproto :: int , pub salt : :: mtproto :: long , } impl :: BareSerialize for FutureSalt { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & FutureSalt { ref valid_since , ref valid_until , ref salt } = self ; _ser . write_bare :: < :: mtproto :: int > ( valid_since ) ? ; _ser . write_bare :: < :: mtproto :: int > ( valid_until ) ? ; _ser . write_bare :: < :: mtproto :: long > ( salt ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for FutureSalt { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( FutureSalt { valid_since : _de . read_bare :: < :: mtproto :: int > ( ) ? , valid_until : _de . read_bare :: < :: mtproto :: int > ( ) ? , salt : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for FutureSalt { type Boxed = :: mtproto :: FutureSalt ; fn into_boxed ( self ) -> :: mtproto :: FutureSalt { :: mtproto :: FutureSalt :: FutureSalt ( self ) } } } pub mod future_salts { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `future_salts`\n\n```text\nfuture_salts#ae500895 req_msg_id:long now:int salts:vector<future_salt> = FutureSalts;\n```\n" ] pub struct FutureSalts { pub req_msg_id : :: mtproto :: long , pub now : :: mtproto :: int , pub salts : :: mtproto :: vector < :: mtproto :: Bare , :: mtproto :: future_salt :: FutureSalt > , } impl :: BareSerialize for FutureSalts { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & FutureSalts { ref req_msg_id , ref now , ref salts } = self ; _ser . write_bare :: < :: mtproto :: long > ( req_msg_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( now ) ? ; _ser . write_bare :: < :: mtproto :: vector < :: mtproto :: Bare , :: mtproto :: future_salt :: FutureSalt > > ( salts ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for FutureSalts { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( FutureSalts { req_msg_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , now : _de . read_bare :: < :: mtproto :: int > ( ) ? , salts : _de . read_bare :: < :: mtproto :: vector < :: mtproto :: Bare , :: mtproto :: future_salt :: FutureSalt > > ( ) ? , } ) } } impl :: IntoBoxed for FutureSalts { type Boxed = :: mtproto :: FutureSalts ; fn into_boxed ( self ) -> :: mtproto :: FutureSalts { :: mtproto :: FutureSalts :: FutureSalts ( self ) } } } pub mod game { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `game`\n\n```text\ngame#bdf9653b flags:# id:long access_hash:long short_name:string title:string description:string photo:Photo document:flags.0?Document = Game;\n```\n" ] pub struct Game { pub id : :: mtproto :: long , pub access_hash : :: mtproto :: long , pub short_name : :: mtproto :: string , pub title : :: mtproto :: string , pub description : :: mtproto :: string , pub photo : :: mtproto :: Photo , pub document : Option < :: mtproto :: Document > , } impl :: BareSerialize for Game { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Game { ref id , ref access_hash , ref short_name , ref title , ref description , ref photo , ref document } = self ; let mut _flags = 0i32 ; if document . is_some ( ) { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: long > ( id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( access_hash ) ? ; _ser . write_bare :: < :: mtproto :: string > ( short_name ) ? ; _ser . write_bare :: < :: mtproto :: string > ( title ) ? ; _ser . write_bare :: < :: mtproto :: string > ( description ) ? ; _ser . write_boxed :: < :: mtproto :: Photo > ( photo ) ? ; if let & Some ( ref inner ) = document { _ser . write_boxed :: < :: mtproto :: Document > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for Game { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( Game { id : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _de . read_bare :: < :: mtproto :: long > ( ) ? } , access_hash : _de . read_bare :: < :: mtproto :: long > ( ) ? , short_name : _de . read_bare :: < :: mtproto :: string > ( ) ? , title : _de . read_bare :: < :: mtproto :: string > ( ) ? , description : _de . read_bare :: < :: mtproto :: string > ( ) ? , photo : _de . read_boxed :: < :: mtproto :: Photo > ( ) ? , document : if _flags & ( 1 << 0u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: Document > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for Game { type Boxed = :: mtproto :: Game ; fn into_boxed ( self ) -> :: mtproto :: Game { :: mtproto :: Game :: Game ( self ) } } } pub mod geo_point { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `geoPoint`\n\n```text\ngeoPoint#2049d70c long:double lat:double = GeoPoint;\n```\n" ] pub struct GeoPoint { pub long : :: mtproto :: double , pub lat : :: mtproto :: double , } impl :: BareSerialize for GeoPoint { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GeoPoint { ref long , ref lat } = self ; _ser . write_bare :: < :: mtproto :: double > ( long ) ? ; _ser . write_bare :: < :: mtproto :: double > ( lat ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for GeoPoint { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( GeoPoint { long : _de . read_bare :: < :: mtproto :: double > ( ) ? , lat : _de . read_bare :: < :: mtproto :: double > ( ) ? , } ) } } impl :: IntoBoxed for GeoPoint { type Boxed = :: mtproto :: GeoPoint ; fn into_boxed ( self ) -> :: mtproto :: GeoPoint { :: mtproto :: GeoPoint :: GeoPoint ( self ) } } } pub mod help { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `help.AppUpdate`\n\n```text\nhelp.appUpdate#8987f311 id:int critical:Bool url:string text:string = help.AppUpdate;\n\nhelp.noAppUpdate#c45a6536 = help.AppUpdate;\n```\n" ] pub enum AppUpdate { AppUpdate ( :: mtproto :: help :: app_update :: AppUpdate ) , NoAppUpdate , } impl AppUpdate { pub fn critical ( & self ) -> Option < & :: mtproto :: Bool > { match self { & AppUpdate :: AppUpdate ( ref x ) => Some ( & x . critical ) , _ => None } } pub fn id ( & self ) -> Option < & :: mtproto :: int > { match self { & AppUpdate :: AppUpdate ( ref x ) => Some ( & x . id ) , _ => None } } pub fn text ( & self ) -> Option < & :: mtproto :: string > { match self { & AppUpdate :: AppUpdate ( ref x ) => Some ( & x . text ) , _ => None } } pub fn url ( & self ) -> Option < & :: mtproto :: string > { match self { & AppUpdate :: AppUpdate ( ref x ) => Some ( & x . url ) , _ => None } } } impl :: BoxedSerialize for AppUpdate { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & AppUpdate :: AppUpdate ( ref x ) => ( :: ConstructorNumber ( 0x8987f311 ) , x ) , & AppUpdate :: NoAppUpdate => ( :: ConstructorNumber ( 0xc45a6536 ) , & ( ) ) , } } } impl :: BoxedDeserialize for AppUpdate { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x8987f311 ) , :: ConstructorNumber ( 0xc45a6536 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x8987f311 ) => Ok ( AppUpdate :: AppUpdate ( _de . read_bare :: < :: mtproto :: help :: app_update :: AppUpdate > ( ) ? ) ) , :: ConstructorNumber ( 0xc45a6536 ) => Ok ( AppUpdate :: NoAppUpdate ) , id => _invalid_id ! ( id ) , } } } impl :: BoxedSerialize for Option < :: mtproto :: help :: app_update :: AppUpdate > { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match * self { None => ( :: ConstructorNumber ( 0xc45a6536 ) , & ( ) ) , Some ( ref x ) => ( :: ConstructorNumber ( 0x8987f311 ) , x ) , } } } impl :: BoxedDeserialize for Option < :: mtproto :: help :: app_update :: AppUpdate > { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xc45a6536 ) , :: ConstructorNumber ( 0x8987f311 ) ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xc45a6536 ) => Ok ( None ) , :: ConstructorNumber ( 0x8987f311 ) => Ok ( Some ( _de . read_bare :: < :: mtproto :: help :: app_update :: AppUpdate > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `help.ConfigSimple`\n\n```text\nhelp.configSimple#d997c3c5 date:int expires:int dc_id:int ip_port_list:Vector<ipPort> = help.ConfigSimple;\n```\n" ] pub enum ConfigSimple { ConfigSimple ( :: mtproto :: help :: config_simple :: ConfigSimple ) , } impl ConfigSimple { pub fn date ( & self ) -> & :: mtproto :: int { match self { & ConfigSimple :: ConfigSimple ( ref x ) => & x . date , } } pub fn dc_id ( & self ) -> & :: mtproto :: int { match self { & ConfigSimple :: ConfigSimple ( ref x ) => & x . dc_id , } } pub fn expires ( & self ) -> & :: mtproto :: int { match self { & ConfigSimple :: ConfigSimple ( ref x ) => & x . expires , } } pub fn ip_port_list ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: ip_port :: IpPort > { match self { & ConfigSimple :: ConfigSimple ( ref x ) => & x . ip_port_list , } } } impl :: BoxedSerialize for ConfigSimple { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ConfigSimple :: ConfigSimple ( ref x ) => ( :: ConstructorNumber ( 0xd997c3c5 ) , x ) , } } } impl :: BoxedDeserialize for ConfigSimple { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xd997c3c5 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xd997c3c5 ) => Ok ( ConfigSimple :: ConfigSimple ( _de . read_bare :: < :: mtproto :: help :: config_simple :: ConfigSimple > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `help.InviteText`\n\n```text\nhelp.inviteText#18cb9f78 message:string = help.InviteText;\n```\n" ] pub enum InviteText { InviteText ( :: mtproto :: help :: invite_text :: InviteText ) , } impl InviteText { pub fn message ( & self ) -> & :: mtproto :: string { match self { & InviteText :: InviteText ( ref x ) => & x . message , } } } impl :: BoxedSerialize for InviteText { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InviteText :: InviteText ( ref x ) => ( :: ConstructorNumber ( 0x18cb9f78 ) , x ) , } } } impl :: BoxedDeserialize for InviteText { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x18cb9f78 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x18cb9f78 ) => Ok ( InviteText :: InviteText ( _de . read_bare :: < :: mtproto :: help :: invite_text :: InviteText > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `help.RecentMeUrls`\n\n```text\nhelp.recentMeUrls#e0310d7 urls:Vector<RecentMeUrl> chats:Vector<Chat> users:Vector<User> = help.RecentMeUrls;\n```\n" ] pub enum RecentMeUrls { RecentMeUrls ( :: mtproto :: help :: recent_me_urls :: RecentMeUrls ) , } impl RecentMeUrls { pub fn chats ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > { match self { & RecentMeUrls :: RecentMeUrls ( ref x ) => & x . chats , } } pub fn urls ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: RecentMeUrl > { match self { & RecentMeUrls :: RecentMeUrls ( ref x ) => & x . urls , } } pub fn users ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > { match self { & RecentMeUrls :: RecentMeUrls ( ref x ) => & x . users , } } } impl :: BoxedSerialize for RecentMeUrls { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & RecentMeUrls :: RecentMeUrls ( ref x ) => ( :: ConstructorNumber ( 0x0e0310d7 ) , x ) , } } } impl :: BoxedDeserialize for RecentMeUrls { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x0e0310d7 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x0e0310d7 ) => Ok ( RecentMeUrls :: RecentMeUrls ( _de . read_bare :: < :: mtproto :: help :: recent_me_urls :: RecentMeUrls > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `help.Support`\n\n```text\nhelp.support#17c6b5f6 phone_number:string user:User = help.Support;\n```\n" ] pub enum Support { Support ( :: mtproto :: help :: support :: Support ) , } impl Support { pub fn phone_number ( & self ) -> & :: mtproto :: string { match self { & Support :: Support ( ref x ) => & x . phone_number , } } pub fn user ( & self ) -> & :: mtproto :: User { match self { & Support :: Support ( ref x ) => & x . user , } } } impl :: BoxedSerialize for Support { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Support :: Support ( ref x ) => ( :: ConstructorNumber ( 0x17c6b5f6 ) , x ) , } } } impl :: BoxedDeserialize for Support { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x17c6b5f6 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x17c6b5f6 ) => Ok ( Support :: Support ( _de . read_bare :: < :: mtproto :: help :: support :: Support > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `help.TermsOfService`\n\n```text\nhelp.termsOfService#f1ee3e90 text:string = help.TermsOfService;\n```\n" ] pub enum TermsOfService { TermsOfService ( :: mtproto :: help :: terms_of_service :: TermsOfService ) , } impl TermsOfService { pub fn text ( & self ) -> & :: mtproto :: string { match self { & TermsOfService :: TermsOfService ( ref x ) => & x . text , } } } impl :: BoxedSerialize for TermsOfService { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & TermsOfService :: TermsOfService ( ref x ) => ( :: ConstructorNumber ( 0xf1ee3e90 ) , x ) , } } } impl :: BoxedDeserialize for TermsOfService { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xf1ee3e90 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xf1ee3e90 ) => Ok ( TermsOfService :: TermsOfService ( _de . read_bare :: < :: mtproto :: help :: terms_of_service :: TermsOfService > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } pub mod app_update { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `help.appUpdate`\n\n```text\nhelp.appUpdate#8987f311 id:int critical:Bool url:string text:string = help.AppUpdate;\n```\n" ] pub struct AppUpdate { pub id : :: mtproto :: int , pub critical : :: mtproto :: Bool , pub url : :: mtproto :: string , pub text : :: mtproto :: string , } impl :: BareSerialize for AppUpdate { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & AppUpdate { ref id , ref critical , ref url , ref text } = self ; _ser . write_bare :: < :: mtproto :: int > ( id ) ? ; _ser . write_boxed :: < :: mtproto :: Bool > ( critical ) ? ; _ser . write_bare :: < :: mtproto :: string > ( url ) ? ; _ser . write_bare :: < :: mtproto :: string > ( text ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for AppUpdate { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( AppUpdate { id : _de . read_bare :: < :: mtproto :: int > ( ) ? , critical : _de . read_boxed :: < :: mtproto :: Bool > ( ) ? , url : _de . read_bare :: < :: mtproto :: string > ( ) ? , text : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for AppUpdate { type Boxed = :: mtproto :: help :: AppUpdate ; fn into_boxed ( self ) -> :: mtproto :: help :: AppUpdate { :: mtproto :: help :: AppUpdate :: AppUpdate ( self ) } } } pub mod config_simple { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `help.configSimple`\n\n```text\nhelp.configSimple#d997c3c5 date:int expires:int dc_id:int ip_port_list:Vector<ipPort> = help.ConfigSimple;\n```\n" ] pub struct ConfigSimple { pub date : :: mtproto :: int , pub expires : :: mtproto :: int , pub dc_id : :: mtproto :: int , pub ip_port_list : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: ip_port :: IpPort > , } impl :: BareSerialize for ConfigSimple { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ConfigSimple { ref date , ref expires , ref dc_id , ref ip_port_list } = self ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; _ser . write_bare :: < :: mtproto :: int > ( expires ) ? ; _ser . write_bare :: < :: mtproto :: int > ( dc_id ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: ip_port :: IpPort > > ( ip_port_list ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ConfigSimple { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ConfigSimple { date : _de . read_bare :: < :: mtproto :: int > ( ) ? , expires : _de . read_bare :: < :: mtproto :: int > ( ) ? , dc_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , ip_port_list : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: ip_port :: IpPort > > ( ) ? , } ) } } impl :: IntoBoxed for ConfigSimple { type Boxed = :: mtproto :: help :: ConfigSimple ; fn into_boxed ( self ) -> :: mtproto :: help :: ConfigSimple { :: mtproto :: help :: ConfigSimple :: ConfigSimple ( self ) } } } pub mod invite_text { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `help.inviteText`\n\n```text\nhelp.inviteText#18cb9f78 message:string = help.InviteText;\n```\n" ] pub struct InviteText { pub message : :: mtproto :: string , } impl :: BareSerialize for InviteText { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & InviteText { ref message } = self ; _ser . write_bare :: < :: mtproto :: string > ( message ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for InviteText { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( InviteText { message : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for InviteText { type Boxed = :: mtproto :: help :: InviteText ; fn into_boxed ( self ) -> :: mtproto :: help :: InviteText { :: mtproto :: help :: InviteText :: InviteText ( self ) } } } pub mod recent_me_urls { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `help.recentMeUrls`\n\n```text\nhelp.recentMeUrls#e0310d7 urls:Vector<RecentMeUrl> chats:Vector<Chat> users:Vector<User> = help.RecentMeUrls;\n```\n" ] pub struct RecentMeUrls { pub urls : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: RecentMeUrl > , pub chats : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > , pub users : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > , } impl :: BareSerialize for RecentMeUrls { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & RecentMeUrls { ref urls , ref chats , ref users } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: RecentMeUrl > > ( urls ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > ( chats ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( users ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for RecentMeUrls { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( RecentMeUrls { urls : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: RecentMeUrl > > ( ) ? , chats : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > ( ) ? , users : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( ) ? , } ) } } impl :: IntoBoxed for RecentMeUrls { type Boxed = :: mtproto :: help :: RecentMeUrls ; fn into_boxed ( self ) -> :: mtproto :: help :: RecentMeUrls { :: mtproto :: help :: RecentMeUrls :: RecentMeUrls ( self ) } } } pub mod support { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `help.support`\n\n```text\nhelp.support#17c6b5f6 phone_number:string user:User = help.Support;\n```\n" ] pub struct Support { pub phone_number : :: mtproto :: string , pub user : :: mtproto :: User , } impl :: BareSerialize for Support { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Support { ref phone_number , ref user } = self ; _ser . write_bare :: < :: mtproto :: string > ( phone_number ) ? ; _ser . write_boxed :: < :: mtproto :: User > ( user ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Support { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Support { phone_number : _de . read_bare :: < :: mtproto :: string > ( ) ? , user : _de . read_boxed :: < :: mtproto :: User > ( ) ? , } ) } } impl :: IntoBoxed for Support { type Boxed = :: mtproto :: help :: Support ; fn into_boxed ( self ) -> :: mtproto :: help :: Support { :: mtproto :: help :: Support :: Support ( self ) } } } pub mod terms_of_service { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `help.termsOfService`\n\n```text\nhelp.termsOfService#f1ee3e90 text:string = help.TermsOfService;\n```\n" ] pub struct TermsOfService { pub text : :: mtproto :: string , } impl :: BareSerialize for TermsOfService { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & TermsOfService { ref text } = self ; _ser . write_bare :: < :: mtproto :: string > ( text ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for TermsOfService { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( TermsOfService { text : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for TermsOfService { type Boxed = :: mtproto :: help :: TermsOfService ; fn into_boxed ( self ) -> :: mtproto :: help :: TermsOfService { :: mtproto :: help :: TermsOfService :: TermsOfService ( self ) } } } } pub mod high_score { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `highScore`\n\n```text\nhighScore#58fffcd0 pos:int user_id:int score:int = HighScore;\n```\n" ] pub struct HighScore { pub pos : :: mtproto :: int , pub user_id : :: mtproto :: int , pub score : :: mtproto :: int , } impl :: BareSerialize for HighScore { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & HighScore { ref pos , ref user_id , ref score } = self ; _ser . write_bare :: < :: mtproto :: int > ( pos ) ? ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( score ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for HighScore { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( HighScore { pos : _de . read_bare :: < :: mtproto :: int > ( ) ? , user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , score : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for HighScore { type Boxed = :: mtproto :: HighScore ; fn into_boxed ( self ) -> :: mtproto :: HighScore { :: mtproto :: HighScore :: HighScore ( self ) } } } pub mod http_wait { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `http_wait`\n\n```text\nhttp_wait#9299359f max_delay:int wait_after:int max_wait:int = HttpWait;\n```\n" ] pub struct HttpWait { pub max_delay : :: mtproto :: int , pub wait_after : :: mtproto :: int , pub max_wait : :: mtproto :: int , } impl :: BareSerialize for HttpWait { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & HttpWait { ref max_delay , ref wait_after , ref max_wait } = self ; _ser . write_bare :: < :: mtproto :: int > ( max_delay ) ? ; _ser . write_bare :: < :: mtproto :: int > ( wait_after ) ? ; _ser . write_bare :: < :: mtproto :: int > ( max_wait ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for HttpWait { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( HttpWait { max_delay : _de . read_bare :: < :: mtproto :: int > ( ) ? , wait_after : _de . read_bare :: < :: mtproto :: int > ( ) ? , max_wait : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for HttpWait { type Boxed = :: mtproto :: HttpWait ; fn into_boxed ( self ) -> :: mtproto :: HttpWait { :: mtproto :: HttpWait :: HttpWait ( self ) } } } pub mod imported_contact { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `importedContact`\n\n```text\nimportedContact#d0028438 user_id:int client_id:long = ImportedContact;\n```\n" ] pub struct ImportedContact { pub user_id : :: mtproto :: int , pub client_id : :: mtproto :: long , } impl :: BareSerialize for ImportedContact { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ImportedContact { ref user_id , ref client_id } = self ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( client_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ImportedContact { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ImportedContact { user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , client_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for ImportedContact { type Boxed = :: mtproto :: ImportedContact ; fn into_boxed ( self ) -> :: mtproto :: ImportedContact { :: mtproto :: ImportedContact :: ImportedContact ( self ) } } } pub mod inline_bot_switch_pm { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inlineBotSwitchPM`\n\n```text\ninlineBotSwitchPM#3c20629f text:string start_param:string = InlineBotSwitchPM;\n```\n" ] pub struct InlineBotSwitchPM { pub text : :: mtproto :: string , pub start_param : :: mtproto :: string , } impl :: BareSerialize for InlineBotSwitchPM { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & InlineBotSwitchPM { ref text , ref start_param } = self ; _ser . write_bare :: < :: mtproto :: string > ( text ) ? ; _ser . write_bare :: < :: mtproto :: string > ( start_param ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for InlineBotSwitchPM { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( InlineBotSwitchPM { text : _de . read_bare :: < :: mtproto :: string > ( ) ? , start_param : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for InlineBotSwitchPM { type Boxed = :: mtproto :: InlineBotSwitchPM ; fn into_boxed ( self ) -> :: mtproto :: InlineBotSwitchPM { :: mtproto :: InlineBotSwitchPM :: InlineBotSwitchPM ( self ) } } } pub mod input { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputDocumentFileLocation`\n\n```text\ninputDocumentFileLocation#430f0724 id:long access_hash:long version:int = InputFileLocation;\n```\n" ] pub struct DocumentFileLocation { pub id : :: mtproto :: long , pub access_hash : :: mtproto :: long , pub version : :: mtproto :: int , } impl :: BareSerialize for DocumentFileLocation { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & DocumentFileLocation { ref id , ref access_hash , ref version } = self ; _ser . write_bare :: < :: mtproto :: long > ( id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( access_hash ) ? ; _ser . write_bare :: < :: mtproto :: int > ( version ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for DocumentFileLocation { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( DocumentFileLocation { id : _de . read_bare :: < :: mtproto :: long > ( ) ? , access_hash : _de . read_bare :: < :: mtproto :: long > ( ) ? , version : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for DocumentFileLocation { type Boxed = :: mtproto :: InputFileLocation ; fn into_boxed ( self ) -> :: mtproto :: InputFileLocation { :: mtproto :: InputFileLocation :: DocumentFileLocation ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputEncryptedFileLocation`\n\n```text\ninputEncryptedFileLocation#f5235d55 id:long access_hash:long = InputFileLocation;\n```\n" ] pub struct EncryptedFileLocation { pub id : :: mtproto :: long , pub access_hash : :: mtproto :: long , } impl :: BareSerialize for EncryptedFileLocation { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & EncryptedFileLocation { ref id , ref access_hash } = self ; _ser . write_bare :: < :: mtproto :: long > ( id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( access_hash ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for EncryptedFileLocation { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( EncryptedFileLocation { id : _de . read_bare :: < :: mtproto :: long > ( ) ? , access_hash : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for EncryptedFileLocation { type Boxed = :: mtproto :: InputFileLocation ; fn into_boxed ( self ) -> :: mtproto :: InputFileLocation { :: mtproto :: InputFileLocation :: EncryptedFileLocation ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputFileLocation`\n\n```text\ninputFileLocation#14637196 volume_id:long local_id:int secret:long = InputFileLocation;\n```\n" ] pub struct FileLocation { pub volume_id : :: mtproto :: long , pub local_id : :: mtproto :: int , pub secret : :: mtproto :: long , } impl :: BareSerialize for FileLocation { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & FileLocation { ref volume_id , ref local_id , ref secret } = self ; _ser . write_bare :: < :: mtproto :: long > ( volume_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( local_id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( secret ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for FileLocation { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( FileLocation { volume_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , local_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , secret : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for FileLocation { type Boxed = :: mtproto :: InputFileLocation ; fn into_boxed ( self ) -> :: mtproto :: InputFileLocation { :: mtproto :: InputFileLocation :: FileLocation ( self ) } } } pub mod input_app_event { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputAppEvent`\n\n```text\ninputAppEvent#770656a8 time:double type:string peer:long data:string = InputAppEvent;\n```\n" ] pub struct InputAppEvent { pub time : :: mtproto :: double , pub type_ : :: mtproto :: string , pub peer : :: mtproto :: long , pub data : :: mtproto :: string , } impl :: BareSerialize for InputAppEvent { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & InputAppEvent { ref time , ref type_ , ref peer , ref data } = self ; _ser . write_bare :: < :: mtproto :: double > ( time ) ? ; _ser . write_bare :: < :: mtproto :: string > ( type_ ) ? ; _ser . write_bare :: < :: mtproto :: long > ( peer ) ? ; _ser . write_bare :: < :: mtproto :: string > ( data ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for InputAppEvent { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( InputAppEvent { time : _de . read_bare :: < :: mtproto :: double > ( ) ? , type_ : _de . read_bare :: < :: mtproto :: string > ( ) ? , peer : _de . read_bare :: < :: mtproto :: long > ( ) ? , data : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for InputAppEvent { type Boxed = :: mtproto :: InputAppEvent ; fn into_boxed ( self ) -> :: mtproto :: InputAppEvent { :: mtproto :: InputAppEvent :: InputAppEvent ( self ) } } } pub mod input_bot_inline_message { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputBotInlineMessageGame`\n\n```text\ninputBotInlineMessageGame#4b425864 flags:# reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\n```\n" ] pub struct Game { pub reply_markup : Option < :: mtproto :: ReplyMarkup > , } impl :: BareSerialize for Game { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Game { ref reply_markup } = self ; let mut _flags = 0i32 ; if reply_markup . is_some ( ) { _flags |= 1 << 2u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; if let & Some ( ref inner ) = reply_markup { _ser . write_boxed :: < :: mtproto :: ReplyMarkup > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for Game { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( Game { reply_markup : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; if _flags & ( 1 << 2u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: ReplyMarkup > ( ) ? ) } else { None } } , } ) } } impl :: IntoBoxed for Game { type Boxed = :: mtproto :: InputBotInlineMessage ; fn into_boxed ( self ) -> :: mtproto :: InputBotInlineMessage { :: mtproto :: InputBotInlineMessage :: Game ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputBotInlineMessageMediaAuto`\n\n```text\ninputBotInlineMessageMediaAuto#292fed13 flags:# caption:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\n```\n" ] pub struct MediaAuto { pub caption : :: mtproto :: string , pub reply_markup : Option < :: mtproto :: ReplyMarkup > , } impl :: BareSerialize for MediaAuto { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & MediaAuto { ref caption , ref reply_markup } = self ; let mut _flags = 0i32 ; if reply_markup . is_some ( ) { _flags |= 1 << 2u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: string > ( caption ) ? ; if let & Some ( ref inner ) = reply_markup { _ser . write_boxed :: < :: mtproto :: ReplyMarkup > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for MediaAuto { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( MediaAuto { caption : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _de . read_bare :: < :: mtproto :: string > ( ) ? } , reply_markup : if _flags & ( 1 << 2u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: ReplyMarkup > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for MediaAuto { type Boxed = :: mtproto :: InputBotInlineMessage ; fn into_boxed ( self ) -> :: mtproto :: InputBotInlineMessage { :: mtproto :: InputBotInlineMessage :: MediaAuto ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputBotInlineMessageMediaContact`\n\n```text\ninputBotInlineMessageMediaContact#2daf01a7 flags:# phone_number:string first_name:string last_name:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\n```\n" ] pub struct MediaContact { pub phone_number : :: mtproto :: string , pub first_name : :: mtproto :: string , pub last_name : :: mtproto :: string , pub reply_markup : Option < :: mtproto :: ReplyMarkup > , } impl :: BareSerialize for MediaContact { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & MediaContact { ref phone_number , ref first_name , ref last_name , ref reply_markup } = self ; let mut _flags = 0i32 ; if reply_markup . is_some ( ) { _flags |= 1 << 2u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: string > ( phone_number ) ? ; _ser . write_bare :: < :: mtproto :: string > ( first_name ) ? ; _ser . write_bare :: < :: mtproto :: string > ( last_name ) ? ; if let & Some ( ref inner ) = reply_markup { _ser . write_boxed :: < :: mtproto :: ReplyMarkup > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for MediaContact { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( MediaContact { phone_number : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _de . read_bare :: < :: mtproto :: string > ( ) ? } , first_name : _de . read_bare :: < :: mtproto :: string > ( ) ? , last_name : _de . read_bare :: < :: mtproto :: string > ( ) ? , reply_markup : if _flags & ( 1 << 2u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: ReplyMarkup > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for MediaContact { type Boxed = :: mtproto :: InputBotInlineMessage ; fn into_boxed ( self ) -> :: mtproto :: InputBotInlineMessage { :: mtproto :: InputBotInlineMessage :: MediaContact ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputBotInlineMessageMediaGeo`\n\n```text\ninputBotInlineMessageMediaGeo#c1b15d65 flags:# geo_point:InputGeoPoint period:int reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\n```\n" ] pub struct MediaGeo { pub geo_point : :: mtproto :: InputGeoPoint , pub period : :: mtproto :: int , pub reply_markup : Option < :: mtproto :: ReplyMarkup > , } impl :: BareSerialize for MediaGeo { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & MediaGeo { ref geo_point , ref period , ref reply_markup } = self ; let mut _flags = 0i32 ; if reply_markup . is_some ( ) { _flags |= 1 << 2u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_boxed :: < :: mtproto :: InputGeoPoint > ( geo_point ) ? ; _ser . write_bare :: < :: mtproto :: int > ( period ) ? ; if let & Some ( ref inner ) = reply_markup { _ser . write_boxed :: < :: mtproto :: ReplyMarkup > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for MediaGeo { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( MediaGeo { geo_point : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _de . read_boxed :: < :: mtproto :: InputGeoPoint > ( ) ? } , period : _de . read_bare :: < :: mtproto :: int > ( ) ? , reply_markup : if _flags & ( 1 << 2u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: ReplyMarkup > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for MediaGeo { type Boxed = :: mtproto :: InputBotInlineMessage ; fn into_boxed ( self ) -> :: mtproto :: InputBotInlineMessage { :: mtproto :: InputBotInlineMessage :: MediaGeo ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputBotInlineMessageMediaVenue`\n\n```text\ninputBotInlineMessageMediaVenue#aaafadc8 flags:# geo_point:InputGeoPoint title:string address:string provider:string venue_id:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\n```\n" ] pub struct MediaVenue { pub geo_point : :: mtproto :: InputGeoPoint , pub title : :: mtproto :: string , pub address : :: mtproto :: string , pub provider : :: mtproto :: string , pub venue_id : :: mtproto :: string , pub reply_markup : Option < :: mtproto :: ReplyMarkup > , } impl :: BareSerialize for MediaVenue { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & MediaVenue { ref geo_point , ref title , ref address , ref provider , ref venue_id , ref reply_markup } = self ; let mut _flags = 0i32 ; if reply_markup . is_some ( ) { _flags |= 1 << 2u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_boxed :: < :: mtproto :: InputGeoPoint > ( geo_point ) ? ; _ser . write_bare :: < :: mtproto :: string > ( title ) ? ; _ser . write_bare :: < :: mtproto :: string > ( address ) ? ; _ser . write_bare :: < :: mtproto :: string > ( provider ) ? ; _ser . write_bare :: < :: mtproto :: string > ( venue_id ) ? ; if let & Some ( ref inner ) = reply_markup { _ser . write_boxed :: < :: mtproto :: ReplyMarkup > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for MediaVenue { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( MediaVenue { geo_point : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _de . read_boxed :: < :: mtproto :: InputGeoPoint > ( ) ? } , title : _de . read_bare :: < :: mtproto :: string > ( ) ? , address : _de . read_bare :: < :: mtproto :: string > ( ) ? , provider : _de . read_bare :: < :: mtproto :: string > ( ) ? , venue_id : _de . read_bare :: < :: mtproto :: string > ( ) ? , reply_markup : if _flags & ( 1 << 2u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: ReplyMarkup > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for MediaVenue { type Boxed = :: mtproto :: InputBotInlineMessage ; fn into_boxed ( self ) -> :: mtproto :: InputBotInlineMessage { :: mtproto :: InputBotInlineMessage :: MediaVenue ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputBotInlineMessageText`\n\n```text\ninputBotInlineMessageText#3dcd7a87 flags:# no_webpage:flags.0?true message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\n```\n" ] pub struct Text { pub no_webpage : bool , pub message : :: mtproto :: string , pub entities : Option < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: MessageEntity > > , pub reply_markup : Option < :: mtproto :: ReplyMarkup > , } impl :: BareSerialize for Text { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Text { no_webpage , ref message , ref entities , ref reply_markup } = self ; let mut _flags = 0i32 ; if no_webpage { _flags |= 1 << 0u32 ; } if entities . is_some ( ) { _flags |= 1 << 1u32 ; } if reply_markup . is_some ( ) { _flags |= 1 << 2u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: string > ( message ) ? ; if let & Some ( ref inner ) = entities { _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: MessageEntity > > ( inner ) ? ; } if let & Some ( ref inner ) = reply_markup { _ser . write_boxed :: < :: mtproto :: ReplyMarkup > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for Text { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( Text { no_webpage : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 0u32 ) != 0 } , message : _de . read_bare :: < :: mtproto :: string > ( ) ? , entities : if _flags & ( 1 << 1u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: MessageEntity > > ( ) ? ) } else { None } , reply_markup : if _flags & ( 1 << 2u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: ReplyMarkup > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for Text { type Boxed = :: mtproto :: InputBotInlineMessage ; fn into_boxed ( self ) -> :: mtproto :: InputBotInlineMessage { :: mtproto :: InputBotInlineMessage :: Text ( self ) } } } pub mod input_bot_inline_message_id { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputBotInlineMessageID`\n\n```text\ninputBotInlineMessageID#890c3d89 dc_id:int id:long access_hash:long = InputBotInlineMessageID;\n```\n" ] pub struct InputBotInlineMessageID { pub dc_id : :: mtproto :: int , pub id : :: mtproto :: long , pub access_hash : :: mtproto :: long , } impl :: BareSerialize for InputBotInlineMessageID { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & InputBotInlineMessageID { ref dc_id , ref id , ref access_hash } = self ; _ser . write_bare :: < :: mtproto :: int > ( dc_id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( access_hash ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for InputBotInlineMessageID { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( InputBotInlineMessageID { dc_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , id : _de . read_bare :: < :: mtproto :: long > ( ) ? , access_hash : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for InputBotInlineMessageID { type Boxed = :: mtproto :: InputBotInlineMessageID ; fn into_boxed ( self ) -> :: mtproto :: InputBotInlineMessageID { :: mtproto :: InputBotInlineMessageID :: InputBotInlineMessageID ( self ) } } } pub mod input_bot_inline_result { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputBotInlineResultDocument`\n\n```text\ninputBotInlineResultDocument#fff8fdc4 flags:# id:string type:string title:flags.1?string description:flags.2?string document:InputDocument send_message:InputBotInlineMessage = InputBotInlineResult;\n```\n" ] pub struct Document { pub id : :: mtproto :: string , pub type_ : :: mtproto :: string , pub title : Option < :: mtproto :: string > , pub description : Option < :: mtproto :: string > , pub document : :: mtproto :: InputDocument , pub send_message : :: mtproto :: InputBotInlineMessage , } impl :: BareSerialize for Document { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Document { ref id , ref type_ , ref title , ref description , ref document , ref send_message } = self ; let mut _flags = 0i32 ; if title . is_some ( ) { _flags |= 1 << 1u32 ; } if description . is_some ( ) { _flags |= 1 << 2u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: string > ( id ) ? ; _ser . write_bare :: < :: mtproto :: string > ( type_ ) ? ; if let & Some ( ref inner ) = title { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = description { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } _ser . write_boxed :: < :: mtproto :: InputDocument > ( document ) ? ; _ser . write_boxed :: < :: mtproto :: InputBotInlineMessage > ( send_message ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Document { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( Document { id : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _de . read_bare :: < :: mtproto :: string > ( ) ? } , type_ : _de . read_bare :: < :: mtproto :: string > ( ) ? , title : if _flags & ( 1 << 1u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , description : if _flags & ( 1 << 2u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , document : _de . read_boxed :: < :: mtproto :: InputDocument > ( ) ? , send_message : _de . read_boxed :: < :: mtproto :: InputBotInlineMessage > ( ) ? , } ) } } impl :: IntoBoxed for Document { type Boxed = :: mtproto :: InputBotInlineResult ; fn into_boxed ( self ) -> :: mtproto :: InputBotInlineResult { :: mtproto :: InputBotInlineResult :: Document ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputBotInlineResultGame`\n\n```text\ninputBotInlineResultGame#4fa417f2 id:string short_name:string send_message:InputBotInlineMessage = InputBotInlineResult;\n```\n" ] pub struct Game { pub id : :: mtproto :: string , pub short_name : :: mtproto :: string , pub send_message : :: mtproto :: InputBotInlineMessage , } impl :: BareSerialize for Game { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Game { ref id , ref short_name , ref send_message } = self ; _ser . write_bare :: < :: mtproto :: string > ( id ) ? ; _ser . write_bare :: < :: mtproto :: string > ( short_name ) ? ; _ser . write_boxed :: < :: mtproto :: InputBotInlineMessage > ( send_message ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Game { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Game { id : _de . read_bare :: < :: mtproto :: string > ( ) ? , short_name : _de . read_bare :: < :: mtproto :: string > ( ) ? , send_message : _de . read_boxed :: < :: mtproto :: InputBotInlineMessage > ( ) ? , } ) } } impl :: IntoBoxed for Game { type Boxed = :: mtproto :: InputBotInlineResult ; fn into_boxed ( self ) -> :: mtproto :: InputBotInlineResult { :: mtproto :: InputBotInlineResult :: Game ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputBotInlineResult`\n\n```text\ninputBotInlineResult#2cbbe15a flags:# id:string type:string title:flags.1?string description:flags.2?string url:flags.3?string thumb_url:flags.4?string content_url:flags.5?string content_type:flags.5?string w:flags.6?int h:flags.6?int duration:flags.7?int send_message:InputBotInlineMessage = InputBotInlineResult;\n```\n" ] pub struct InputBotInlineResult { pub id : :: mtproto :: string , pub type_ : :: mtproto :: string , pub title : Option < :: mtproto :: string > , pub description : Option < :: mtproto :: string > , pub url : Option < :: mtproto :: string > , pub thumb_url : Option < :: mtproto :: string > , pub content_url : Option < :: mtproto :: string > , pub content_type : Option < :: mtproto :: string > , pub w : Option < :: mtproto :: int > , pub h : Option < :: mtproto :: int > , pub duration : Option < :: mtproto :: int > , pub send_message : :: mtproto :: InputBotInlineMessage , } impl :: BareSerialize for InputBotInlineResult { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & InputBotInlineResult { ref id , ref type_ , ref title , ref description , ref url , ref thumb_url , ref content_url , ref content_type , ref w , ref h , ref duration , ref send_message } = self ; let mut _flags = 0i32 ; if title . is_some ( ) { _flags |= 1 << 1u32 ; } if description . is_some ( ) { _flags |= 1 << 2u32 ; } if url . is_some ( ) { _flags |= 1 << 3u32 ; } if thumb_url . is_some ( ) { _flags |= 1 << 4u32 ; } if content_url . is_some ( ) { _flags |= 1 << 5u32 ; } if content_type . is_some ( ) { _flags |= 1 << 5u32 ; } if w . is_some ( ) { _flags |= 1 << 6u32 ; } if h . is_some ( ) { _flags |= 1 << 6u32 ; } if duration . is_some ( ) { _flags |= 1 << 7u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: string > ( id ) ? ; _ser . write_bare :: < :: mtproto :: string > ( type_ ) ? ; if let & Some ( ref inner ) = title { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = description { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = url { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = thumb_url { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = content_url { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = content_type { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = w { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } if let & Some ( ref inner ) = h { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } if let & Some ( ref inner ) = duration { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } _ser . write_boxed :: < :: mtproto :: InputBotInlineMessage > ( send_message ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for InputBotInlineResult { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( InputBotInlineResult { id : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _de . read_bare :: < :: mtproto :: string > ( ) ? } , type_ : _de . read_bare :: < :: mtproto :: string > ( ) ? , title : if _flags & ( 1 << 1u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , description : if _flags & ( 1 << 2u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , url : if _flags & ( 1 << 3u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , thumb_url : if _flags & ( 1 << 4u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , content_url : if _flags & ( 1 << 5u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , content_type : if _flags & ( 1 << 5u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , w : if _flags & ( 1 << 6u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , h : if _flags & ( 1 << 6u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , duration : if _flags & ( 1 << 7u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , send_message : _de . read_boxed :: < :: mtproto :: InputBotInlineMessage > ( ) ? , } ) } } impl :: IntoBoxed for InputBotInlineResult { type Boxed = :: mtproto :: InputBotInlineResult ; fn into_boxed ( self ) -> :: mtproto :: InputBotInlineResult { :: mtproto :: InputBotInlineResult :: InputBotInlineResult ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputBotInlineResultPhoto`\n\n```text\ninputBotInlineResultPhoto#a8d864a7 id:string type:string photo:InputPhoto send_message:InputBotInlineMessage = InputBotInlineResult;\n```\n" ] pub struct Photo { pub id : :: mtproto :: string , pub type_ : :: mtproto :: string , pub photo : :: mtproto :: InputPhoto , pub send_message : :: mtproto :: InputBotInlineMessage , } impl :: BareSerialize for Photo { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Photo { ref id , ref type_ , ref photo , ref send_message } = self ; _ser . write_bare :: < :: mtproto :: string > ( id ) ? ; _ser . write_bare :: < :: mtproto :: string > ( type_ ) ? ; _ser . write_boxed :: < :: mtproto :: InputPhoto > ( photo ) ? ; _ser . write_boxed :: < :: mtproto :: InputBotInlineMessage > ( send_message ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Photo { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Photo { id : _de . read_bare :: < :: mtproto :: string > ( ) ? , type_ : _de . read_bare :: < :: mtproto :: string > ( ) ? , photo : _de . read_boxed :: < :: mtproto :: InputPhoto > ( ) ? , send_message : _de . read_boxed :: < :: mtproto :: InputBotInlineMessage > ( ) ? , } ) } } impl :: IntoBoxed for Photo { type Boxed = :: mtproto :: InputBotInlineResult ; fn into_boxed ( self ) -> :: mtproto :: InputBotInlineResult { :: mtproto :: InputBotInlineResult :: Photo ( self ) } } } pub mod input_channel { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputChannel`\n\n```text\ninputChannel#afeb712e channel_id:int access_hash:long = InputChannel;\n```\n" ] pub struct InputChannel { pub channel_id : :: mtproto :: int , pub access_hash : :: mtproto :: long , } impl :: BareSerialize for InputChannel { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & InputChannel { ref channel_id , ref access_hash } = self ; _ser . write_bare :: < :: mtproto :: int > ( channel_id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( access_hash ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for InputChannel { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( InputChannel { channel_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , access_hash : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for InputChannel { type Boxed = :: mtproto :: InputChannel ; fn into_boxed ( self ) -> :: mtproto :: InputChannel { :: mtproto :: InputChannel :: InputChannel ( self ) } } } pub mod input_chat { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputChatPhoto`\n\n```text\ninputChatPhoto#8953ad37 id:InputPhoto = InputChatPhoto;\n```\n" ] pub struct Photo { pub id : :: mtproto :: InputPhoto , } impl :: BareSerialize for Photo { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Photo { ref id } = self ; _ser . write_boxed :: < :: mtproto :: InputPhoto > ( id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Photo { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Photo { id : _de . read_boxed :: < :: mtproto :: InputPhoto > ( ) ? , } ) } } impl :: IntoBoxed for Photo { type Boxed = :: mtproto :: InputChatPhoto ; fn into_boxed ( self ) -> :: mtproto :: InputChatPhoto { :: mtproto :: InputChatPhoto :: Photo ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputChatUploadedPhoto`\n\n```text\ninputChatUploadedPhoto#927c55b4 file:InputFile = InputChatPhoto;\n```\n" ] pub struct UploadedPhoto { pub file : :: mtproto :: InputFile , } impl :: BareSerialize for UploadedPhoto { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & UploadedPhoto { ref file } = self ; _ser . write_boxed :: < :: mtproto :: InputFile > ( file ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for UploadedPhoto { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( UploadedPhoto { file : _de . read_boxed :: < :: mtproto :: InputFile > ( ) ? , } ) } } impl :: IntoBoxed for UploadedPhoto { type Boxed = :: mtproto :: InputChatPhoto ; fn into_boxed ( self ) -> :: mtproto :: InputChatPhoto { :: mtproto :: InputChatPhoto :: UploadedPhoto ( self ) } } } pub mod input_document { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputDocument`\n\n```text\ninputDocument#18798952 id:long access_hash:long = InputDocument;\n```\n" ] pub struct InputDocument { pub id : :: mtproto :: long , pub access_hash : :: mtproto :: long , } impl :: BareSerialize for InputDocument { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & InputDocument { ref id , ref access_hash } = self ; _ser . write_bare :: < :: mtproto :: long > ( id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( access_hash ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for InputDocument { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( InputDocument { id : _de . read_bare :: < :: mtproto :: long > ( ) ? , access_hash : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for InputDocument { type Boxed = :: mtproto :: InputDocument ; fn into_boxed ( self ) -> :: mtproto :: InputDocument { :: mtproto :: InputDocument :: InputDocument ( self ) } } } pub mod input_encrypted_chat { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputEncryptedChat`\n\n```text\ninputEncryptedChat#f141b5e1 chat_id:int access_hash:long = InputEncryptedChat;\n```\n" ] pub struct InputEncryptedChat { pub chat_id : :: mtproto :: int , pub access_hash : :: mtproto :: long , } impl :: BareSerialize for InputEncryptedChat { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & InputEncryptedChat { ref chat_id , ref access_hash } = self ; _ser . write_bare :: < :: mtproto :: int > ( chat_id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( access_hash ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for InputEncryptedChat { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( InputEncryptedChat { chat_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , access_hash : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for InputEncryptedChat { type Boxed = :: mtproto :: InputEncryptedChat ; fn into_boxed ( self ) -> :: mtproto :: InputEncryptedChat { :: mtproto :: InputEncryptedChat :: InputEncryptedChat ( self ) } } } pub mod input_encrypted_file { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputEncryptedFileBigUploaded`\n\n```text\ninputEncryptedFileBigUploaded#2dc173c8 id:long parts:int key_fingerprint:int = InputEncryptedFile;\n```\n" ] pub struct BigUploaded { pub id : :: mtproto :: long , pub parts : :: mtproto :: int , pub key_fingerprint : :: mtproto :: int , } impl :: BareSerialize for BigUploaded { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & BigUploaded { ref id , ref parts , ref key_fingerprint } = self ; _ser . write_bare :: < :: mtproto :: long > ( id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( parts ) ? ; _ser . write_bare :: < :: mtproto :: int > ( key_fingerprint ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for BigUploaded { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( BigUploaded { id : _de . read_bare :: < :: mtproto :: long > ( ) ? , parts : _de . read_bare :: < :: mtproto :: int > ( ) ? , key_fingerprint : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for BigUploaded { type Boxed = :: mtproto :: InputEncryptedFile ; fn into_boxed ( self ) -> :: mtproto :: InputEncryptedFile { :: mtproto :: InputEncryptedFile :: BigUploaded ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputEncryptedFile`\n\n```text\ninputEncryptedFile#5a17b5e5 id:long access_hash:long = InputEncryptedFile;\n```\n" ] pub struct InputEncryptedFile { pub id : :: mtproto :: long , pub access_hash : :: mtproto :: long , } impl :: BareSerialize for InputEncryptedFile { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & InputEncryptedFile { ref id , ref access_hash } = self ; _ser . write_bare :: < :: mtproto :: long > ( id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( access_hash ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for InputEncryptedFile { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( InputEncryptedFile { id : _de . read_bare :: < :: mtproto :: long > ( ) ? , access_hash : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for InputEncryptedFile { type Boxed = :: mtproto :: InputEncryptedFile ; fn into_boxed ( self ) -> :: mtproto :: InputEncryptedFile { :: mtproto :: InputEncryptedFile :: InputEncryptedFile ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputEncryptedFileUploaded`\n\n```text\ninputEncryptedFileUploaded#64bd0306 id:long parts:int md5_checksum:string key_fingerprint:int = InputEncryptedFile;\n```\n" ] pub struct Uploaded { pub id : :: mtproto :: long , pub parts : :: mtproto :: int , pub md5_checksum : :: mtproto :: string , pub key_fingerprint : :: mtproto :: int , } impl :: BareSerialize for Uploaded { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Uploaded { ref id , ref parts , ref md5_checksum , ref key_fingerprint } = self ; _ser . write_bare :: < :: mtproto :: long > ( id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( parts ) ? ; _ser . write_bare :: < :: mtproto :: string > ( md5_checksum ) ? ; _ser . write_bare :: < :: mtproto :: int > ( key_fingerprint ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Uploaded { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Uploaded { id : _de . read_bare :: < :: mtproto :: long > ( ) ? , parts : _de . read_bare :: < :: mtproto :: int > ( ) ? , md5_checksum : _de . read_bare :: < :: mtproto :: string > ( ) ? , key_fingerprint : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for Uploaded { type Boxed = :: mtproto :: InputEncryptedFile ; fn into_boxed ( self ) -> :: mtproto :: InputEncryptedFile { :: mtproto :: InputEncryptedFile :: Uploaded ( self ) } } } pub mod input_file { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputFileBig`\n\n```text\ninputFileBig#fa4f0bb5 id:long parts:int name:string = InputFile;\n```\n" ] pub struct Big { pub id : :: mtproto :: long , pub parts : :: mtproto :: int , pub name : :: mtproto :: string , } impl :: BareSerialize for Big { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Big { ref id , ref parts , ref name } = self ; _ser . write_bare :: < :: mtproto :: long > ( id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( parts ) ? ; _ser . write_bare :: < :: mtproto :: string > ( name ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Big { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Big { id : _de . read_bare :: < :: mtproto :: long > ( ) ? , parts : _de . read_bare :: < :: mtproto :: int > ( ) ? , name : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for Big { type Boxed = :: mtproto :: InputFile ; fn into_boxed ( self ) -> :: mtproto :: InputFile { :: mtproto :: InputFile :: Big ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputFile`\n\n```text\ninputFile#f52ff27f id:long parts:int name:string md5_checksum:string = InputFile;\n```\n" ] pub struct InputFile { pub id : :: mtproto :: long , pub parts : :: mtproto :: int , pub name : :: mtproto :: string , pub md5_checksum : :: mtproto :: string , } impl :: BareSerialize for InputFile { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & InputFile { ref id , ref parts , ref name , ref md5_checksum } = self ; _ser . write_bare :: < :: mtproto :: long > ( id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( parts ) ? ; _ser . write_bare :: < :: mtproto :: string > ( name ) ? ; _ser . write_bare :: < :: mtproto :: string > ( md5_checksum ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for InputFile { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( InputFile { id : _de . read_bare :: < :: mtproto :: long > ( ) ? , parts : _de . read_bare :: < :: mtproto :: int > ( ) ? , name : _de . read_bare :: < :: mtproto :: string > ( ) ? , md5_checksum : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for InputFile { type Boxed = :: mtproto :: InputFile ; fn into_boxed ( self ) -> :: mtproto :: InputFile { :: mtproto :: InputFile :: InputFile ( self ) } } } pub mod input_game { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputGameID`\n\n```text\ninputGameID#32c3e77 id:long access_hash:long = InputGame;\n```\n" ] pub struct ID { pub id : :: mtproto :: long , pub access_hash : :: mtproto :: long , } impl :: BareSerialize for ID { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ID { ref id , ref access_hash } = self ; _ser . write_bare :: < :: mtproto :: long > ( id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( access_hash ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ID { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ID { id : _de . read_bare :: < :: mtproto :: long > ( ) ? , access_hash : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for ID { type Boxed = :: mtproto :: InputGame ; fn into_boxed ( self ) -> :: mtproto :: InputGame { :: mtproto :: InputGame :: ID ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputGameShortName`\n\n```text\ninputGameShortName#c331e80a bot_id:InputUser short_name:string = InputGame;\n```\n" ] pub struct ShortName { pub bot_id : :: mtproto :: InputUser , pub short_name : :: mtproto :: string , } impl :: BareSerialize for ShortName { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ShortName { ref bot_id , ref short_name } = self ; _ser . write_boxed :: < :: mtproto :: InputUser > ( bot_id ) ? ; _ser . write_bare :: < :: mtproto :: string > ( short_name ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ShortName { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ShortName { bot_id : _de . read_boxed :: < :: mtproto :: InputUser > ( ) ? , short_name : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for ShortName { type Boxed = :: mtproto :: InputGame ; fn into_boxed ( self ) -> :: mtproto :: InputGame { :: mtproto :: InputGame :: ShortName ( self ) } } } pub mod input_geo_point { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputGeoPoint`\n\n```text\ninputGeoPoint#f3b7acc9 lat:double long:double = InputGeoPoint;\n```\n" ] pub struct InputGeoPoint { pub lat : :: mtproto :: double , pub long : :: mtproto :: double , } impl :: BareSerialize for InputGeoPoint { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & InputGeoPoint { ref lat , ref long } = self ; _ser . write_bare :: < :: mtproto :: double > ( lat ) ? ; _ser . write_bare :: < :: mtproto :: double > ( long ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for InputGeoPoint { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( InputGeoPoint { lat : _de . read_bare :: < :: mtproto :: double > ( ) ? , long : _de . read_bare :: < :: mtproto :: double > ( ) ? , } ) } } impl :: IntoBoxed for InputGeoPoint { type Boxed = :: mtproto :: InputGeoPoint ; fn into_boxed ( self ) -> :: mtproto :: InputGeoPoint { :: mtproto :: InputGeoPoint :: InputGeoPoint ( self ) } } } pub mod input_media { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputMediaContact`\n\n```text\ninputMediaContact#a6e45987 phone_number:string first_name:string last_name:string = InputMedia;\n```\n" ] pub struct Contact { pub phone_number : :: mtproto :: string , pub first_name : :: mtproto :: string , pub last_name : :: mtproto :: string , } impl :: BareSerialize for Contact { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Contact { ref phone_number , ref first_name , ref last_name } = self ; _ser . write_bare :: < :: mtproto :: string > ( phone_number ) ? ; _ser . write_bare :: < :: mtproto :: string > ( first_name ) ? ; _ser . write_bare :: < :: mtproto :: string > ( last_name ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Contact { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Contact { phone_number : _de . read_bare :: < :: mtproto :: string > ( ) ? , first_name : _de . read_bare :: < :: mtproto :: string > ( ) ? , last_name : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for Contact { type Boxed = :: mtproto :: InputMedia ; fn into_boxed ( self ) -> :: mtproto :: InputMedia { :: mtproto :: InputMedia :: Contact ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputMediaDocument`\n\n```text\ninputMediaDocument#5acb668e flags:# id:InputDocument caption:string ttl_seconds:flags.0?int = InputMedia;\n```\n" ] pub struct Document { pub id : :: mtproto :: InputDocument , pub caption : :: mtproto :: string , pub ttl_seconds : Option < :: mtproto :: int > , } impl :: BareSerialize for Document { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Document { ref id , ref caption , ref ttl_seconds } = self ; let mut _flags = 0i32 ; if ttl_seconds . is_some ( ) { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_boxed :: < :: mtproto :: InputDocument > ( id ) ? ; _ser . write_bare :: < :: mtproto :: string > ( caption ) ? ; if let & Some ( ref inner ) = ttl_seconds { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for Document { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( Document { id : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _de . read_boxed :: < :: mtproto :: InputDocument > ( ) ? } , caption : _de . read_bare :: < :: mtproto :: string > ( ) ? , ttl_seconds : if _flags & ( 1 << 0u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for Document { type Boxed = :: mtproto :: InputMedia ; fn into_boxed ( self ) -> :: mtproto :: InputMedia { :: mtproto :: InputMedia :: Document ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputMediaDocumentExternal`\n\n```text\ninputMediaDocumentExternal#b6f74335 flags:# url:string caption:string ttl_seconds:flags.0?int = InputMedia;\n```\n" ] pub struct DocumentExternal { pub url : :: mtproto :: string , pub caption : :: mtproto :: string , pub ttl_seconds : Option < :: mtproto :: int > , } impl :: BareSerialize for DocumentExternal { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & DocumentExternal { ref url , ref caption , ref ttl_seconds } = self ; let mut _flags = 0i32 ; if ttl_seconds . is_some ( ) { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: string > ( url ) ? ; _ser . write_bare :: < :: mtproto :: string > ( caption ) ? ; if let & Some ( ref inner ) = ttl_seconds { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for DocumentExternal { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( DocumentExternal { url : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _de . read_bare :: < :: mtproto :: string > ( ) ? } , caption : _de . read_bare :: < :: mtproto :: string > ( ) ? , ttl_seconds : if _flags & ( 1 << 0u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for DocumentExternal { type Boxed = :: mtproto :: InputMedia ; fn into_boxed ( self ) -> :: mtproto :: InputMedia { :: mtproto :: InputMedia :: DocumentExternal ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputMediaGame`\n\n```text\ninputMediaGame#d33f43f3 id:InputGame = InputMedia;\n```\n" ] pub struct Game { pub id : :: mtproto :: InputGame , } impl :: BareSerialize for Game { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Game { ref id } = self ; _ser . write_boxed :: < :: mtproto :: InputGame > ( id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Game { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Game { id : _de . read_boxed :: < :: mtproto :: InputGame > ( ) ? , } ) } } impl :: IntoBoxed for Game { type Boxed = :: mtproto :: InputMedia ; fn into_boxed ( self ) -> :: mtproto :: InputMedia { :: mtproto :: InputMedia :: Game ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputMediaGeoLive`\n\n```text\ninputMediaGeoLive#7b1a118f geo_point:InputGeoPoint period:int = InputMedia;\n```\n" ] pub struct GeoLive { pub geo_point : :: mtproto :: InputGeoPoint , pub period : :: mtproto :: int , } impl :: BareSerialize for GeoLive { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GeoLive { ref geo_point , ref period } = self ; _ser . write_boxed :: < :: mtproto :: InputGeoPoint > ( geo_point ) ? ; _ser . write_bare :: < :: mtproto :: int > ( period ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for GeoLive { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( GeoLive { geo_point : _de . read_boxed :: < :: mtproto :: InputGeoPoint > ( ) ? , period : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for GeoLive { type Boxed = :: mtproto :: InputMedia ; fn into_boxed ( self ) -> :: mtproto :: InputMedia { :: mtproto :: InputMedia :: GeoLive ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputMediaGeoPoint`\n\n```text\ninputMediaGeoPoint#f9c44144 geo_point:InputGeoPoint = InputMedia;\n```\n" ] pub struct GeoPoint { pub geo_point : :: mtproto :: InputGeoPoint , } impl :: BareSerialize for GeoPoint { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GeoPoint { ref geo_point } = self ; _ser . write_boxed :: < :: mtproto :: InputGeoPoint > ( geo_point ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for GeoPoint { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( GeoPoint { geo_point : _de . read_boxed :: < :: mtproto :: InputGeoPoint > ( ) ? , } ) } } impl :: IntoBoxed for GeoPoint { type Boxed = :: mtproto :: InputMedia ; fn into_boxed ( self ) -> :: mtproto :: InputMedia { :: mtproto :: InputMedia :: GeoPoint ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputMediaGifExternal`\n\n```text\ninputMediaGifExternal#4843b0fd url:string q:string = InputMedia;\n```\n" ] pub struct GifExternal { pub url : :: mtproto :: string , pub q : :: mtproto :: string , } impl :: BareSerialize for GifExternal { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GifExternal { ref url , ref q } = self ; _ser . write_bare :: < :: mtproto :: string > ( url ) ? ; _ser . write_bare :: < :: mtproto :: string > ( q ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for GifExternal { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( GifExternal { url : _de . read_bare :: < :: mtproto :: string > ( ) ? , q : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for GifExternal { type Boxed = :: mtproto :: InputMedia ; fn into_boxed ( self ) -> :: mtproto :: InputMedia { :: mtproto :: InputMedia :: GifExternal ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputMediaInvoice`\n\n```text\ninputMediaInvoice#f4e096c3 flags:# title:string description:string photo:flags.0?InputWebDocument invoice:Invoice payload:bytes provider:string provider_data:DataJSON start_param:string = InputMedia;\n```\n" ] pub struct Invoice { pub title : :: mtproto :: string , pub description : :: mtproto :: string , pub photo : Option < :: mtproto :: InputWebDocument > , pub invoice : :: mtproto :: Invoice , pub payload : :: mtproto :: bytes , pub provider : :: mtproto :: string , pub provider_data : :: mtproto :: DataJSON , pub start_param : :: mtproto :: string , } impl :: BareSerialize for Invoice { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Invoice { ref title , ref description , ref photo , ref invoice , ref payload , ref provider , ref provider_data , ref start_param } = self ; let mut _flags = 0i32 ; if photo . is_some ( ) { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: string > ( title ) ? ; _ser . write_bare :: < :: mtproto :: string > ( description ) ? ; if let & Some ( ref inner ) = photo { _ser . write_boxed :: < :: mtproto :: InputWebDocument > ( inner ) ? ; } _ser . write_boxed :: < :: mtproto :: Invoice > ( invoice ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( payload ) ? ; _ser . write_bare :: < :: mtproto :: string > ( provider ) ? ; _ser . write_boxed :: < :: mtproto :: DataJSON > ( provider_data ) ? ; _ser . write_bare :: < :: mtproto :: string > ( start_param ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Invoice { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( Invoice { title : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _de . read_bare :: < :: mtproto :: string > ( ) ? } , description : _de . read_bare :: < :: mtproto :: string > ( ) ? , photo : if _flags & ( 1 << 0u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: InputWebDocument > ( ) ? ) } else { None } , invoice : _de . read_boxed :: < :: mtproto :: Invoice > ( ) ? , payload : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , provider : _de . read_bare :: < :: mtproto :: string > ( ) ? , provider_data : _de . read_boxed :: < :: mtproto :: DataJSON > ( ) ? , start_param : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for Invoice { type Boxed = :: mtproto :: InputMedia ; fn into_boxed ( self ) -> :: mtproto :: InputMedia { :: mtproto :: InputMedia :: Invoice ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputMediaPhoto`\n\n```text\ninputMediaPhoto#81fa373a flags:# id:InputPhoto caption:string ttl_seconds:flags.0?int = InputMedia;\n```\n" ] pub struct Photo { pub id : :: mtproto :: InputPhoto , pub caption : :: mtproto :: string , pub ttl_seconds : Option < :: mtproto :: int > , } impl :: BareSerialize for Photo { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Photo { ref id , ref caption , ref ttl_seconds } = self ; let mut _flags = 0i32 ; if ttl_seconds . is_some ( ) { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_boxed :: < :: mtproto :: InputPhoto > ( id ) ? ; _ser . write_bare :: < :: mtproto :: string > ( caption ) ? ; if let & Some ( ref inner ) = ttl_seconds { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for Photo { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( Photo { id : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _de . read_boxed :: < :: mtproto :: InputPhoto > ( ) ? } , caption : _de . read_bare :: < :: mtproto :: string > ( ) ? , ttl_seconds : if _flags & ( 1 << 0u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for Photo { type Boxed = :: mtproto :: InputMedia ; fn into_boxed ( self ) -> :: mtproto :: InputMedia { :: mtproto :: InputMedia :: Photo ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputMediaPhotoExternal`\n\n```text\ninputMediaPhotoExternal#922aec1 flags:# url:string caption:string ttl_seconds:flags.0?int = InputMedia;\n```\n" ] pub struct PhotoExternal { pub url : :: mtproto :: string , pub caption : :: mtproto :: string , pub ttl_seconds : Option < :: mtproto :: int > , } impl :: BareSerialize for PhotoExternal { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & PhotoExternal { ref url , ref caption , ref ttl_seconds } = self ; let mut _flags = 0i32 ; if ttl_seconds . is_some ( ) { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: string > ( url ) ? ; _ser . write_bare :: < :: mtproto :: string > ( caption ) ? ; if let & Some ( ref inner ) = ttl_seconds { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for PhotoExternal { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( PhotoExternal { url : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _de . read_bare :: < :: mtproto :: string > ( ) ? } , caption : _de . read_bare :: < :: mtproto :: string > ( ) ? , ttl_seconds : if _flags & ( 1 << 0u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for PhotoExternal { type Boxed = :: mtproto :: InputMedia ; fn into_boxed ( self ) -> :: mtproto :: InputMedia { :: mtproto :: InputMedia :: PhotoExternal ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputMediaUploadedDocument`\n\n```text\ninputMediaUploadedDocument#e39621fd flags:# nosound_video:flags.3?true file:InputFile thumb:flags.2?InputFile mime_type:string attributes:Vector<DocumentAttribute> caption:string stickers:flags.0?Vector<InputDocument> ttl_seconds:flags.1?int = InputMedia;\n```\n" ] pub struct UploadedDocument { pub nosound_video : bool , pub file : :: mtproto :: InputFile , pub thumb : Option < :: mtproto :: InputFile > , pub mime_type : :: mtproto :: string , pub attributes : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: DocumentAttribute > , pub caption : :: mtproto :: string , pub stickers : Option < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputDocument > > , pub ttl_seconds : Option < :: mtproto :: int > , } impl :: BareSerialize for UploadedDocument { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & UploadedDocument { nosound_video , ref file , ref thumb , ref mime_type , ref attributes , ref caption , ref stickers , ref ttl_seconds } = self ; let mut _flags = 0i32 ; if nosound_video { _flags |= 1 << 3u32 ; } if thumb . is_some ( ) { _flags |= 1 << 2u32 ; } if stickers . is_some ( ) { _flags |= 1 << 0u32 ; } if ttl_seconds . is_some ( ) { _flags |= 1 << 1u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_boxed :: < :: mtproto :: InputFile > ( file ) ? ; if let & Some ( ref inner ) = thumb { _ser . write_boxed :: < :: mtproto :: InputFile > ( inner ) ? ; } _ser . write_bare :: < :: mtproto :: string > ( mime_type ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: DocumentAttribute > > ( attributes ) ? ; _ser . write_bare :: < :: mtproto :: string > ( caption ) ? ; if let & Some ( ref inner ) = stickers { _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputDocument > > ( inner ) ? ; } if let & Some ( ref inner ) = ttl_seconds { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for UploadedDocument { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( UploadedDocument { nosound_video : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 3u32 ) != 0 } , file : _de . read_boxed :: < :: mtproto :: InputFile > ( ) ? , thumb : if _flags & ( 1 << 2u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: InputFile > ( ) ? ) } else { None } , mime_type : _de . read_bare :: < :: mtproto :: string > ( ) ? , attributes : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: DocumentAttribute > > ( ) ? , caption : _de . read_bare :: < :: mtproto :: string > ( ) ? , stickers : if _flags & ( 1 << 0u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputDocument > > ( ) ? ) } else { None } , ttl_seconds : if _flags & ( 1 << 1u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for UploadedDocument { type Boxed = :: mtproto :: InputMedia ; fn into_boxed ( self ) -> :: mtproto :: InputMedia { :: mtproto :: InputMedia :: UploadedDocument ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputMediaUploadedPhoto`\n\n```text\ninputMediaUploadedPhoto#2f37e231 flags:# file:InputFile caption:string stickers:flags.0?Vector<InputDocument> ttl_seconds:flags.1?int = InputMedia;\n```\n" ] pub struct UploadedPhoto { pub file : :: mtproto :: InputFile , pub caption : :: mtproto :: string , pub stickers : Option < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputDocument > > , pub ttl_seconds : Option < :: mtproto :: int > , } impl :: BareSerialize for UploadedPhoto { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & UploadedPhoto { ref file , ref caption , ref stickers , ref ttl_seconds } = self ; let mut _flags = 0i32 ; if stickers . is_some ( ) { _flags |= 1 << 0u32 ; } if ttl_seconds . is_some ( ) { _flags |= 1 << 1u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_boxed :: < :: mtproto :: InputFile > ( file ) ? ; _ser . write_bare :: < :: mtproto :: string > ( caption ) ? ; if let & Some ( ref inner ) = stickers { _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputDocument > > ( inner ) ? ; } if let & Some ( ref inner ) = ttl_seconds { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for UploadedPhoto { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( UploadedPhoto { file : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _de . read_boxed :: < :: mtproto :: InputFile > ( ) ? } , caption : _de . read_bare :: < :: mtproto :: string > ( ) ? , stickers : if _flags & ( 1 << 0u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputDocument > > ( ) ? ) } else { None } , ttl_seconds : if _flags & ( 1 << 1u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for UploadedPhoto { type Boxed = :: mtproto :: InputMedia ; fn into_boxed ( self ) -> :: mtproto :: InputMedia { :: mtproto :: InputMedia :: UploadedPhoto ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputMediaVenue`\n\n```text\ninputMediaVenue#c13d1c11 geo_point:InputGeoPoint title:string address:string provider:string venue_id:string venue_type:string = InputMedia;\n```\n" ] pub struct Venue { pub geo_point : :: mtproto :: InputGeoPoint , pub title : :: mtproto :: string , pub address : :: mtproto :: string , pub provider : :: mtproto :: string , pub venue_id : :: mtproto :: string , pub venue_type : :: mtproto :: string , } impl :: BareSerialize for Venue { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Venue { ref geo_point , ref title , ref address , ref provider , ref venue_id , ref venue_type } = self ; _ser . write_boxed :: < :: mtproto :: InputGeoPoint > ( geo_point ) ? ; _ser . write_bare :: < :: mtproto :: string > ( title ) ? ; _ser . write_bare :: < :: mtproto :: string > ( address ) ? ; _ser . write_bare :: < :: mtproto :: string > ( provider ) ? ; _ser . write_bare :: < :: mtproto :: string > ( venue_id ) ? ; _ser . write_bare :: < :: mtproto :: string > ( venue_type ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Venue { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Venue { geo_point : _de . read_boxed :: < :: mtproto :: InputGeoPoint > ( ) ? , title : _de . read_bare :: < :: mtproto :: string > ( ) ? , address : _de . read_bare :: < :: mtproto :: string > ( ) ? , provider : _de . read_bare :: < :: mtproto :: string > ( ) ? , venue_id : _de . read_bare :: < :: mtproto :: string > ( ) ? , venue_type : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for Venue { type Boxed = :: mtproto :: InputMedia ; fn into_boxed ( self ) -> :: mtproto :: InputMedia { :: mtproto :: InputMedia :: Venue ( self ) } } } pub mod input_messages_filter { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputMessagesFilterPhoneCalls`\n\n```text\ninputMessagesFilterPhoneCalls#80c99768 flags:# missed:flags.0?true = MessagesFilter;\n```\n" ] pub struct PhoneCalls { pub missed : bool , } impl :: BareSerialize for PhoneCalls { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & PhoneCalls { missed } = self ; let mut _flags = 0i32 ; if missed { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for PhoneCalls { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( PhoneCalls { missed : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 0u32 ) != 0 } , } ) } } impl :: IntoBoxed for PhoneCalls { type Boxed = :: mtproto :: MessagesFilter ; fn into_boxed ( self ) -> :: mtproto :: MessagesFilter { :: mtproto :: MessagesFilter :: PhoneCalls ( self ) } } } pub mod input_notify { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputNotifyPeer`\n\n```text\ninputNotifyPeer#b8bc5b0c peer:InputPeer = InputNotifyPeer;\n```\n" ] pub struct Peer { pub peer : :: mtproto :: InputPeer , } impl :: BareSerialize for Peer { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Peer { ref peer } = self ; _ser . write_boxed :: < :: mtproto :: InputPeer > ( peer ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Peer { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Peer { peer : _de . read_boxed :: < :: mtproto :: InputPeer > ( ) ? , } ) } } impl :: IntoBoxed for Peer { type Boxed = :: mtproto :: InputNotifyPeer ; fn into_boxed ( self ) -> :: mtproto :: InputNotifyPeer { :: mtproto :: InputNotifyPeer :: Peer ( self ) } } } pub mod input_payment_credentials { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputPaymentCredentialsAndroidPay`\n\n```text\ninputPaymentCredentialsAndroidPay#795667a6 payment_token:DataJSON = InputPaymentCredentials;\n```\n" ] pub struct AndroidPay { pub payment_token : :: mtproto :: DataJSON , } impl :: BareSerialize for AndroidPay { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & AndroidPay { ref payment_token } = self ; _ser . write_boxed :: < :: mtproto :: DataJSON > ( payment_token ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for AndroidPay { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( AndroidPay { payment_token : _de . read_boxed :: < :: mtproto :: DataJSON > ( ) ? , } ) } } impl :: IntoBoxed for AndroidPay { type Boxed = :: mtproto :: InputPaymentCredentials ; fn into_boxed ( self ) -> :: mtproto :: InputPaymentCredentials { :: mtproto :: InputPaymentCredentials :: AndroidPay ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputPaymentCredentialsApplePay`\n\n```text\ninputPaymentCredentialsApplePay#aa1c39f payment_data:DataJSON = InputPaymentCredentials;\n```\n" ] pub struct ApplePay { pub payment_data : :: mtproto :: DataJSON , } impl :: BareSerialize for ApplePay { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ApplePay { ref payment_data } = self ; _ser . write_boxed :: < :: mtproto :: DataJSON > ( payment_data ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ApplePay { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ApplePay { payment_data : _de . read_boxed :: < :: mtproto :: DataJSON > ( ) ? , } ) } } impl :: IntoBoxed for ApplePay { type Boxed = :: mtproto :: InputPaymentCredentials ; fn into_boxed ( self ) -> :: mtproto :: InputPaymentCredentials { :: mtproto :: InputPaymentCredentials :: ApplePay ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputPaymentCredentials`\n\n```text\ninputPaymentCredentials#3417d728 flags:# save:flags.0?true data:DataJSON = InputPaymentCredentials;\n```\n" ] pub struct InputPaymentCredentials { pub save : bool , pub data : :: mtproto :: DataJSON , } impl :: BareSerialize for InputPaymentCredentials { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & InputPaymentCredentials { save , ref data } = self ; let mut _flags = 0i32 ; if save { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_boxed :: < :: mtproto :: DataJSON > ( data ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for InputPaymentCredentials { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( InputPaymentCredentials { save : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 0u32 ) != 0 } , data : _de . read_boxed :: < :: mtproto :: DataJSON > ( ) ? , } ) } } impl :: IntoBoxed for InputPaymentCredentials { type Boxed = :: mtproto :: InputPaymentCredentials ; fn into_boxed ( self ) -> :: mtproto :: InputPaymentCredentials { :: mtproto :: InputPaymentCredentials :: InputPaymentCredentials ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputPaymentCredentialsSaved`\n\n```text\ninputPaymentCredentialsSaved#c10eb2cf id:string tmp_password:bytes = InputPaymentCredentials;\n```\n" ] pub struct Saved { pub id : :: mtproto :: string , pub tmp_password : :: mtproto :: bytes , } impl :: BareSerialize for Saved { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Saved { ref id , ref tmp_password } = self ; _ser . write_bare :: < :: mtproto :: string > ( id ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( tmp_password ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Saved { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Saved { id : _de . read_bare :: < :: mtproto :: string > ( ) ? , tmp_password : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , } ) } } impl :: IntoBoxed for Saved { type Boxed = :: mtproto :: InputPaymentCredentials ; fn into_boxed ( self ) -> :: mtproto :: InputPaymentCredentials { :: mtproto :: InputPaymentCredentials :: Saved ( self ) } } } pub mod input_peer { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputPeerChannel`\n\n```text\ninputPeerChannel#20adaef8 channel_id:int access_hash:long = InputPeer;\n```\n" ] pub struct Channel { pub channel_id : :: mtproto :: int , pub access_hash : :: mtproto :: long , } impl :: BareSerialize for Channel { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Channel { ref channel_id , ref access_hash } = self ; _ser . write_bare :: < :: mtproto :: int > ( channel_id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( access_hash ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Channel { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Channel { channel_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , access_hash : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for Channel { type Boxed = :: mtproto :: InputPeer ; fn into_boxed ( self ) -> :: mtproto :: InputPeer { :: mtproto :: InputPeer :: Channel ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputPeerChat`\n\n```text\ninputPeerChat#179be863 chat_id:int = InputPeer;\n```\n" ] pub struct Chat { pub chat_id : :: mtproto :: int , } impl :: BareSerialize for Chat { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Chat { ref chat_id } = self ; _ser . write_bare :: < :: mtproto :: int > ( chat_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Chat { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Chat { chat_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for Chat { type Boxed = :: mtproto :: InputPeer ; fn into_boxed ( self ) -> :: mtproto :: InputPeer { :: mtproto :: InputPeer :: Chat ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputPeerUser`\n\n```text\ninputPeerUser#7b8e7de6 user_id:int access_hash:long = InputPeer;\n```\n" ] pub struct User { pub user_id : :: mtproto :: int , pub access_hash : :: mtproto :: long , } impl :: BareSerialize for User { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & User { ref user_id , ref access_hash } = self ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( access_hash ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for User { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( User { user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , access_hash : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for User { type Boxed = :: mtproto :: InputPeer ; fn into_boxed ( self ) -> :: mtproto :: InputPeer { :: mtproto :: InputPeer :: User ( self ) } } } pub mod input_peer_notify_events { } pub mod input_peer_notify_settings { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputPeerNotifySettings`\n\n```text\ninputPeerNotifySettings#38935eb2 flags:# show_previews:flags.0?true silent:flags.1?true mute_until:int sound:string = InputPeerNotifySettings;\n```\n" ] pub struct InputPeerNotifySettings { pub show_previews : bool , pub silent : bool , pub mute_until : :: mtproto :: int , pub sound : :: mtproto :: string , } impl :: BareSerialize for InputPeerNotifySettings { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & InputPeerNotifySettings { show_previews , silent , ref mute_until , ref sound } = self ; let mut _flags = 0i32 ; if show_previews { _flags |= 1 << 0u32 ; } if silent { _flags |= 1 << 1u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: int > ( mute_until ) ? ; _ser . write_bare :: < :: mtproto :: string > ( sound ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for InputPeerNotifySettings { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( InputPeerNotifySettings { show_previews : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 0u32 ) != 0 } , silent : _flags & ( 1 << 1u32 ) != 0 , mute_until : _de . read_bare :: < :: mtproto :: int > ( ) ? , sound : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for InputPeerNotifySettings { type Boxed = :: mtproto :: InputPeerNotifySettings ; fn into_boxed ( self ) -> :: mtproto :: InputPeerNotifySettings { :: mtproto :: InputPeerNotifySettings :: InputPeerNotifySettings ( self ) } } } pub mod input_phone_call { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputPhoneCall`\n\n```text\ninputPhoneCall#1e36fded id:long access_hash:long = InputPhoneCall;\n```\n" ] pub struct InputPhoneCall { pub id : :: mtproto :: long , pub access_hash : :: mtproto :: long , } impl :: BareSerialize for InputPhoneCall { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & InputPhoneCall { ref id , ref access_hash } = self ; _ser . write_bare :: < :: mtproto :: long > ( id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( access_hash ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for InputPhoneCall { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( InputPhoneCall { id : _de . read_bare :: < :: mtproto :: long > ( ) ? , access_hash : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for InputPhoneCall { type Boxed = :: mtproto :: InputPhoneCall ; fn into_boxed ( self ) -> :: mtproto :: InputPhoneCall { :: mtproto :: InputPhoneCall :: InputPhoneCall ( self ) } } } pub mod input_phone_contact { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputPhoneContact`\n\n```text\ninputPhoneContact#f392b7f4 client_id:long phone:string first_name:string last_name:string = InputContact;\n```\n" ] pub struct InputPhoneContact { pub client_id : :: mtproto :: long , pub phone : :: mtproto :: string , pub first_name : :: mtproto :: string , pub last_name : :: mtproto :: string , } impl :: BareSerialize for InputPhoneContact { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & InputPhoneContact { ref client_id , ref phone , ref first_name , ref last_name } = self ; _ser . write_bare :: < :: mtproto :: long > ( client_id ) ? ; _ser . write_bare :: < :: mtproto :: string > ( phone ) ? ; _ser . write_bare :: < :: mtproto :: string > ( first_name ) ? ; _ser . write_bare :: < :: mtproto :: string > ( last_name ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for InputPhoneContact { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( InputPhoneContact { client_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , phone : _de . read_bare :: < :: mtproto :: string > ( ) ? , first_name : _de . read_bare :: < :: mtproto :: string > ( ) ? , last_name : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for InputPhoneContact { type Boxed = :: mtproto :: InputContact ; fn into_boxed ( self ) -> :: mtproto :: InputContact { :: mtproto :: InputContact :: InputPhoneContact ( self ) } } } pub mod input_photo { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputPhoto`\n\n```text\ninputPhoto#fb95c6c4 id:long access_hash:long = InputPhoto;\n```\n" ] pub struct InputPhoto { pub id : :: mtproto :: long , pub access_hash : :: mtproto :: long , } impl :: BareSerialize for InputPhoto { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & InputPhoto { ref id , ref access_hash } = self ; _ser . write_bare :: < :: mtproto :: long > ( id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( access_hash ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for InputPhoto { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( InputPhoto { id : _de . read_bare :: < :: mtproto :: long > ( ) ? , access_hash : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for InputPhoto { type Boxed = :: mtproto :: InputPhoto ; fn into_boxed ( self ) -> :: mtproto :: InputPhoto { :: mtproto :: InputPhoto :: InputPhoto ( self ) } } } pub mod input_privacy_key { } pub mod input_privacy_value { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputPrivacyValueAllowUsers`\n\n```text\ninputPrivacyValueAllowUsers#131cc67f users:Vector<InputUser> = InputPrivacyRule;\n```\n" ] pub struct AllowUsers { pub users : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputUser > , } impl :: BareSerialize for AllowUsers { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & AllowUsers { ref users } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputUser > > ( users ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for AllowUsers { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( AllowUsers { users : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputUser > > ( ) ? , } ) } } impl :: IntoBoxed for AllowUsers { type Boxed = :: mtproto :: InputPrivacyRule ; fn into_boxed ( self ) -> :: mtproto :: InputPrivacyRule { :: mtproto :: InputPrivacyRule :: AllowUsers ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputPrivacyValueDisallowUsers`\n\n```text\ninputPrivacyValueDisallowUsers#90110467 users:Vector<InputUser> = InputPrivacyRule;\n```\n" ] pub struct DisallowUsers { pub users : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputUser > , } impl :: BareSerialize for DisallowUsers { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & DisallowUsers { ref users } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputUser > > ( users ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for DisallowUsers { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( DisallowUsers { users : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputUser > > ( ) ? , } ) } } impl :: IntoBoxed for DisallowUsers { type Boxed = :: mtproto :: InputPrivacyRule ; fn into_boxed ( self ) -> :: mtproto :: InputPrivacyRule { :: mtproto :: InputPrivacyRule :: DisallowUsers ( self ) } } } pub mod input_report_reason { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputReportReasonOther`\n\n```text\ninputReportReasonOther#e1746d0a text:string = ReportReason;\n```\n" ] pub struct Other { pub text : :: mtproto :: string , } impl :: BareSerialize for Other { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Other { ref text } = self ; _ser . write_bare :: < :: mtproto :: string > ( text ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Other { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Other { text : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for Other { type Boxed = :: mtproto :: ReportReason ; fn into_boxed ( self ) -> :: mtproto :: ReportReason { :: mtproto :: ReportReason :: Other ( self ) } } } pub mod input_single_media { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputSingleMedia`\n\n```text\ninputSingleMedia#5eaa7809 media:InputMedia random_id:long = InputSingleMedia;\n```\n" ] pub struct InputSingleMedia { pub media : :: mtproto :: InputMedia , pub random_id : :: mtproto :: long , } impl :: BareSerialize for InputSingleMedia { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & InputSingleMedia { ref media , ref random_id } = self ; _ser . write_boxed :: < :: mtproto :: InputMedia > ( media ) ? ; _ser . write_bare :: < :: mtproto :: long > ( random_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for InputSingleMedia { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( InputSingleMedia { media : _de . read_boxed :: < :: mtproto :: InputMedia > ( ) ? , random_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for InputSingleMedia { type Boxed = :: mtproto :: InputSingleMedia ; fn into_boxed ( self ) -> :: mtproto :: InputSingleMedia { :: mtproto :: InputSingleMedia :: InputSingleMedia ( self ) } } } pub mod input_sticker_set { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputStickerSetID`\n\n```text\ninputStickerSetID#9de7a269 id:long access_hash:long = InputStickerSet;\n```\n" ] pub struct ID { pub id : :: mtproto :: long , pub access_hash : :: mtproto :: long , } impl :: BareSerialize for ID { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ID { ref id , ref access_hash } = self ; _ser . write_bare :: < :: mtproto :: long > ( id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( access_hash ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ID { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ID { id : _de . read_bare :: < :: mtproto :: long > ( ) ? , access_hash : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for ID { type Boxed = :: mtproto :: InputStickerSet ; fn into_boxed ( self ) -> :: mtproto :: InputStickerSet { :: mtproto :: InputStickerSet :: ID ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputStickerSetShortName`\n\n```text\ninputStickerSetShortName#861cc8a0 short_name:string = InputStickerSet;\n```\n" ] pub struct ShortName { pub short_name : :: mtproto :: string , } impl :: BareSerialize for ShortName { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ShortName { ref short_name } = self ; _ser . write_bare :: < :: mtproto :: string > ( short_name ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ShortName { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ShortName { short_name : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for ShortName { type Boxed = :: mtproto :: InputStickerSet ; fn into_boxed ( self ) -> :: mtproto :: InputStickerSet { :: mtproto :: InputStickerSet :: ShortName ( self ) } } } pub mod input_sticker_set_item { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputStickerSetItem`\n\n```text\ninputStickerSetItem#ffa0a496 flags:# document:InputDocument emoji:string mask_coords:flags.0?MaskCoords = InputStickerSetItem;\n```\n" ] pub struct InputStickerSetItem { pub document : :: mtproto :: InputDocument , pub emoji : :: mtproto :: string , pub mask_coords : Option < :: mtproto :: MaskCoords > , } impl :: BareSerialize for InputStickerSetItem { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & InputStickerSetItem { ref document , ref emoji , ref mask_coords } = self ; let mut _flags = 0i32 ; if mask_coords . is_some ( ) { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_boxed :: < :: mtproto :: InputDocument > ( document ) ? ; _ser . write_bare :: < :: mtproto :: string > ( emoji ) ? ; if let & Some ( ref inner ) = mask_coords { _ser . write_boxed :: < :: mtproto :: MaskCoords > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for InputStickerSetItem { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( InputStickerSetItem { document : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _de . read_boxed :: < :: mtproto :: InputDocument > ( ) ? } , emoji : _de . read_bare :: < :: mtproto :: string > ( ) ? , mask_coords : if _flags & ( 1 << 0u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: MaskCoords > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for InputStickerSetItem { type Boxed = :: mtproto :: InputStickerSetItem ; fn into_boxed ( self ) -> :: mtproto :: InputStickerSetItem { :: mtproto :: InputStickerSetItem :: InputStickerSetItem ( self ) } } } pub mod input_stickered_media { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputStickeredMediaDocument`\n\n```text\ninputStickeredMediaDocument#438865b id:InputDocument = InputStickeredMedia;\n```\n" ] pub struct Document { pub id : :: mtproto :: InputDocument , } impl :: BareSerialize for Document { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Document { ref id } = self ; _ser . write_boxed :: < :: mtproto :: InputDocument > ( id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Document { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Document { id : _de . read_boxed :: < :: mtproto :: InputDocument > ( ) ? , } ) } } impl :: IntoBoxed for Document { type Boxed = :: mtproto :: InputStickeredMedia ; fn into_boxed ( self ) -> :: mtproto :: InputStickeredMedia { :: mtproto :: InputStickeredMedia :: Document ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputStickeredMediaPhoto`\n\n```text\ninputStickeredMediaPhoto#4a992157 id:InputPhoto = InputStickeredMedia;\n```\n" ] pub struct Photo { pub id : :: mtproto :: InputPhoto , } impl :: BareSerialize for Photo { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Photo { ref id } = self ; _ser . write_boxed :: < :: mtproto :: InputPhoto > ( id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Photo { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Photo { id : _de . read_boxed :: < :: mtproto :: InputPhoto > ( ) ? , } ) } } impl :: IntoBoxed for Photo { type Boxed = :: mtproto :: InputStickeredMedia ; fn into_boxed ( self ) -> :: mtproto :: InputStickeredMedia { :: mtproto :: InputStickeredMedia :: Photo ( self ) } } } pub mod input_user { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputUser`\n\n```text\ninputUser#d8292816 user_id:int access_hash:long = InputUser;\n```\n" ] pub struct InputUser { pub user_id : :: mtproto :: int , pub access_hash : :: mtproto :: long , } impl :: BareSerialize for InputUser { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & InputUser { ref user_id , ref access_hash } = self ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( access_hash ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for InputUser { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( InputUser { user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , access_hash : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for InputUser { type Boxed = :: mtproto :: InputUser ; fn into_boxed ( self ) -> :: mtproto :: InputUser { :: mtproto :: InputUser :: InputUser ( self ) } } } pub mod input_web_document { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputWebDocument`\n\n```text\ninputWebDocument#9bed434d url:string size:int mime_type:string attributes:Vector<DocumentAttribute> = InputWebDocument;\n```\n" ] pub struct InputWebDocument { pub url : :: mtproto :: string , pub size : :: mtproto :: int , pub mime_type : :: mtproto :: string , pub attributes : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: DocumentAttribute > , } impl :: BareSerialize for InputWebDocument { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & InputWebDocument { ref url , ref size , ref mime_type , ref attributes } = self ; _ser . write_bare :: < :: mtproto :: string > ( url ) ? ; _ser . write_bare :: < :: mtproto :: int > ( size ) ? ; _ser . write_bare :: < :: mtproto :: string > ( mime_type ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: DocumentAttribute > > ( attributes ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for InputWebDocument { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( InputWebDocument { url : _de . read_bare :: < :: mtproto :: string > ( ) ? , size : _de . read_bare :: < :: mtproto :: int > ( ) ? , mime_type : _de . read_bare :: < :: mtproto :: string > ( ) ? , attributes : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: DocumentAttribute > > ( ) ? , } ) } } impl :: IntoBoxed for InputWebDocument { type Boxed = :: mtproto :: InputWebDocument ; fn into_boxed ( self ) -> :: mtproto :: InputWebDocument { :: mtproto :: InputWebDocument :: InputWebDocument ( self ) } } } pub mod input_web_file_location { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputWebFileLocation`\n\n```text\ninputWebFileLocation#c239d686 url:string access_hash:long = InputWebFileLocation;\n```\n" ] pub struct InputWebFileLocation { pub url : :: mtproto :: string , pub access_hash : :: mtproto :: long , } impl :: BareSerialize for InputWebFileLocation { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & InputWebFileLocation { ref url , ref access_hash } = self ; _ser . write_bare :: < :: mtproto :: string > ( url ) ? ; _ser . write_bare :: < :: mtproto :: long > ( access_hash ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for InputWebFileLocation { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( InputWebFileLocation { url : _de . read_bare :: < :: mtproto :: string > ( ) ? , access_hash : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for InputWebFileLocation { type Boxed = :: mtproto :: InputWebFileLocation ; fn into_boxed ( self ) -> :: mtproto :: InputWebFileLocation { :: mtproto :: InputWebFileLocation :: InputWebFileLocation ( self ) } } } pub mod invoice { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `invoice`\n\n```text\ninvoice#c30aa358 flags:# test:flags.0?true name_requested:flags.1?true phone_requested:flags.2?true email_requested:flags.3?true shipping_address_requested:flags.4?true flexible:flags.5?true phone_to_provider:flags.6?true email_to_provider:flags.7?true currency:string prices:Vector<LabeledPrice> = Invoice;\n```\n" ] pub struct Invoice { pub test : bool , pub name_requested : bool , pub phone_requested : bool , pub email_requested : bool , pub shipping_address_requested : bool , pub flexible : bool , pub phone_to_provider : bool , pub email_to_provider : bool , pub currency : :: mtproto :: string , pub prices : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: LabeledPrice > , } impl :: BareSerialize for Invoice { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Invoice { test , name_requested , phone_requested , email_requested , shipping_address_requested , flexible , phone_to_provider , email_to_provider , ref currency , ref prices } = self ; let mut _flags = 0i32 ; if test { _flags |= 1 << 0u32 ; } if name_requested { _flags |= 1 << 1u32 ; } if phone_requested { _flags |= 1 << 2u32 ; } if email_requested { _flags |= 1 << 3u32 ; } if shipping_address_requested { _flags |= 1 << 4u32 ; } if flexible { _flags |= 1 << 5u32 ; } if phone_to_provider { _flags |= 1 << 6u32 ; } if email_to_provider { _flags |= 1 << 7u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: string > ( currency ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: LabeledPrice > > ( prices ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Invoice { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( Invoice { test : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 0u32 ) != 0 } , name_requested : _flags & ( 1 << 1u32 ) != 0 , phone_requested : _flags & ( 1 << 2u32 ) != 0 , email_requested : _flags & ( 1 << 3u32 ) != 0 , shipping_address_requested : _flags & ( 1 << 4u32 ) != 0 , flexible : _flags & ( 1 << 5u32 ) != 0 , phone_to_provider : _flags & ( 1 << 6u32 ) != 0 , email_to_provider : _flags & ( 1 << 7u32 ) != 0 , currency : _de . read_bare :: < :: mtproto :: string > ( ) ? , prices : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: LabeledPrice > > ( ) ? , } ) } } impl :: IntoBoxed for Invoice { type Boxed = :: mtproto :: Invoice ; fn into_boxed ( self ) -> :: mtproto :: Invoice { :: mtproto :: Invoice :: Invoice ( self ) } } } pub mod ip_port { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `ipPort`\n\n```text\nipPort ipv4:int port:int = IpPort;\n```\n" ] pub struct IpPort { pub ipv4 : :: mtproto :: int , pub port : :: mtproto :: int , } impl :: BareSerialize for IpPort { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & IpPort { ref ipv4 , ref port } = self ; _ser . write_bare :: < :: mtproto :: int > ( ipv4 ) ? ; _ser . write_bare :: < :: mtproto :: int > ( port ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for IpPort { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( IpPort { ipv4 : _de . read_bare :: < :: mtproto :: int > ( ) ? , port : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } } pub mod keyboard_button { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `keyboardButtonBuy`\n\n```text\nkeyboardButtonBuy#afd93fbb text:string = KeyboardButton;\n```\n" ] pub struct Buy { pub text : :: mtproto :: string , } impl :: BareSerialize for Buy { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Buy { ref text } = self ; _ser . write_bare :: < :: mtproto :: string > ( text ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Buy { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Buy { text : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for Buy { type Boxed = :: mtproto :: KeyboardButton ; fn into_boxed ( self ) -> :: mtproto :: KeyboardButton { :: mtproto :: KeyboardButton :: Buy ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `keyboardButtonCallback`\n\n```text\nkeyboardButtonCallback#683a5e46 text:string data:bytes = KeyboardButton;\n```\n" ] pub struct Callback { pub text : :: mtproto :: string , pub data : :: mtproto :: bytes , } impl :: BareSerialize for Callback { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Callback { ref text , ref data } = self ; _ser . write_bare :: < :: mtproto :: string > ( text ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( data ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Callback { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Callback { text : _de . read_bare :: < :: mtproto :: string > ( ) ? , data : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , } ) } } impl :: IntoBoxed for Callback { type Boxed = :: mtproto :: KeyboardButton ; fn into_boxed ( self ) -> :: mtproto :: KeyboardButton { :: mtproto :: KeyboardButton :: Callback ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `keyboardButtonGame`\n\n```text\nkeyboardButtonGame#50f41ccf text:string = KeyboardButton;\n```\n" ] pub struct Game { pub text : :: mtproto :: string , } impl :: BareSerialize for Game { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Game { ref text } = self ; _ser . write_bare :: < :: mtproto :: string > ( text ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Game { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Game { text : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for Game { type Boxed = :: mtproto :: KeyboardButton ; fn into_boxed ( self ) -> :: mtproto :: KeyboardButton { :: mtproto :: KeyboardButton :: Game ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `keyboardButton`\n\n```text\nkeyboardButton#a2fa4880 text:string = KeyboardButton;\n```\n" ] pub struct KeyboardButton { pub text : :: mtproto :: string , } impl :: BareSerialize for KeyboardButton { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & KeyboardButton { ref text } = self ; _ser . write_bare :: < :: mtproto :: string > ( text ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for KeyboardButton { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( KeyboardButton { text : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for KeyboardButton { type Boxed = :: mtproto :: KeyboardButton ; fn into_boxed ( self ) -> :: mtproto :: KeyboardButton { :: mtproto :: KeyboardButton :: KeyboardButton ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `keyboardButtonRequestGeoLocation`\n\n```text\nkeyboardButtonRequestGeoLocation#fc796b3f text:string = KeyboardButton;\n```\n" ] pub struct RequestGeoLocation { pub text : :: mtproto :: string , } impl :: BareSerialize for RequestGeoLocation { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & RequestGeoLocation { ref text } = self ; _ser . write_bare :: < :: mtproto :: string > ( text ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for RequestGeoLocation { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( RequestGeoLocation { text : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for RequestGeoLocation { type Boxed = :: mtproto :: KeyboardButton ; fn into_boxed ( self ) -> :: mtproto :: KeyboardButton { :: mtproto :: KeyboardButton :: RequestGeoLocation ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `keyboardButtonRequestPhone`\n\n```text\nkeyboardButtonRequestPhone#b16a6c29 text:string = KeyboardButton;\n```\n" ] pub struct RequestPhone { pub text : :: mtproto :: string , } impl :: BareSerialize for RequestPhone { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & RequestPhone { ref text } = self ; _ser . write_bare :: < :: mtproto :: string > ( text ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for RequestPhone { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( RequestPhone { text : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for RequestPhone { type Boxed = :: mtproto :: KeyboardButton ; fn into_boxed ( self ) -> :: mtproto :: KeyboardButton { :: mtproto :: KeyboardButton :: RequestPhone ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `keyboardButtonSwitchInline`\n\n```text\nkeyboardButtonSwitchInline#568a748 flags:# same_peer:flags.0?true text:string query:string = KeyboardButton;\n```\n" ] pub struct SwitchInline { pub same_peer : bool , pub text : :: mtproto :: string , pub query : :: mtproto :: string , } impl :: BareSerialize for SwitchInline { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & SwitchInline { same_peer , ref text , ref query } = self ; let mut _flags = 0i32 ; if same_peer { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: string > ( text ) ? ; _ser . write_bare :: < :: mtproto :: string > ( query ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for SwitchInline { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( SwitchInline { same_peer : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 0u32 ) != 0 } , text : _de . read_bare :: < :: mtproto :: string > ( ) ? , query : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for SwitchInline { type Boxed = :: mtproto :: KeyboardButton ; fn into_boxed ( self ) -> :: mtproto :: KeyboardButton { :: mtproto :: KeyboardButton :: SwitchInline ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `keyboardButtonUrl`\n\n```text\nkeyboardButtonUrl#258aff05 text:string url:string = KeyboardButton;\n```\n" ] pub struct Url { pub text : :: mtproto :: string , pub url : :: mtproto :: string , } impl :: BareSerialize for Url { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Url { ref text , ref url } = self ; _ser . write_bare :: < :: mtproto :: string > ( text ) ? ; _ser . write_bare :: < :: mtproto :: string > ( url ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Url { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Url { text : _de . read_bare :: < :: mtproto :: string > ( ) ? , url : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for Url { type Boxed = :: mtproto :: KeyboardButton ; fn into_boxed ( self ) -> :: mtproto :: KeyboardButton { :: mtproto :: KeyboardButton :: Url ( self ) } } } pub mod keyboard_button_row { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `keyboardButtonRow`\n\n```text\nkeyboardButtonRow#77608b83 buttons:Vector<KeyboardButton> = KeyboardButtonRow;\n```\n" ] pub struct KeyboardButtonRow { pub buttons : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: KeyboardButton > , } impl :: BareSerialize for KeyboardButtonRow { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & KeyboardButtonRow { ref buttons } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: KeyboardButton > > ( buttons ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for KeyboardButtonRow { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( KeyboardButtonRow { buttons : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: KeyboardButton > > ( ) ? , } ) } } impl :: IntoBoxed for KeyboardButtonRow { type Boxed = :: mtproto :: KeyboardButtonRow ; fn into_boxed ( self ) -> :: mtproto :: KeyboardButtonRow { :: mtproto :: KeyboardButtonRow :: KeyboardButtonRow ( self ) } } } pub mod labeled_price { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `labeledPrice`\n\n```text\nlabeledPrice#cb296bf8 label:string amount:long = LabeledPrice;\n```\n" ] pub struct LabeledPrice { pub label : :: mtproto :: string , pub amount : :: mtproto :: long , } impl :: BareSerialize for LabeledPrice { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & LabeledPrice { ref label , ref amount } = self ; _ser . write_bare :: < :: mtproto :: string > ( label ) ? ; _ser . write_bare :: < :: mtproto :: long > ( amount ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for LabeledPrice { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( LabeledPrice { label : _de . read_bare :: < :: mtproto :: string > ( ) ? , amount : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for LabeledPrice { type Boxed = :: mtproto :: LabeledPrice ; fn into_boxed ( self ) -> :: mtproto :: LabeledPrice { :: mtproto :: LabeledPrice :: LabeledPrice ( self ) } } } pub mod lang_pack_difference { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `langPackDifference`\n\n```text\nlangPackDifference#f385c1f6 lang_code:string from_version:int version:int strings:Vector<LangPackString> = LangPackDifference;\n```\n" ] pub struct LangPackDifference { pub lang_code : :: mtproto :: string , pub from_version : :: mtproto :: int , pub version : :: mtproto :: int , pub strings : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: LangPackString > , } impl :: BareSerialize for LangPackDifference { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & LangPackDifference { ref lang_code , ref from_version , ref version , ref strings } = self ; _ser . write_bare :: < :: mtproto :: string > ( lang_code ) ? ; _ser . write_bare :: < :: mtproto :: int > ( from_version ) ? ; _ser . write_bare :: < :: mtproto :: int > ( version ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: LangPackString > > ( strings ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for LangPackDifference { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( LangPackDifference { lang_code : _de . read_bare :: < :: mtproto :: string > ( ) ? , from_version : _de . read_bare :: < :: mtproto :: int > ( ) ? , version : _de . read_bare :: < :: mtproto :: int > ( ) ? , strings : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: LangPackString > > ( ) ? , } ) } } impl :: IntoBoxed for LangPackDifference { type Boxed = :: mtproto :: LangPackDifference ; fn into_boxed ( self ) -> :: mtproto :: LangPackDifference { :: mtproto :: LangPackDifference :: LangPackDifference ( self ) } } } pub mod lang_pack_language { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `langPackLanguage`\n\n```text\nlangPackLanguage#117698f1 name:string native_name:string lang_code:string = LangPackLanguage;\n```\n" ] pub struct LangPackLanguage { pub name : :: mtproto :: string , pub native_name : :: mtproto :: string , pub lang_code : :: mtproto :: string , } impl :: BareSerialize for LangPackLanguage { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & LangPackLanguage { ref name , ref native_name , ref lang_code } = self ; _ser . write_bare :: < :: mtproto :: string > ( name ) ? ; _ser . write_bare :: < :: mtproto :: string > ( native_name ) ? ; _ser . write_bare :: < :: mtproto :: string > ( lang_code ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for LangPackLanguage { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( LangPackLanguage { name : _de . read_bare :: < :: mtproto :: string > ( ) ? , native_name : _de . read_bare :: < :: mtproto :: string > ( ) ? , lang_code : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for LangPackLanguage { type Boxed = :: mtproto :: LangPackLanguage ; fn into_boxed ( self ) -> :: mtproto :: LangPackLanguage { :: mtproto :: LangPackLanguage :: LangPackLanguage ( self ) } } } pub mod lang_pack_string { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `langPackStringDeleted`\n\n```text\nlangPackStringDeleted#2979eeb2 key:string = LangPackString;\n```\n" ] pub struct Deleted { pub key : :: mtproto :: string , } impl :: BareSerialize for Deleted { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Deleted { ref key } = self ; _ser . write_bare :: < :: mtproto :: string > ( key ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Deleted { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Deleted { key : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for Deleted { type Boxed = :: mtproto :: LangPackString ; fn into_boxed ( self ) -> :: mtproto :: LangPackString { :: mtproto :: LangPackString :: Deleted ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `langPackString`\n\n```text\nlangPackString#cad181f6 key:string value:string = LangPackString;\n```\n" ] pub struct LangPackString { pub key : :: mtproto :: string , pub value : :: mtproto :: string , } impl :: BareSerialize for LangPackString { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & LangPackString { ref key , ref value } = self ; _ser . write_bare :: < :: mtproto :: string > ( key ) ? ; _ser . write_bare :: < :: mtproto :: string > ( value ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for LangPackString { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( LangPackString { key : _de . read_bare :: < :: mtproto :: string > ( ) ? , value : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for LangPackString { type Boxed = :: mtproto :: LangPackString ; fn into_boxed ( self ) -> :: mtproto :: LangPackString { :: mtproto :: LangPackString :: LangPackString ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `langPackStringPluralized`\n\n```text\nlangPackStringPluralized#6c47ac9f flags:# key:string zero_value:flags.0?string one_value:flags.1?string two_value:flags.2?string few_value:flags.3?string many_value:flags.4?string other_value:string = LangPackString;\n```\n" ] pub struct Pluralized { pub key : :: mtproto :: string , pub zero_value : Option < :: mtproto :: string > , pub one_value : Option < :: mtproto :: string > , pub two_value : Option < :: mtproto :: string > , pub few_value : Option < :: mtproto :: string > , pub many_value : Option < :: mtproto :: string > , pub other_value : :: mtproto :: string , } impl :: BareSerialize for Pluralized { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Pluralized { ref key , ref zero_value , ref one_value , ref two_value , ref few_value , ref many_value , ref other_value } = self ; let mut _flags = 0i32 ; if zero_value . is_some ( ) { _flags |= 1 << 0u32 ; } if one_value . is_some ( ) { _flags |= 1 << 1u32 ; } if two_value . is_some ( ) { _flags |= 1 << 2u32 ; } if few_value . is_some ( ) { _flags |= 1 << 3u32 ; } if many_value . is_some ( ) { _flags |= 1 << 4u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: string > ( key ) ? ; if let & Some ( ref inner ) = zero_value { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = one_value { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = two_value { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = few_value { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = many_value { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } _ser . write_bare :: < :: mtproto :: string > ( other_value ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Pluralized { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( Pluralized { key : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _de . read_bare :: < :: mtproto :: string > ( ) ? } , zero_value : if _flags & ( 1 << 0u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , one_value : if _flags & ( 1 << 1u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , two_value : if _flags & ( 1 << 2u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , few_value : if _flags & ( 1 << 3u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , many_value : if _flags & ( 1 << 4u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , other_value : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for Pluralized { type Boxed = :: mtproto :: LangPackString ; fn into_boxed ( self ) -> :: mtproto :: LangPackString { :: mtproto :: LangPackString :: Pluralized ( self ) } } } pub mod manual { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `manual.BindAuthKeyInner`\n\n```text\nmanual.bind_auth_key_inner#75a3f765 nonce:long temp_auth_key_id:long perm_auth_key_id:long temp_session_id:long expires_at:int = manual.BindAuthKeyInner;\n```\n" ] pub enum BindAuthKeyInner { BindAuthKeyInner ( :: mtproto :: manual :: bind_auth_key_inner :: BindAuthKeyInner ) , } impl BindAuthKeyInner { pub fn expires_at ( & self ) -> & :: mtproto :: int { match self { & BindAuthKeyInner :: BindAuthKeyInner ( ref x ) => & x . expires_at , } } pub fn nonce ( & self ) -> & :: mtproto :: long { match self { & BindAuthKeyInner :: BindAuthKeyInner ( ref x ) => & x . nonce , } } pub fn perm_auth_key_id ( & self ) -> & :: mtproto :: long { match self { & BindAuthKeyInner :: BindAuthKeyInner ( ref x ) => & x . perm_auth_key_id , } } pub fn temp_auth_key_id ( & self ) -> & :: mtproto :: long { match self { & BindAuthKeyInner :: BindAuthKeyInner ( ref x ) => & x . temp_auth_key_id , } } pub fn temp_session_id ( & self ) -> & :: mtproto :: long { match self { & BindAuthKeyInner :: BindAuthKeyInner ( ref x ) => & x . temp_session_id , } } } impl :: BoxedSerialize for BindAuthKeyInner { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & BindAuthKeyInner :: BindAuthKeyInner ( ref x ) => ( :: ConstructorNumber ( 0x75a3f765 ) , x ) , } } } impl :: BoxedDeserialize for BindAuthKeyInner { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x75a3f765 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x75a3f765 ) => Ok ( BindAuthKeyInner :: BindAuthKeyInner ( _de . read_bare :: < :: mtproto :: manual :: bind_auth_key_inner :: BindAuthKeyInner > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `manual.GzipPacked`\n\n```text\nmanual.gzip_packed#3072cfa1 packed_data:bytes = manual.GzipPacked;\n```\n" ] pub enum GzipPacked { GzipPacked ( :: mtproto :: manual :: gzip_packed :: GzipPacked ) , } impl GzipPacked { pub fn packed_data ( & self ) -> & :: mtproto :: bytes { match self { & GzipPacked :: GzipPacked ( ref x ) => & x . packed_data , } } } impl :: BoxedSerialize for GzipPacked { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & GzipPacked :: GzipPacked ( ref x ) => ( :: ConstructorNumber ( 0x3072cfa1 ) , x ) , } } } impl :: BoxedDeserialize for GzipPacked { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x3072cfa1 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x3072cfa1 ) => Ok ( GzipPacked :: GzipPacked ( _de . read_bare :: < :: mtproto :: manual :: gzip_packed :: GzipPacked > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `manual.MessageContainer`\n\n```text\nmanual.msg_container#73f1f8dc messages:vector<manual.basic_message> = manual.MessageContainer;\n```\n" ] pub enum MessageContainer { MsgContainer ( :: mtproto :: manual :: msg_container :: MsgContainer ) , } impl MessageContainer { pub fn messages ( & self ) -> & :: mtproto :: vector < :: mtproto :: Bare , :: mtproto :: manual :: basic_message :: BasicMessage > { match self { & MessageContainer :: MsgContainer ( ref x ) => & x . messages , } } } impl :: BoxedSerialize for MessageContainer { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & MessageContainer :: MsgContainer ( ref x ) => ( :: ConstructorNumber ( 0x73f1f8dc ) , x ) , } } } impl :: BoxedDeserialize for MessageContainer { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x73f1f8dc ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x73f1f8dc ) => Ok ( MessageContainer :: MsgContainer ( _de . read_bare :: < :: mtproto :: manual :: msg_container :: MsgContainer > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `manual.RpcResult`\n\n```text\nmanual.rpc_result#f35c6d01 req_msg_id:long result:TypedObject = manual.RpcResult;\n```\n" ] pub enum RpcResult { RpcResult ( :: mtproto :: manual :: rpc_result :: RpcResult ) , } impl RpcResult { pub fn req_msg_id ( & self ) -> & :: mtproto :: long { match self { & RpcResult :: RpcResult ( ref x ) => & x . req_msg_id , } } pub fn result ( & self ) -> & :: mtproto :: TypedObject { match self { & RpcResult :: RpcResult ( ref x ) => & x . result , } } } impl :: BoxedSerialize for RpcResult { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & RpcResult :: RpcResult ( ref x ) => ( :: ConstructorNumber ( 0xf35c6d01 ) , x ) , } } } impl :: BoxedDeserialize for RpcResult { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xf35c6d01 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xf35c6d01 ) => Ok ( RpcResult :: RpcResult ( _de . read_bare :: < :: mtproto :: manual :: rpc_result :: RpcResult > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } pub mod basic_message { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `manual.basic_message`\n\n```text\nmanual.basic_message msg_id:long seqno:int body:lengthPrefixedTypedObject = manual.BasicMessage;\n```\n" ] pub struct BasicMessage { pub msg_id : :: mtproto :: long , pub seqno : :: mtproto :: int , pub body : :: mtproto :: lengthPrefixedTypedObject , } impl :: BareSerialize for BasicMessage { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & BasicMessage { ref msg_id , ref seqno , ref body } = self ; _ser . write_bare :: < :: mtproto :: long > ( msg_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( seqno ) ? ; _ser . write_bare :: < :: mtproto :: lengthPrefixedTypedObject > ( body ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for BasicMessage { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( BasicMessage { msg_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , seqno : _de . read_bare :: < :: mtproto :: int > ( ) ? , body : _de . read_bare :: < :: mtproto :: lengthPrefixedTypedObject > ( ) ? , } ) } } } pub mod bind_auth_key_inner { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `manual.bind_auth_key_inner`\n\n```text\nmanual.bind_auth_key_inner#75a3f765 nonce:long temp_auth_key_id:long perm_auth_key_id:long temp_session_id:long expires_at:int = manual.BindAuthKeyInner;\n```\n" ] pub struct BindAuthKeyInner { pub nonce : :: mtproto :: long , pub temp_auth_key_id : :: mtproto :: long , pub perm_auth_key_id : :: mtproto :: long , pub temp_session_id : :: mtproto :: long , pub expires_at : :: mtproto :: int , } impl :: BareSerialize for BindAuthKeyInner { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & BindAuthKeyInner { ref nonce , ref temp_auth_key_id , ref perm_auth_key_id , ref temp_session_id , ref expires_at } = self ; _ser . write_bare :: < :: mtproto :: long > ( nonce ) ? ; _ser . write_bare :: < :: mtproto :: long > ( temp_auth_key_id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( perm_auth_key_id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( temp_session_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( expires_at ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for BindAuthKeyInner { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( BindAuthKeyInner { nonce : _de . read_bare :: < :: mtproto :: long > ( ) ? , temp_auth_key_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , perm_auth_key_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , temp_session_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , expires_at : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for BindAuthKeyInner { type Boxed = :: mtproto :: manual :: BindAuthKeyInner ; fn into_boxed ( self ) -> :: mtproto :: manual :: BindAuthKeyInner { :: mtproto :: manual :: BindAuthKeyInner :: BindAuthKeyInner ( self ) } } } pub mod gzip_packed { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `manual.gzip_packed`\n\n```text\nmanual.gzip_packed#3072cfa1 packed_data:bytes = manual.GzipPacked;\n```\n" ] pub struct GzipPacked { pub packed_data : :: mtproto :: bytes , } impl :: BareSerialize for GzipPacked { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GzipPacked { ref packed_data } = self ; _ser . write_bare :: < :: mtproto :: bytes > ( packed_data ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for GzipPacked { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( GzipPacked { packed_data : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , } ) } } impl :: IntoBoxed for GzipPacked { type Boxed = :: mtproto :: manual :: GzipPacked ; fn into_boxed ( self ) -> :: mtproto :: manual :: GzipPacked { :: mtproto :: manual :: GzipPacked :: GzipPacked ( self ) } } } pub mod msg_container { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `manual.msg_container`\n\n```text\nmanual.msg_container#73f1f8dc messages:vector<manual.basic_message> = manual.MessageContainer;\n```\n" ] pub struct MsgContainer { pub messages : :: mtproto :: vector < :: mtproto :: Bare , :: mtproto :: manual :: basic_message :: BasicMessage > , } impl :: BareSerialize for MsgContainer { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & MsgContainer { ref messages } = self ; _ser . write_bare :: < :: mtproto :: vector < :: mtproto :: Bare , :: mtproto :: manual :: basic_message :: BasicMessage > > ( messages ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for MsgContainer { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( MsgContainer { messages : _de . read_bare :: < :: mtproto :: vector < :: mtproto :: Bare , :: mtproto :: manual :: basic_message :: BasicMessage > > ( ) ? , } ) } } impl :: IntoBoxed for MsgContainer { type Boxed = :: mtproto :: manual :: MessageContainer ; fn into_boxed ( self ) -> :: mtproto :: manual :: MessageContainer { :: mtproto :: manual :: MessageContainer :: MsgContainer ( self ) } } } pub mod rpc_result { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `manual.rpc_result`\n\n```text\nmanual.rpc_result#f35c6d01 req_msg_id:long result:TypedObject = manual.RpcResult;\n```\n" ] pub struct RpcResult { pub req_msg_id : :: mtproto :: long , pub result : :: mtproto :: TypedObject , } impl :: BareSerialize for RpcResult { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & RpcResult { ref req_msg_id , ref result } = self ; _ser . write_bare :: < :: mtproto :: long > ( req_msg_id ) ? ; _ser . write_boxed :: < :: mtproto :: TypedObject > ( result ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for RpcResult { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( RpcResult { req_msg_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , result : _de . read_boxed :: < :: mtproto :: TypedObject > ( ) ? , } ) } } impl :: IntoBoxed for RpcResult { type Boxed = :: mtproto :: manual :: RpcResult ; fn into_boxed ( self ) -> :: mtproto :: manual :: RpcResult { :: mtproto :: manual :: RpcResult :: RpcResult ( self ) } } } } pub mod mask_coords { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `maskCoords`\n\n```text\nmaskCoords#aed6dbb2 n:int x:double y:double zoom:double = MaskCoords;\n```\n" ] pub struct MaskCoords { pub n : :: mtproto :: int , pub x : :: mtproto :: double , pub y : :: mtproto :: double , pub zoom : :: mtproto :: double , } impl :: BareSerialize for MaskCoords { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & MaskCoords { ref n , ref x , ref y , ref zoom } = self ; _ser . write_bare :: < :: mtproto :: int > ( n ) ? ; _ser . write_bare :: < :: mtproto :: double > ( x ) ? ; _ser . write_bare :: < :: mtproto :: double > ( y ) ? ; _ser . write_bare :: < :: mtproto :: double > ( zoom ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for MaskCoords { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( MaskCoords { n : _de . read_bare :: < :: mtproto :: int > ( ) ? , x : _de . read_bare :: < :: mtproto :: double > ( ) ? , y : _de . read_bare :: < :: mtproto :: double > ( ) ? , zoom : _de . read_bare :: < :: mtproto :: double > ( ) ? , } ) } } impl :: IntoBoxed for MaskCoords { type Boxed = :: mtproto :: MaskCoords ; fn into_boxed ( self ) -> :: mtproto :: MaskCoords { :: mtproto :: MaskCoords :: MaskCoords ( self ) } } } pub mod message { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messageEmpty`\n\n```text\nmessageEmpty#83e5de54 id:int = Message;\n```\n" ] pub struct Empty { pub id : :: mtproto :: int , } impl :: BareSerialize for Empty { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Empty { ref id } = self ; _ser . write_bare :: < :: mtproto :: int > ( id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Empty { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Empty { id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for Empty { type Boxed = :: mtproto :: Message ; fn into_boxed ( self ) -> :: mtproto :: Message { :: mtproto :: Message :: Empty ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `message`\n\n```text\nmessage#44f9b43d flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true id:int from_id:flags.8?int to_id:Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to_msg_id:flags.3?int date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long = Message;\n```\n" ] pub struct Message { pub out : bool , pub mentioned : bool , pub media_unread : bool , pub silent : bool , pub post : bool , pub id : :: mtproto :: int , pub from_id : Option < :: mtproto :: int > , pub to_id : :: mtproto :: Peer , pub fwd_from : Option < :: mtproto :: MessageFwdHeader > , pub via_bot_id : Option < :: mtproto :: int > , pub reply_to_msg_id : Option < :: mtproto :: int > , pub date : :: mtproto :: int , pub message : :: mtproto :: string , pub media : Option < :: mtproto :: MessageMedia > , pub reply_markup : Option < :: mtproto :: ReplyMarkup > , pub entities : Option < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: MessageEntity > > , pub views : Option < :: mtproto :: int > , pub edit_date : Option < :: mtproto :: int > , pub post_author : Option < :: mtproto :: string > , pub grouped_id : Option < :: mtproto :: long > , } impl :: BareSerialize for Message { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Message { out , mentioned , media_unread , silent , post , ref id , ref from_id , ref to_id , ref fwd_from , ref via_bot_id , ref reply_to_msg_id , ref date , ref message , ref media , ref reply_markup , ref entities , ref views , ref edit_date , ref post_author , ref grouped_id } = self ; let mut _flags = 0i32 ; if out { _flags |= 1 << 1u32 ; } if mentioned { _flags |= 1 << 4u32 ; } if media_unread { _flags |= 1 << 5u32 ; } if silent { _flags |= 1 << 13u32 ; } if post { _flags |= 1 << 14u32 ; } if from_id . is_some ( ) { _flags |= 1 << 8u32 ; } if fwd_from . is_some ( ) { _flags |= 1 << 2u32 ; } if via_bot_id . is_some ( ) { _flags |= 1 << 11u32 ; } if reply_to_msg_id . is_some ( ) { _flags |= 1 << 3u32 ; } if media . is_some ( ) { _flags |= 1 << 9u32 ; } if reply_markup . is_some ( ) { _flags |= 1 << 6u32 ; } if entities . is_some ( ) { _flags |= 1 << 7u32 ; } if views . is_some ( ) { _flags |= 1 << 10u32 ; } if edit_date . is_some ( ) { _flags |= 1 << 15u32 ; } if post_author . is_some ( ) { _flags |= 1 << 16u32 ; } if grouped_id . is_some ( ) { _flags |= 1 << 17u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: int > ( id ) ? ; if let & Some ( ref inner ) = from_id { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } _ser . write_boxed :: < :: mtproto :: Peer > ( to_id ) ? ; if let & Some ( ref inner ) = fwd_from { _ser . write_boxed :: < :: mtproto :: MessageFwdHeader > ( inner ) ? ; } if let & Some ( ref inner ) = via_bot_id { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } if let & Some ( ref inner ) = reply_to_msg_id { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; _ser . write_bare :: < :: mtproto :: string > ( message ) ? ; if let & Some ( ref inner ) = media { _ser . write_boxed :: < :: mtproto :: MessageMedia > ( inner ) ? ; } if let & Some ( ref inner ) = reply_markup { _ser . write_boxed :: < :: mtproto :: ReplyMarkup > ( inner ) ? ; } if let & Some ( ref inner ) = entities { _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: MessageEntity > > ( inner ) ? ; } if let & Some ( ref inner ) = views { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } if let & Some ( ref inner ) = edit_date { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } if let & Some ( ref inner ) = post_author { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = grouped_id { _ser . write_bare :: < :: mtproto :: long > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for Message { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( Message { out : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 1u32 ) != 0 } , mentioned : _flags & ( 1 << 4u32 ) != 0 , media_unread : _flags & ( 1 << 5u32 ) != 0 , silent : _flags & ( 1 << 13u32 ) != 0 , post : _flags & ( 1 << 14u32 ) != 0 , id : _de . read_bare :: < :: mtproto :: int > ( ) ? , from_id : if _flags & ( 1 << 8u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , to_id : _de . read_boxed :: < :: mtproto :: Peer > ( ) ? , fwd_from : if _flags & ( 1 << 2u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: MessageFwdHeader > ( ) ? ) } else { None } , via_bot_id : if _flags & ( 1 << 11u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , reply_to_msg_id : if _flags & ( 1 << 3u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , message : _de . read_bare :: < :: mtproto :: string > ( ) ? , media : if _flags & ( 1 << 9u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: MessageMedia > ( ) ? ) } else { None } , reply_markup : if _flags & ( 1 << 6u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: ReplyMarkup > ( ) ? ) } else { None } , entities : if _flags & ( 1 << 7u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: MessageEntity > > ( ) ? ) } else { None } , views : if _flags & ( 1 << 10u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , edit_date : if _flags & ( 1 << 15u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , post_author : if _flags & ( 1 << 16u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , grouped_id : if _flags & ( 1 << 17u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: long > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for Message { type Boxed = :: mtproto :: Message ; fn into_boxed ( self ) -> :: mtproto :: Message { :: mtproto :: Message :: Message ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messageService`\n\n```text\nmessageService#9e19a1f6 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true id:int from_id:flags.8?int to_id:Peer reply_to_msg_id:flags.3?int date:int action:MessageAction = Message;\n```\n" ] pub struct Service { pub out : bool , pub mentioned : bool , pub media_unread : bool , pub silent : bool , pub post : bool , pub id : :: mtproto :: int , pub from_id : Option < :: mtproto :: int > , pub to_id : :: mtproto :: Peer , pub reply_to_msg_id : Option < :: mtproto :: int > , pub date : :: mtproto :: int , pub action : :: mtproto :: MessageAction , } impl :: BareSerialize for Service { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Service { out , mentioned , media_unread , silent , post , ref id , ref from_id , ref to_id , ref reply_to_msg_id , ref date , ref action } = self ; let mut _flags = 0i32 ; if out { _flags |= 1 << 1u32 ; } if mentioned { _flags |= 1 << 4u32 ; } if media_unread { _flags |= 1 << 5u32 ; } if silent { _flags |= 1 << 13u32 ; } if post { _flags |= 1 << 14u32 ; } if from_id . is_some ( ) { _flags |= 1 << 8u32 ; } if reply_to_msg_id . is_some ( ) { _flags |= 1 << 3u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: int > ( id ) ? ; if let & Some ( ref inner ) = from_id { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } _ser . write_boxed :: < :: mtproto :: Peer > ( to_id ) ? ; if let & Some ( ref inner ) = reply_to_msg_id { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; _ser . write_boxed :: < :: mtproto :: MessageAction > ( action ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Service { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( Service { out : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 1u32 ) != 0 } , mentioned : _flags & ( 1 << 4u32 ) != 0 , media_unread : _flags & ( 1 << 5u32 ) != 0 , silent : _flags & ( 1 << 13u32 ) != 0 , post : _flags & ( 1 << 14u32 ) != 0 , id : _de . read_bare :: < :: mtproto :: int > ( ) ? , from_id : if _flags & ( 1 << 8u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , to_id : _de . read_boxed :: < :: mtproto :: Peer > ( ) ? , reply_to_msg_id : if _flags & ( 1 << 3u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , action : _de . read_boxed :: < :: mtproto :: MessageAction > ( ) ? , } ) } } impl :: IntoBoxed for Service { type Boxed = :: mtproto :: Message ; fn into_boxed ( self ) -> :: mtproto :: Message { :: mtproto :: Message :: Service ( self ) } } } pub mod message_action { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messageActionChannelCreate`\n\n```text\nmessageActionChannelCreate#95d2ac92 title:string = MessageAction;\n```\n" ] pub struct ChannelCreate { pub title : :: mtproto :: string , } impl :: BareSerialize for ChannelCreate { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChannelCreate { ref title } = self ; _ser . write_bare :: < :: mtproto :: string > ( title ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ChannelCreate { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ChannelCreate { title : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for ChannelCreate { type Boxed = :: mtproto :: MessageAction ; fn into_boxed ( self ) -> :: mtproto :: MessageAction { :: mtproto :: MessageAction :: ChannelCreate ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messageActionChannelMigrateFrom`\n\n```text\nmessageActionChannelMigrateFrom#b055eaee title:string chat_id:int = MessageAction;\n```\n" ] pub struct ChannelMigrateFrom { pub title : :: mtproto :: string , pub chat_id : :: mtproto :: int , } impl :: BareSerialize for ChannelMigrateFrom { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChannelMigrateFrom { ref title , ref chat_id } = self ; _ser . write_bare :: < :: mtproto :: string > ( title ) ? ; _ser . write_bare :: < :: mtproto :: int > ( chat_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ChannelMigrateFrom { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ChannelMigrateFrom { title : _de . read_bare :: < :: mtproto :: string > ( ) ? , chat_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for ChannelMigrateFrom { type Boxed = :: mtproto :: MessageAction ; fn into_boxed ( self ) -> :: mtproto :: MessageAction { :: mtproto :: MessageAction :: ChannelMigrateFrom ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messageActionChatAddUser`\n\n```text\nmessageActionChatAddUser#488a7337 users:Vector<int> = MessageAction;\n```\n" ] pub struct ChatAddUser { pub users : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > , } impl :: BareSerialize for ChatAddUser { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChatAddUser { ref users } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > > ( users ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ChatAddUser { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ChatAddUser { users : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > > ( ) ? , } ) } } impl :: IntoBoxed for ChatAddUser { type Boxed = :: mtproto :: MessageAction ; fn into_boxed ( self ) -> :: mtproto :: MessageAction { :: mtproto :: MessageAction :: ChatAddUser ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messageActionChatCreate`\n\n```text\nmessageActionChatCreate#a6638b9a title:string users:Vector<int> = MessageAction;\n```\n" ] pub struct ChatCreate { pub title : :: mtproto :: string , pub users : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > , } impl :: BareSerialize for ChatCreate { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChatCreate { ref title , ref users } = self ; _ser . write_bare :: < :: mtproto :: string > ( title ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > > ( users ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ChatCreate { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ChatCreate { title : _de . read_bare :: < :: mtproto :: string > ( ) ? , users : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > > ( ) ? , } ) } } impl :: IntoBoxed for ChatCreate { type Boxed = :: mtproto :: MessageAction ; fn into_boxed ( self ) -> :: mtproto :: MessageAction { :: mtproto :: MessageAction :: ChatCreate ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messageActionChatDeleteUser`\n\n```text\nmessageActionChatDeleteUser#b2ae9b0c user_id:int = MessageAction;\n```\n" ] pub struct ChatDeleteUser { pub user_id : :: mtproto :: int , } impl :: BareSerialize for ChatDeleteUser { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChatDeleteUser { ref user_id } = self ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ChatDeleteUser { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ChatDeleteUser { user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for ChatDeleteUser { type Boxed = :: mtproto :: MessageAction ; fn into_boxed ( self ) -> :: mtproto :: MessageAction { :: mtproto :: MessageAction :: ChatDeleteUser ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messageActionChatEditPhoto`\n\n```text\nmessageActionChatEditPhoto#7fcb13a8 photo:Photo = MessageAction;\n```\n" ] pub struct ChatEditPhoto { pub photo : :: mtproto :: Photo , } impl :: BareSerialize for ChatEditPhoto { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChatEditPhoto { ref photo } = self ; _ser . write_boxed :: < :: mtproto :: Photo > ( photo ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ChatEditPhoto { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ChatEditPhoto { photo : _de . read_boxed :: < :: mtproto :: Photo > ( ) ? , } ) } } impl :: IntoBoxed for ChatEditPhoto { type Boxed = :: mtproto :: MessageAction ; fn into_boxed ( self ) -> :: mtproto :: MessageAction { :: mtproto :: MessageAction :: ChatEditPhoto ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messageActionChatEditTitle`\n\n```text\nmessageActionChatEditTitle#b5a1ce5a title:string = MessageAction;\n```\n" ] pub struct ChatEditTitle { pub title : :: mtproto :: string , } impl :: BareSerialize for ChatEditTitle { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChatEditTitle { ref title } = self ; _ser . write_bare :: < :: mtproto :: string > ( title ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ChatEditTitle { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ChatEditTitle { title : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for ChatEditTitle { type Boxed = :: mtproto :: MessageAction ; fn into_boxed ( self ) -> :: mtproto :: MessageAction { :: mtproto :: MessageAction :: ChatEditTitle ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messageActionChatJoinedByLink`\n\n```text\nmessageActionChatJoinedByLink#f89cf5e8 inviter_id:int = MessageAction;\n```\n" ] pub struct ChatJoinedByLink { pub inviter_id : :: mtproto :: int , } impl :: BareSerialize for ChatJoinedByLink { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChatJoinedByLink { ref inviter_id } = self ; _ser . write_bare :: < :: mtproto :: int > ( inviter_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ChatJoinedByLink { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ChatJoinedByLink { inviter_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for ChatJoinedByLink { type Boxed = :: mtproto :: MessageAction ; fn into_boxed ( self ) -> :: mtproto :: MessageAction { :: mtproto :: MessageAction :: ChatJoinedByLink ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messageActionChatMigrateTo`\n\n```text\nmessageActionChatMigrateTo#51bdb021 channel_id:int = MessageAction;\n```\n" ] pub struct ChatMigrateTo { pub channel_id : :: mtproto :: int , } impl :: BareSerialize for ChatMigrateTo { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChatMigrateTo { ref channel_id } = self ; _ser . write_bare :: < :: mtproto :: int > ( channel_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ChatMigrateTo { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ChatMigrateTo { channel_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for ChatMigrateTo { type Boxed = :: mtproto :: MessageAction ; fn into_boxed ( self ) -> :: mtproto :: MessageAction { :: mtproto :: MessageAction :: ChatMigrateTo ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messageActionCustomAction`\n\n```text\nmessageActionCustomAction#fae69f56 message:string = MessageAction;\n```\n" ] pub struct CustomAction { pub message : :: mtproto :: string , } impl :: BareSerialize for CustomAction { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & CustomAction { ref message } = self ; _ser . write_bare :: < :: mtproto :: string > ( message ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for CustomAction { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( CustomAction { message : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for CustomAction { type Boxed = :: mtproto :: MessageAction ; fn into_boxed ( self ) -> :: mtproto :: MessageAction { :: mtproto :: MessageAction :: CustomAction ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messageActionGameScore`\n\n```text\nmessageActionGameScore#92a72876 game_id:long score:int = MessageAction;\n```\n" ] pub struct GameScore { pub game_id : :: mtproto :: long , pub score : :: mtproto :: int , } impl :: BareSerialize for GameScore { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GameScore { ref game_id , ref score } = self ; _ser . write_bare :: < :: mtproto :: long > ( game_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( score ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for GameScore { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( GameScore { game_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , score : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for GameScore { type Boxed = :: mtproto :: MessageAction ; fn into_boxed ( self ) -> :: mtproto :: MessageAction { :: mtproto :: MessageAction :: GameScore ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messageActionPaymentSent`\n\n```text\nmessageActionPaymentSent#40699cd0 currency:string total_amount:long = MessageAction;\n```\n" ] pub struct PaymentSent { pub currency : :: mtproto :: string , pub total_amount : :: mtproto :: long , } impl :: BareSerialize for PaymentSent { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & PaymentSent { ref currency , ref total_amount } = self ; _ser . write_bare :: < :: mtproto :: string > ( currency ) ? ; _ser . write_bare :: < :: mtproto :: long > ( total_amount ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for PaymentSent { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( PaymentSent { currency : _de . read_bare :: < :: mtproto :: string > ( ) ? , total_amount : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for PaymentSent { type Boxed = :: mtproto :: MessageAction ; fn into_boxed ( self ) -> :: mtproto :: MessageAction { :: mtproto :: MessageAction :: PaymentSent ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messageActionPaymentSentMe`\n\n```text\nmessageActionPaymentSentMe#8f31b327 flags:# currency:string total_amount:long payload:bytes info:flags.0?PaymentRequestedInfo shipping_option_id:flags.1?string charge:PaymentCharge = MessageAction;\n```\n" ] pub struct PaymentSentMe { pub currency : :: mtproto :: string , pub total_amount : :: mtproto :: long , pub payload : :: mtproto :: bytes , pub info : Option < :: mtproto :: PaymentRequestedInfo > , pub shipping_option_id : Option < :: mtproto :: string > , pub charge : :: mtproto :: PaymentCharge , } impl :: BareSerialize for PaymentSentMe { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & PaymentSentMe { ref currency , ref total_amount , ref payload , ref info , ref shipping_option_id , ref charge } = self ; let mut _flags = 0i32 ; if info . is_some ( ) { _flags |= 1 << 0u32 ; } if shipping_option_id . is_some ( ) { _flags |= 1 << 1u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: string > ( currency ) ? ; _ser . write_bare :: < :: mtproto :: long > ( total_amount ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( payload ) ? ; if let & Some ( ref inner ) = info { _ser . write_boxed :: < :: mtproto :: PaymentRequestedInfo > ( inner ) ? ; } if let & Some ( ref inner ) = shipping_option_id { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } _ser . write_boxed :: < :: mtproto :: PaymentCharge > ( charge ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for PaymentSentMe { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( PaymentSentMe { currency : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _de . read_bare :: < :: mtproto :: string > ( ) ? } , total_amount : _de . read_bare :: < :: mtproto :: long > ( ) ? , payload : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , info : if _flags & ( 1 << 0u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: PaymentRequestedInfo > ( ) ? ) } else { None } , shipping_option_id : if _flags & ( 1 << 1u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , charge : _de . read_boxed :: < :: mtproto :: PaymentCharge > ( ) ? , } ) } } impl :: IntoBoxed for PaymentSentMe { type Boxed = :: mtproto :: MessageAction ; fn into_boxed ( self ) -> :: mtproto :: MessageAction { :: mtproto :: MessageAction :: PaymentSentMe ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messageActionPhoneCall`\n\n```text\nmessageActionPhoneCall#80e11a7f flags:# call_id:long reason:flags.0?PhoneCallDiscardReason duration:flags.1?int = MessageAction;\n```\n" ] pub struct PhoneCall { pub call_id : :: mtproto :: long , pub reason : Option < :: mtproto :: PhoneCallDiscardReason > , pub duration : Option < :: mtproto :: int > , } impl :: BareSerialize for PhoneCall { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & PhoneCall { ref call_id , ref reason , ref duration } = self ; let mut _flags = 0i32 ; if reason . is_some ( ) { _flags |= 1 << 0u32 ; } if duration . is_some ( ) { _flags |= 1 << 1u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: long > ( call_id ) ? ; if let & Some ( ref inner ) = reason { _ser . write_boxed :: < :: mtproto :: PhoneCallDiscardReason > ( inner ) ? ; } if let & Some ( ref inner ) = duration { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for PhoneCall { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( PhoneCall { call_id : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _de . read_bare :: < :: mtproto :: long > ( ) ? } , reason : if _flags & ( 1 << 0u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: PhoneCallDiscardReason > ( ) ? ) } else { None } , duration : if _flags & ( 1 << 1u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for PhoneCall { type Boxed = :: mtproto :: MessageAction ; fn into_boxed ( self ) -> :: mtproto :: MessageAction { :: mtproto :: MessageAction :: PhoneCall ( self ) } } } pub mod message_entity { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `inputMessageEntityMentionName`\n\n```text\ninputMessageEntityMentionName#208e68c9 offset:int length:int user_id:InputUser = MessageEntity;\n```\n" ] pub struct InputMessageEntityMentionName { pub offset : :: mtproto :: int , pub length : :: mtproto :: int , pub user_id : :: mtproto :: InputUser , } impl :: BareSerialize for InputMessageEntityMentionName { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & InputMessageEntityMentionName { ref offset , ref length , ref user_id } = self ; _ser . write_bare :: < :: mtproto :: int > ( offset ) ? ; _ser . write_bare :: < :: mtproto :: int > ( length ) ? ; _ser . write_boxed :: < :: mtproto :: InputUser > ( user_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for InputMessageEntityMentionName { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( InputMessageEntityMentionName { offset : _de . read_bare :: < :: mtproto :: int > ( ) ? , length : _de . read_bare :: < :: mtproto :: int > ( ) ? , user_id : _de . read_boxed :: < :: mtproto :: InputUser > ( ) ? , } ) } } impl :: IntoBoxed for InputMessageEntityMentionName { type Boxed = :: mtproto :: MessageEntity ; fn into_boxed ( self ) -> :: mtproto :: MessageEntity { :: mtproto :: MessageEntity :: InputMessageEntityMentionName ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messageEntityBold`\n\n```text\nmessageEntityBold#bd610bc9 offset:int length:int = MessageEntity;\n```\n" ] pub struct MessageEntityBold { pub offset : :: mtproto :: int , pub length : :: mtproto :: int , } impl :: BareSerialize for MessageEntityBold { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & MessageEntityBold { ref offset , ref length } = self ; _ser . write_bare :: < :: mtproto :: int > ( offset ) ? ; _ser . write_bare :: < :: mtproto :: int > ( length ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for MessageEntityBold { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( MessageEntityBold { offset : _de . read_bare :: < :: mtproto :: int > ( ) ? , length : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for MessageEntityBold { type Boxed = :: mtproto :: MessageEntity ; fn into_boxed ( self ) -> :: mtproto :: MessageEntity { :: mtproto :: MessageEntity :: MessageEntityBold ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messageEntityBotCommand`\n\n```text\nmessageEntityBotCommand#6cef8ac7 offset:int length:int = MessageEntity;\n```\n" ] pub struct MessageEntityBotCommand { pub offset : :: mtproto :: int , pub length : :: mtproto :: int , } impl :: BareSerialize for MessageEntityBotCommand { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & MessageEntityBotCommand { ref offset , ref length } = self ; _ser . write_bare :: < :: mtproto :: int > ( offset ) ? ; _ser . write_bare :: < :: mtproto :: int > ( length ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for MessageEntityBotCommand { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( MessageEntityBotCommand { offset : _de . read_bare :: < :: mtproto :: int > ( ) ? , length : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for MessageEntityBotCommand { type Boxed = :: mtproto :: MessageEntity ; fn into_boxed ( self ) -> :: mtproto :: MessageEntity { :: mtproto :: MessageEntity :: MessageEntityBotCommand ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messageEntityCode`\n\n```text\nmessageEntityCode#28a20571 offset:int length:int = MessageEntity;\n```\n" ] pub struct MessageEntityCode { pub offset : :: mtproto :: int , pub length : :: mtproto :: int , } impl :: BareSerialize for MessageEntityCode { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & MessageEntityCode { ref offset , ref length } = self ; _ser . write_bare :: < :: mtproto :: int > ( offset ) ? ; _ser . write_bare :: < :: mtproto :: int > ( length ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for MessageEntityCode { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( MessageEntityCode { offset : _de . read_bare :: < :: mtproto :: int > ( ) ? , length : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for MessageEntityCode { type Boxed = :: mtproto :: MessageEntity ; fn into_boxed ( self ) -> :: mtproto :: MessageEntity { :: mtproto :: MessageEntity :: MessageEntityCode ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messageEntityEmail`\n\n```text\nmessageEntityEmail#64e475c2 offset:int length:int = MessageEntity;\n```\n" ] pub struct MessageEntityEmail { pub offset : :: mtproto :: int , pub length : :: mtproto :: int , } impl :: BareSerialize for MessageEntityEmail { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & MessageEntityEmail { ref offset , ref length } = self ; _ser . write_bare :: < :: mtproto :: int > ( offset ) ? ; _ser . write_bare :: < :: mtproto :: int > ( length ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for MessageEntityEmail { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( MessageEntityEmail { offset : _de . read_bare :: < :: mtproto :: int > ( ) ? , length : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for MessageEntityEmail { type Boxed = :: mtproto :: MessageEntity ; fn into_boxed ( self ) -> :: mtproto :: MessageEntity { :: mtproto :: MessageEntity :: MessageEntityEmail ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messageEntityHashtag`\n\n```text\nmessageEntityHashtag#6f635b0d offset:int length:int = MessageEntity;\n```\n" ] pub struct MessageEntityHashtag { pub offset : :: mtproto :: int , pub length : :: mtproto :: int , } impl :: BareSerialize for MessageEntityHashtag { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & MessageEntityHashtag { ref offset , ref length } = self ; _ser . write_bare :: < :: mtproto :: int > ( offset ) ? ; _ser . write_bare :: < :: mtproto :: int > ( length ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for MessageEntityHashtag { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( MessageEntityHashtag { offset : _de . read_bare :: < :: mtproto :: int > ( ) ? , length : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for MessageEntityHashtag { type Boxed = :: mtproto :: MessageEntity ; fn into_boxed ( self ) -> :: mtproto :: MessageEntity { :: mtproto :: MessageEntity :: MessageEntityHashtag ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messageEntityItalic`\n\n```text\nmessageEntityItalic#826f8b60 offset:int length:int = MessageEntity;\n```\n" ] pub struct MessageEntityItalic { pub offset : :: mtproto :: int , pub length : :: mtproto :: int , } impl :: BareSerialize for MessageEntityItalic { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & MessageEntityItalic { ref offset , ref length } = self ; _ser . write_bare :: < :: mtproto :: int > ( offset ) ? ; _ser . write_bare :: < :: mtproto :: int > ( length ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for MessageEntityItalic { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( MessageEntityItalic { offset : _de . read_bare :: < :: mtproto :: int > ( ) ? , length : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for MessageEntityItalic { type Boxed = :: mtproto :: MessageEntity ; fn into_boxed ( self ) -> :: mtproto :: MessageEntity { :: mtproto :: MessageEntity :: MessageEntityItalic ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messageEntityMention`\n\n```text\nmessageEntityMention#fa04579d offset:int length:int = MessageEntity;\n```\n" ] pub struct MessageEntityMention { pub offset : :: mtproto :: int , pub length : :: mtproto :: int , } impl :: BareSerialize for MessageEntityMention { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & MessageEntityMention { ref offset , ref length } = self ; _ser . write_bare :: < :: mtproto :: int > ( offset ) ? ; _ser . write_bare :: < :: mtproto :: int > ( length ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for MessageEntityMention { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( MessageEntityMention { offset : _de . read_bare :: < :: mtproto :: int > ( ) ? , length : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for MessageEntityMention { type Boxed = :: mtproto :: MessageEntity ; fn into_boxed ( self ) -> :: mtproto :: MessageEntity { :: mtproto :: MessageEntity :: MessageEntityMention ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messageEntityMentionName`\n\n```text\nmessageEntityMentionName#352dca58 offset:int length:int user_id:int = MessageEntity;\n```\n" ] pub struct MessageEntityMentionName { pub offset : :: mtproto :: int , pub length : :: mtproto :: int , pub user_id : :: mtproto :: int , } impl :: BareSerialize for MessageEntityMentionName { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & MessageEntityMentionName { ref offset , ref length , ref user_id } = self ; _ser . write_bare :: < :: mtproto :: int > ( offset ) ? ; _ser . write_bare :: < :: mtproto :: int > ( length ) ? ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for MessageEntityMentionName { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( MessageEntityMentionName { offset : _de . read_bare :: < :: mtproto :: int > ( ) ? , length : _de . read_bare :: < :: mtproto :: int > ( ) ? , user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for MessageEntityMentionName { type Boxed = :: mtproto :: MessageEntity ; fn into_boxed ( self ) -> :: mtproto :: MessageEntity { :: mtproto :: MessageEntity :: MessageEntityMentionName ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messageEntityPre`\n\n```text\nmessageEntityPre#73924be0 offset:int length:int language:string = MessageEntity;\n```\n" ] pub struct MessageEntityPre { pub offset : :: mtproto :: int , pub length : :: mtproto :: int , pub language : :: mtproto :: string , } impl :: BareSerialize for MessageEntityPre { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & MessageEntityPre { ref offset , ref length , ref language } = self ; _ser . write_bare :: < :: mtproto :: int > ( offset ) ? ; _ser . write_bare :: < :: mtproto :: int > ( length ) ? ; _ser . write_bare :: < :: mtproto :: string > ( language ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for MessageEntityPre { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( MessageEntityPre { offset : _de . read_bare :: < :: mtproto :: int > ( ) ? , length : _de . read_bare :: < :: mtproto :: int > ( ) ? , language : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for MessageEntityPre { type Boxed = :: mtproto :: MessageEntity ; fn into_boxed ( self ) -> :: mtproto :: MessageEntity { :: mtproto :: MessageEntity :: MessageEntityPre ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messageEntityTextUrl`\n\n```text\nmessageEntityTextUrl#76a6d327 offset:int length:int url:string = MessageEntity;\n```\n" ] pub struct MessageEntityTextUrl { pub offset : :: mtproto :: int , pub length : :: mtproto :: int , pub url : :: mtproto :: string , } impl :: BareSerialize for MessageEntityTextUrl { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & MessageEntityTextUrl { ref offset , ref length , ref url } = self ; _ser . write_bare :: < :: mtproto :: int > ( offset ) ? ; _ser . write_bare :: < :: mtproto :: int > ( length ) ? ; _ser . write_bare :: < :: mtproto :: string > ( url ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for MessageEntityTextUrl { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( MessageEntityTextUrl { offset : _de . read_bare :: < :: mtproto :: int > ( ) ? , length : _de . read_bare :: < :: mtproto :: int > ( ) ? , url : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for MessageEntityTextUrl { type Boxed = :: mtproto :: MessageEntity ; fn into_boxed ( self ) -> :: mtproto :: MessageEntity { :: mtproto :: MessageEntity :: MessageEntityTextUrl ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messageEntityUnknown`\n\n```text\nmessageEntityUnknown#bb92ba95 offset:int length:int = MessageEntity;\n```\n" ] pub struct MessageEntityUnknown { pub offset : :: mtproto :: int , pub length : :: mtproto :: int , } impl :: BareSerialize for MessageEntityUnknown { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & MessageEntityUnknown { ref offset , ref length } = self ; _ser . write_bare :: < :: mtproto :: int > ( offset ) ? ; _ser . write_bare :: < :: mtproto :: int > ( length ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for MessageEntityUnknown { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( MessageEntityUnknown { offset : _de . read_bare :: < :: mtproto :: int > ( ) ? , length : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for MessageEntityUnknown { type Boxed = :: mtproto :: MessageEntity ; fn into_boxed ( self ) -> :: mtproto :: MessageEntity { :: mtproto :: MessageEntity :: MessageEntityUnknown ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messageEntityUrl`\n\n```text\nmessageEntityUrl#6ed02538 offset:int length:int = MessageEntity;\n```\n" ] pub struct MessageEntityUrl { pub offset : :: mtproto :: int , pub length : :: mtproto :: int , } impl :: BareSerialize for MessageEntityUrl { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & MessageEntityUrl { ref offset , ref length } = self ; _ser . write_bare :: < :: mtproto :: int > ( offset ) ? ; _ser . write_bare :: < :: mtproto :: int > ( length ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for MessageEntityUrl { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( MessageEntityUrl { offset : _de . read_bare :: < :: mtproto :: int > ( ) ? , length : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for MessageEntityUrl { type Boxed = :: mtproto :: MessageEntity ; fn into_boxed ( self ) -> :: mtproto :: MessageEntity { :: mtproto :: MessageEntity :: MessageEntityUrl ( self ) } } } pub mod message_fwd_header { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messageFwdHeader`\n\n```text\nmessageFwdHeader#559ebe6d flags:# from_id:flags.0?int date:int channel_id:flags.1?int channel_post:flags.2?int post_author:flags.3?string saved_from_peer:flags.4?Peer saved_from_msg_id:flags.4?int = MessageFwdHeader;\n```\n" ] pub struct MessageFwdHeader { pub from_id : Option < :: mtproto :: int > , pub date : :: mtproto :: int , pub channel_id : Option < :: mtproto :: int > , pub channel_post : Option < :: mtproto :: int > , pub post_author : Option < :: mtproto :: string > , pub saved_from_peer : Option < :: mtproto :: Peer > , pub saved_from_msg_id : Option < :: mtproto :: int > , } impl :: BareSerialize for MessageFwdHeader { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & MessageFwdHeader { ref from_id , ref date , ref channel_id , ref channel_post , ref post_author , ref saved_from_peer , ref saved_from_msg_id } = self ; let mut _flags = 0i32 ; if from_id . is_some ( ) { _flags |= 1 << 0u32 ; } if channel_id . is_some ( ) { _flags |= 1 << 1u32 ; } if channel_post . is_some ( ) { _flags |= 1 << 2u32 ; } if post_author . is_some ( ) { _flags |= 1 << 3u32 ; } if saved_from_peer . is_some ( ) { _flags |= 1 << 4u32 ; } if saved_from_msg_id . is_some ( ) { _flags |= 1 << 4u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; if let & Some ( ref inner ) = from_id { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; if let & Some ( ref inner ) = channel_id { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } if let & Some ( ref inner ) = channel_post { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } if let & Some ( ref inner ) = post_author { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = saved_from_peer { _ser . write_boxed :: < :: mtproto :: Peer > ( inner ) ? ; } if let & Some ( ref inner ) = saved_from_msg_id { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for MessageFwdHeader { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( MessageFwdHeader { from_id : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; if _flags & ( 1 << 0u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } } , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , channel_id : if _flags & ( 1 << 1u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , channel_post : if _flags & ( 1 << 2u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , post_author : if _flags & ( 1 << 3u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , saved_from_peer : if _flags & ( 1 << 4u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: Peer > ( ) ? ) } else { None } , saved_from_msg_id : if _flags & ( 1 << 4u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for MessageFwdHeader { type Boxed = :: mtproto :: MessageFwdHeader ; fn into_boxed ( self ) -> :: mtproto :: MessageFwdHeader { :: mtproto :: MessageFwdHeader :: MessageFwdHeader ( self ) } } } pub mod message_media { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messageMediaContact`\n\n```text\nmessageMediaContact#5e7d2f39 phone_number:string first_name:string last_name:string user_id:int = MessageMedia;\n```\n" ] pub struct Contact { pub phone_number : :: mtproto :: string , pub first_name : :: mtproto :: string , pub last_name : :: mtproto :: string , pub user_id : :: mtproto :: int , } impl :: BareSerialize for Contact { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Contact { ref phone_number , ref first_name , ref last_name , ref user_id } = self ; _ser . write_bare :: < :: mtproto :: string > ( phone_number ) ? ; _ser . write_bare :: < :: mtproto :: string > ( first_name ) ? ; _ser . write_bare :: < :: mtproto :: string > ( last_name ) ? ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Contact { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Contact { phone_number : _de . read_bare :: < :: mtproto :: string > ( ) ? , first_name : _de . read_bare :: < :: mtproto :: string > ( ) ? , last_name : _de . read_bare :: < :: mtproto :: string > ( ) ? , user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for Contact { type Boxed = :: mtproto :: MessageMedia ; fn into_boxed ( self ) -> :: mtproto :: MessageMedia { :: mtproto :: MessageMedia :: Contact ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messageMediaDocument`\n\n```text\nmessageMediaDocument#7c4414d3 flags:# document:flags.0?Document caption:flags.1?string ttl_seconds:flags.2?int = MessageMedia;\n```\n" ] pub struct Document { pub document : Option < :: mtproto :: Document > , pub caption : Option < :: mtproto :: string > , pub ttl_seconds : Option < :: mtproto :: int > , } impl :: BareSerialize for Document { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Document { ref document , ref caption , ref ttl_seconds } = self ; let mut _flags = 0i32 ; if document . is_some ( ) { _flags |= 1 << 0u32 ; } if caption . is_some ( ) { _flags |= 1 << 1u32 ; } if ttl_seconds . is_some ( ) { _flags |= 1 << 2u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; if let & Some ( ref inner ) = document { _ser . write_boxed :: < :: mtproto :: Document > ( inner ) ? ; } if let & Some ( ref inner ) = caption { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = ttl_seconds { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for Document { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( Document { document : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; if _flags & ( 1 << 0u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: Document > ( ) ? ) } else { None } } , caption : if _flags & ( 1 << 1u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , ttl_seconds : if _flags & ( 1 << 2u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for Document { type Boxed = :: mtproto :: MessageMedia ; fn into_boxed ( self ) -> :: mtproto :: MessageMedia { :: mtproto :: MessageMedia :: Document ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messageMediaGame`\n\n```text\nmessageMediaGame#fdb19008 game:Game = MessageMedia;\n```\n" ] pub struct Game { pub game : :: mtproto :: Game , } impl :: BareSerialize for Game { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Game { ref game } = self ; _ser . write_boxed :: < :: mtproto :: Game > ( game ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Game { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Game { game : _de . read_boxed :: < :: mtproto :: Game > ( ) ? , } ) } } impl :: IntoBoxed for Game { type Boxed = :: mtproto :: MessageMedia ; fn into_boxed ( self ) -> :: mtproto :: MessageMedia { :: mtproto :: MessageMedia :: Game ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messageMediaGeo`\n\n```text\nmessageMediaGeo#56e0d474 geo:GeoPoint = MessageMedia;\n```\n" ] pub struct Geo { pub geo : :: mtproto :: GeoPoint , } impl :: BareSerialize for Geo { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Geo { ref geo } = self ; _ser . write_boxed :: < :: mtproto :: GeoPoint > ( geo ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Geo { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Geo { geo : _de . read_boxed :: < :: mtproto :: GeoPoint > ( ) ? , } ) } } impl :: IntoBoxed for Geo { type Boxed = :: mtproto :: MessageMedia ; fn into_boxed ( self ) -> :: mtproto :: MessageMedia { :: mtproto :: MessageMedia :: Geo ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messageMediaGeoLive`\n\n```text\nmessageMediaGeoLive#7c3c2609 geo:GeoPoint period:int = MessageMedia;\n```\n" ] pub struct GeoLive { pub geo : :: mtproto :: GeoPoint , pub period : :: mtproto :: int , } impl :: BareSerialize for GeoLive { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GeoLive { ref geo , ref period } = self ; _ser . write_boxed :: < :: mtproto :: GeoPoint > ( geo ) ? ; _ser . write_bare :: < :: mtproto :: int > ( period ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for GeoLive { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( GeoLive { geo : _de . read_boxed :: < :: mtproto :: GeoPoint > ( ) ? , period : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for GeoLive { type Boxed = :: mtproto :: MessageMedia ; fn into_boxed ( self ) -> :: mtproto :: MessageMedia { :: mtproto :: MessageMedia :: GeoLive ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messageMediaInvoice`\n\n```text\nmessageMediaInvoice#84551347 flags:# shipping_address_requested:flags.1?true test:flags.3?true title:string description:string photo:flags.0?WebDocument receipt_msg_id:flags.2?int currency:string total_amount:long start_param:string = MessageMedia;\n```\n" ] pub struct Invoice { pub shipping_address_requested : bool , pub test : bool , pub title : :: mtproto :: string , pub description : :: mtproto :: string , pub photo : Option < :: mtproto :: WebDocument > , pub receipt_msg_id : Option < :: mtproto :: int > , pub currency : :: mtproto :: string , pub total_amount : :: mtproto :: long , pub start_param : :: mtproto :: string , } impl :: BareSerialize for Invoice { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Invoice { shipping_address_requested , test , ref title , ref description , ref photo , ref receipt_msg_id , ref currency , ref total_amount , ref start_param } = self ; let mut _flags = 0i32 ; if shipping_address_requested { _flags |= 1 << 1u32 ; } if test { _flags |= 1 << 3u32 ; } if photo . is_some ( ) { _flags |= 1 << 0u32 ; } if receipt_msg_id . is_some ( ) { _flags |= 1 << 2u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: string > ( title ) ? ; _ser . write_bare :: < :: mtproto :: string > ( description ) ? ; if let & Some ( ref inner ) = photo { _ser . write_boxed :: < :: mtproto :: WebDocument > ( inner ) ? ; } if let & Some ( ref inner ) = receipt_msg_id { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } _ser . write_bare :: < :: mtproto :: string > ( currency ) ? ; _ser . write_bare :: < :: mtproto :: long > ( total_amount ) ? ; _ser . write_bare :: < :: mtproto :: string > ( start_param ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Invoice { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( Invoice { shipping_address_requested : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 1u32 ) != 0 } , test : _flags & ( 1 << 3u32 ) != 0 , title : _de . read_bare :: < :: mtproto :: string > ( ) ? , description : _de . read_bare :: < :: mtproto :: string > ( ) ? , photo : if _flags & ( 1 << 0u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: WebDocument > ( ) ? ) } else { None } , receipt_msg_id : if _flags & ( 1 << 2u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , currency : _de . read_bare :: < :: mtproto :: string > ( ) ? , total_amount : _de . read_bare :: < :: mtproto :: long > ( ) ? , start_param : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for Invoice { type Boxed = :: mtproto :: MessageMedia ; fn into_boxed ( self ) -> :: mtproto :: MessageMedia { :: mtproto :: MessageMedia :: Invoice ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messageMediaPhoto`\n\n```text\nmessageMediaPhoto#b5223b0f flags:# photo:flags.0?Photo caption:flags.1?string ttl_seconds:flags.2?int = MessageMedia;\n```\n" ] pub struct Photo { pub photo : Option < :: mtproto :: Photo > , pub caption : Option < :: mtproto :: string > , pub ttl_seconds : Option < :: mtproto :: int > , } impl :: BareSerialize for Photo { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Photo { ref photo , ref caption , ref ttl_seconds } = self ; let mut _flags = 0i32 ; if photo . is_some ( ) { _flags |= 1 << 0u32 ; } if caption . is_some ( ) { _flags |= 1 << 1u32 ; } if ttl_seconds . is_some ( ) { _flags |= 1 << 2u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; if let & Some ( ref inner ) = photo { _ser . write_boxed :: < :: mtproto :: Photo > ( inner ) ? ; } if let & Some ( ref inner ) = caption { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = ttl_seconds { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for Photo { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( Photo { photo : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; if _flags & ( 1 << 0u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: Photo > ( ) ? ) } else { None } } , caption : if _flags & ( 1 << 1u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , ttl_seconds : if _flags & ( 1 << 2u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for Photo { type Boxed = :: mtproto :: MessageMedia ; fn into_boxed ( self ) -> :: mtproto :: MessageMedia { :: mtproto :: MessageMedia :: Photo ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messageMediaVenue`\n\n```text\nmessageMediaVenue#2ec0533f geo:GeoPoint title:string address:string provider:string venue_id:string venue_type:string = MessageMedia;\n```\n" ] pub struct Venue { pub geo : :: mtproto :: GeoPoint , pub title : :: mtproto :: string , pub address : :: mtproto :: string , pub provider : :: mtproto :: string , pub venue_id : :: mtproto :: string , pub venue_type : :: mtproto :: string , } impl :: BareSerialize for Venue { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Venue { ref geo , ref title , ref address , ref provider , ref venue_id , ref venue_type } = self ; _ser . write_boxed :: < :: mtproto :: GeoPoint > ( geo ) ? ; _ser . write_bare :: < :: mtproto :: string > ( title ) ? ; _ser . write_bare :: < :: mtproto :: string > ( address ) ? ; _ser . write_bare :: < :: mtproto :: string > ( provider ) ? ; _ser . write_bare :: < :: mtproto :: string > ( venue_id ) ? ; _ser . write_bare :: < :: mtproto :: string > ( venue_type ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Venue { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Venue { geo : _de . read_boxed :: < :: mtproto :: GeoPoint > ( ) ? , title : _de . read_bare :: < :: mtproto :: string > ( ) ? , address : _de . read_bare :: < :: mtproto :: string > ( ) ? , provider : _de . read_bare :: < :: mtproto :: string > ( ) ? , venue_id : _de . read_bare :: < :: mtproto :: string > ( ) ? , venue_type : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for Venue { type Boxed = :: mtproto :: MessageMedia ; fn into_boxed ( self ) -> :: mtproto :: MessageMedia { :: mtproto :: MessageMedia :: Venue ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messageMediaWebPage`\n\n```text\nmessageMediaWebPage#a32dd600 webpage:WebPage = MessageMedia;\n```\n" ] pub struct WebPage { pub webpage : :: mtproto :: WebPage , } impl :: BareSerialize for WebPage { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & WebPage { ref webpage } = self ; _ser . write_boxed :: < :: mtproto :: WebPage > ( webpage ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for WebPage { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( WebPage { webpage : _de . read_boxed :: < :: mtproto :: WebPage > ( ) ? , } ) } } impl :: IntoBoxed for WebPage { type Boxed = :: mtproto :: MessageMedia ; fn into_boxed ( self ) -> :: mtproto :: MessageMedia { :: mtproto :: MessageMedia :: WebPage ( self ) } } } pub mod message_range { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messageRange`\n\n```text\nmessageRange#ae30253 min_id:int max_id:int = MessageRange;\n```\n" ] pub struct MessageRange { pub min_id : :: mtproto :: int , pub max_id : :: mtproto :: int , } impl :: BareSerialize for MessageRange { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & MessageRange { ref min_id , ref max_id } = self ; _ser . write_bare :: < :: mtproto :: int > ( min_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( max_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for MessageRange { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( MessageRange { min_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , max_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for MessageRange { type Boxed = :: mtproto :: MessageRange ; fn into_boxed ( self ) -> :: mtproto :: MessageRange { :: mtproto :: MessageRange :: MessageRange ( self ) } } } pub mod messages { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.AffectedHistory`\n\n```text\nmessages.affectedHistory#b45c69d1 pts:int pts_count:int offset:int = messages.AffectedHistory;\n```\n" ] pub enum AffectedHistory { AffectedHistory ( :: mtproto :: messages :: affected_history :: AffectedHistory ) , } impl AffectedHistory { pub fn offset ( & self ) -> & :: mtproto :: int { match self { & AffectedHistory :: AffectedHistory ( ref x ) => & x . offset , } } pub fn pts ( & self ) -> & :: mtproto :: int { match self { & AffectedHistory :: AffectedHistory ( ref x ) => & x . pts , } } pub fn pts_count ( & self ) -> & :: mtproto :: int { match self { & AffectedHistory :: AffectedHistory ( ref x ) => & x . pts_count , } } } impl :: BoxedSerialize for AffectedHistory { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & AffectedHistory :: AffectedHistory ( ref x ) => ( :: ConstructorNumber ( 0xb45c69d1 ) , x ) , } } } impl :: BoxedDeserialize for AffectedHistory { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xb45c69d1 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xb45c69d1 ) => Ok ( AffectedHistory :: AffectedHistory ( _de . read_bare :: < :: mtproto :: messages :: affected_history :: AffectedHistory > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.AffectedMessages`\n\n```text\nmessages.affectedMessages#84d19185 pts:int pts_count:int = messages.AffectedMessages;\n```\n" ] pub enum AffectedMessages { AffectedMessages ( :: mtproto :: messages :: affected_messages :: AffectedMessages ) , } impl AffectedMessages { pub fn pts ( & self ) -> & :: mtproto :: int { match self { & AffectedMessages :: AffectedMessages ( ref x ) => & x . pts , } } pub fn pts_count ( & self ) -> & :: mtproto :: int { match self { & AffectedMessages :: AffectedMessages ( ref x ) => & x . pts_count , } } } impl :: BoxedSerialize for AffectedMessages { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & AffectedMessages :: AffectedMessages ( ref x ) => ( :: ConstructorNumber ( 0x84d19185 ) , x ) , } } } impl :: BoxedDeserialize for AffectedMessages { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x84d19185 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x84d19185 ) => Ok ( AffectedMessages :: AffectedMessages ( _de . read_bare :: < :: mtproto :: messages :: affected_messages :: AffectedMessages > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.AllStickers`\n\n```text\nmessages.allStickersNotModified#e86602c3 = messages.AllStickers;\n\nmessages.allStickers#edfd405f hash:int sets:Vector<StickerSet> = messages.AllStickers;\n```\n" ] pub enum AllStickers { NotModified , AllStickers ( :: mtproto :: messages :: all_stickers :: AllStickers ) , } impl AllStickers { pub fn hash ( & self ) -> Option < & :: mtproto :: int > { match self { & AllStickers :: AllStickers ( ref x ) => Some ( & x . hash ) , _ => None } } pub fn sets ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: StickerSet > > { match self { & AllStickers :: AllStickers ( ref x ) => Some ( & x . sets ) , _ => None } } } impl :: BoxedSerialize for AllStickers { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & AllStickers :: NotModified => ( :: ConstructorNumber ( 0xe86602c3 ) , & ( ) ) , & AllStickers :: AllStickers ( ref x ) => ( :: ConstructorNumber ( 0xedfd405f ) , x ) , } } } impl :: BoxedDeserialize for AllStickers { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xe86602c3 ) , :: ConstructorNumber ( 0xedfd405f ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xe86602c3 ) => Ok ( AllStickers :: NotModified ) , :: ConstructorNumber ( 0xedfd405f ) => Ok ( AllStickers :: AllStickers ( _de . read_bare :: < :: mtproto :: messages :: all_stickers :: AllStickers > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } impl :: BoxedSerialize for Option < :: mtproto :: messages :: all_stickers :: AllStickers > { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match * self { None => ( :: ConstructorNumber ( 0xe86602c3 ) , & ( ) ) , Some ( ref x ) => ( :: ConstructorNumber ( 0xedfd405f ) , x ) , } } } impl :: BoxedDeserialize for Option < :: mtproto :: messages :: all_stickers :: AllStickers > { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xe86602c3 ) , :: ConstructorNumber ( 0xedfd405f ) ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xe86602c3 ) => Ok ( None ) , :: ConstructorNumber ( 0xedfd405f ) => Ok ( Some ( _de . read_bare :: < :: mtproto :: messages :: all_stickers :: AllStickers > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.ArchivedStickers`\n\n```text\nmessages.archivedStickers#4fcba9c8 count:int sets:Vector<StickerSetCovered> = messages.ArchivedStickers;\n```\n" ] pub enum ArchivedStickers { ArchivedStickers ( :: mtproto :: messages :: archived_stickers :: ArchivedStickers ) , } impl ArchivedStickers { pub fn count ( & self ) -> & :: mtproto :: int { match self { & ArchivedStickers :: ArchivedStickers ( ref x ) => & x . count , } } pub fn sets ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: StickerSetCovered > { match self { & ArchivedStickers :: ArchivedStickers ( ref x ) => & x . sets , } } } impl :: BoxedSerialize for ArchivedStickers { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ArchivedStickers :: ArchivedStickers ( ref x ) => ( :: ConstructorNumber ( 0x4fcba9c8 ) , x ) , } } } impl :: BoxedDeserialize for ArchivedStickers { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x4fcba9c8 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x4fcba9c8 ) => Ok ( ArchivedStickers :: ArchivedStickers ( _de . read_bare :: < :: mtproto :: messages :: archived_stickers :: ArchivedStickers > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.BotCallbackAnswer`\n\n```text\nmessages.botCallbackAnswer#36585ea4 flags:# alert:flags.1?true has_url:flags.3?true native_ui:flags.4?true message:flags.0?string url:flags.2?string cache_time:int = messages.BotCallbackAnswer;\n```\n" ] pub enum BotCallbackAnswer { BotCallbackAnswer ( :: mtproto :: messages :: bot_callback_answer :: BotCallbackAnswer ) , } impl BotCallbackAnswer { pub fn alert ( & self ) -> bool { match self { & BotCallbackAnswer :: BotCallbackAnswer ( ref x ) => x . alert , } } pub fn cache_time ( & self ) -> & :: mtproto :: int { match self { & BotCallbackAnswer :: BotCallbackAnswer ( ref x ) => & x . cache_time , } } pub fn has_url ( & self ) -> bool { match self { & BotCallbackAnswer :: BotCallbackAnswer ( ref x ) => x . has_url , } } pub fn message ( & self ) -> Option < & :: mtproto :: string > { match self { & BotCallbackAnswer :: BotCallbackAnswer ( ref x ) => x . message . as_ref ( ) , } } pub fn native_ui ( & self ) -> bool { match self { & BotCallbackAnswer :: BotCallbackAnswer ( ref x ) => x . native_ui , } } pub fn url ( & self ) -> Option < & :: mtproto :: string > { match self { & BotCallbackAnswer :: BotCallbackAnswer ( ref x ) => x . url . as_ref ( ) , } } } impl :: BoxedSerialize for BotCallbackAnswer { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & BotCallbackAnswer :: BotCallbackAnswer ( ref x ) => ( :: ConstructorNumber ( 0x36585ea4 ) , x ) , } } } impl :: BoxedDeserialize for BotCallbackAnswer { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x36585ea4 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x36585ea4 ) => Ok ( BotCallbackAnswer :: BotCallbackAnswer ( _de . read_bare :: < :: mtproto :: messages :: bot_callback_answer :: BotCallbackAnswer > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.BotResults`\n\n```text\nmessages.botResults#947ca848 flags:# gallery:flags.0?true query_id:long next_offset:flags.1?string switch_pm:flags.2?InlineBotSwitchPM results:Vector<BotInlineResult> cache_time:int users:Vector<User> = messages.BotResults;\n```\n" ] pub enum BotResults { BotResults ( :: mtproto :: messages :: bot_results :: BotResults ) , } impl BotResults { pub fn cache_time ( & self ) -> & :: mtproto :: int { match self { & BotResults :: BotResults ( ref x ) => & x . cache_time , } } pub fn gallery ( & self ) -> bool { match self { & BotResults :: BotResults ( ref x ) => x . gallery , } } pub fn next_offset ( & self ) -> Option < & :: mtproto :: string > { match self { & BotResults :: BotResults ( ref x ) => x . next_offset . as_ref ( ) , } } pub fn query_id ( & self ) -> & :: mtproto :: long { match self { & BotResults :: BotResults ( ref x ) => & x . query_id , } } pub fn results ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: BotInlineResult > { match self { & BotResults :: BotResults ( ref x ) => & x . results , } } pub fn switch_pm ( & self ) -> Option < & :: mtproto :: InlineBotSwitchPM > { match self { & BotResults :: BotResults ( ref x ) => x . switch_pm . as_ref ( ) , } } pub fn users ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > { match self { & BotResults :: BotResults ( ref x ) => & x . users , } } } impl :: BoxedSerialize for BotResults { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & BotResults :: BotResults ( ref x ) => ( :: ConstructorNumber ( 0x947ca848 ) , x ) , } } } impl :: BoxedDeserialize for BotResults { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x947ca848 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x947ca848 ) => Ok ( BotResults :: BotResults ( _de . read_bare :: < :: mtproto :: messages :: bot_results :: BotResults > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.ChatFull`\n\n```text\nmessages.chatFull#e5d7d19c full_chat:ChatFull chats:Vector<Chat> users:Vector<User> = messages.ChatFull;\n```\n" ] pub enum ChatFull { ChatFull ( :: mtproto :: messages :: chat_full :: ChatFull ) , } impl ChatFull { pub fn chats ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > { match self { & ChatFull :: ChatFull ( ref x ) => & x . chats , } } pub fn full_chat ( & self ) -> & :: mtproto :: ChatFull { match self { & ChatFull :: ChatFull ( ref x ) => & x . full_chat , } } pub fn users ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > { match self { & ChatFull :: ChatFull ( ref x ) => & x . users , } } } impl :: BoxedSerialize for ChatFull { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ChatFull :: ChatFull ( ref x ) => ( :: ConstructorNumber ( 0xe5d7d19c ) , x ) , } } } impl :: BoxedDeserialize for ChatFull { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xe5d7d19c ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xe5d7d19c ) => Ok ( ChatFull :: ChatFull ( _de . read_bare :: < :: mtproto :: messages :: chat_full :: ChatFull > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.Chats`\n\n```text\nmessages.chats#64ff9fd5 chats:Vector<Chat> = messages.Chats;\n\nmessages.chatsSlice#9cd81144 count:int chats:Vector<Chat> = messages.Chats;\n```\n" ] pub enum Chats { Chats ( :: mtproto :: messages :: chats :: Chats ) , Slice ( :: mtproto :: messages :: chats :: Slice ) , } impl Chats { pub fn chats ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > { match self { & Chats :: Chats ( ref x ) => & x . chats , & Chats :: Slice ( ref x ) => & x . chats , } } pub fn count ( & self ) -> Option < & :: mtproto :: int > { match self { & Chats :: Slice ( ref x ) => Some ( & x . count ) , _ => None } } } impl :: BoxedSerialize for Chats { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Chats :: Chats ( ref x ) => ( :: ConstructorNumber ( 0x64ff9fd5 ) , x ) , & Chats :: Slice ( ref x ) => ( :: ConstructorNumber ( 0x9cd81144 ) , x ) , } } } impl :: BoxedDeserialize for Chats { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x64ff9fd5 ) , :: ConstructorNumber ( 0x9cd81144 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x64ff9fd5 ) => Ok ( Chats :: Chats ( _de . read_bare :: < :: mtproto :: messages :: chats :: Chats > ( ) ? ) ) , :: ConstructorNumber ( 0x9cd81144 ) => Ok ( Chats :: Slice ( _de . read_bare :: < :: mtproto :: messages :: chats :: Slice > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.DhConfig`\n\n```text\nmessages.dhConfigNotModified#c0e24635 random:bytes = messages.DhConfig;\n\nmessages.dhConfig#2c221edd g:int p:bytes version:int random:bytes = messages.DhConfig;\n```\n" ] pub enum DhConfig { NotModified ( :: mtproto :: messages :: dh_config :: NotModified ) , DhConfig ( :: mtproto :: messages :: dh_config :: DhConfig ) , } impl DhConfig { pub fn g ( & self ) -> Option < & :: mtproto :: int > { match self { & DhConfig :: DhConfig ( ref x ) => Some ( & x . g ) , _ => None } } pub fn p ( & self ) -> Option < & :: mtproto :: bytes > { match self { & DhConfig :: DhConfig ( ref x ) => Some ( & x . p ) , _ => None } } pub fn random ( & self ) -> & :: mtproto :: bytes { match self { & DhConfig :: DhConfig ( ref x ) => & x . random , & DhConfig :: NotModified ( ref x ) => & x . random , } } pub fn version ( & self ) -> Option < & :: mtproto :: int > { match self { & DhConfig :: DhConfig ( ref x ) => Some ( & x . version ) , _ => None } } } impl :: BoxedSerialize for DhConfig { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & DhConfig :: NotModified ( ref x ) => ( :: ConstructorNumber ( 0xc0e24635 ) , x ) , & DhConfig :: DhConfig ( ref x ) => ( :: ConstructorNumber ( 0x2c221edd ) , x ) , } } } impl :: BoxedDeserialize for DhConfig { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xc0e24635 ) , :: ConstructorNumber ( 0x2c221edd ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xc0e24635 ) => Ok ( DhConfig :: NotModified ( _de . read_bare :: < :: mtproto :: messages :: dh_config :: NotModified > ( ) ? ) ) , :: ConstructorNumber ( 0x2c221edd ) => Ok ( DhConfig :: DhConfig ( _de . read_bare :: < :: mtproto :: messages :: dh_config :: DhConfig > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.Dialogs`\n\n```text\nmessages.dialogs#15ba6c40 dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Dialogs;\n\nmessages.dialogsSlice#71e094f3 count:int dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Dialogs;\n```\n" ] pub enum Dialogs { Dialogs ( :: mtproto :: messages :: dialogs :: Dialogs ) , Slice ( :: mtproto :: messages :: dialogs :: Slice ) , } impl Dialogs { pub fn chats ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > { match self { & Dialogs :: Dialogs ( ref x ) => & x . chats , & Dialogs :: Slice ( ref x ) => & x . chats , } } pub fn count ( & self ) -> Option < & :: mtproto :: int > { match self { & Dialogs :: Slice ( ref x ) => Some ( & x . count ) , _ => None } } pub fn dialogs ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Dialog > { match self { & Dialogs :: Dialogs ( ref x ) => & x . dialogs , & Dialogs :: Slice ( ref x ) => & x . dialogs , } } pub fn messages ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Message > { match self { & Dialogs :: Dialogs ( ref x ) => & x . messages , & Dialogs :: Slice ( ref x ) => & x . messages , } } pub fn users ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > { match self { & Dialogs :: Slice ( ref x ) => & x . users , & Dialogs :: Dialogs ( ref x ) => & x . users , } } } impl :: BoxedSerialize for Dialogs { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Dialogs :: Dialogs ( ref x ) => ( :: ConstructorNumber ( 0x15ba6c40 ) , x ) , & Dialogs :: Slice ( ref x ) => ( :: ConstructorNumber ( 0x71e094f3 ) , x ) , } } } impl :: BoxedDeserialize for Dialogs { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x15ba6c40 ) , :: ConstructorNumber ( 0x71e094f3 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x15ba6c40 ) => Ok ( Dialogs :: Dialogs ( _de . read_bare :: < :: mtproto :: messages :: dialogs :: Dialogs > ( ) ? ) ) , :: ConstructorNumber ( 0x71e094f3 ) => Ok ( Dialogs :: Slice ( _de . read_bare :: < :: mtproto :: messages :: dialogs :: Slice > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.FavedStickers`\n\n```text\nmessages.favedStickersNotModified#9e8fa6d3 = messages.FavedStickers;\n\nmessages.favedStickers#f37f2f16 hash:int packs:Vector<StickerPack> stickers:Vector<Document> = messages.FavedStickers;\n```\n" ] pub enum FavedStickers { NotModified , FavedStickers ( :: mtproto :: messages :: faved_stickers :: FavedStickers ) , } impl FavedStickers { pub fn hash ( & self ) -> Option < & :: mtproto :: int > { match self { & FavedStickers :: FavedStickers ( ref x ) => Some ( & x . hash ) , _ => None } } pub fn packs ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: StickerPack > > { match self { & FavedStickers :: FavedStickers ( ref x ) => Some ( & x . packs ) , _ => None } } pub fn stickers ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Document > > { match self { & FavedStickers :: FavedStickers ( ref x ) => Some ( & x . stickers ) , _ => None } } } impl :: BoxedSerialize for FavedStickers { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & FavedStickers :: NotModified => ( :: ConstructorNumber ( 0x9e8fa6d3 ) , & ( ) ) , & FavedStickers :: FavedStickers ( ref x ) => ( :: ConstructorNumber ( 0xf37f2f16 ) , x ) , } } } impl :: BoxedDeserialize for FavedStickers { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x9e8fa6d3 ) , :: ConstructorNumber ( 0xf37f2f16 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x9e8fa6d3 ) => Ok ( FavedStickers :: NotModified ) , :: ConstructorNumber ( 0xf37f2f16 ) => Ok ( FavedStickers :: FavedStickers ( _de . read_bare :: < :: mtproto :: messages :: faved_stickers :: FavedStickers > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } impl :: BoxedSerialize for Option < :: mtproto :: messages :: faved_stickers :: FavedStickers > { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match * self { None => ( :: ConstructorNumber ( 0x9e8fa6d3 ) , & ( ) ) , Some ( ref x ) => ( :: ConstructorNumber ( 0xf37f2f16 ) , x ) , } } } impl :: BoxedDeserialize for Option < :: mtproto :: messages :: faved_stickers :: FavedStickers > { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x9e8fa6d3 ) , :: ConstructorNumber ( 0xf37f2f16 ) ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x9e8fa6d3 ) => Ok ( None ) , :: ConstructorNumber ( 0xf37f2f16 ) => Ok ( Some ( _de . read_bare :: < :: mtproto :: messages :: faved_stickers :: FavedStickers > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.FeaturedStickers`\n\n```text\nmessages.featuredStickersNotModified#4ede3cf = messages.FeaturedStickers;\n\nmessages.featuredStickers#f89d88e5 hash:int sets:Vector<StickerSetCovered> unread:Vector<long> = messages.FeaturedStickers;\n```\n" ] pub enum FeaturedStickers { NotModified , FeaturedStickers ( :: mtproto :: messages :: featured_stickers :: FeaturedStickers ) , } impl FeaturedStickers { pub fn hash ( & self ) -> Option < & :: mtproto :: int > { match self { & FeaturedStickers :: FeaturedStickers ( ref x ) => Some ( & x . hash ) , _ => None } } pub fn sets ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: StickerSetCovered > > { match self { & FeaturedStickers :: FeaturedStickers ( ref x ) => Some ( & x . sets ) , _ => None } } pub fn unread ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > > { match self { & FeaturedStickers :: FeaturedStickers ( ref x ) => Some ( & x . unread ) , _ => None } } } impl :: BoxedSerialize for FeaturedStickers { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & FeaturedStickers :: NotModified => ( :: ConstructorNumber ( 0x04ede3cf ) , & ( ) ) , & FeaturedStickers :: FeaturedStickers ( ref x ) => ( :: ConstructorNumber ( 0xf89d88e5 ) , x ) , } } } impl :: BoxedDeserialize for FeaturedStickers { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x04ede3cf ) , :: ConstructorNumber ( 0xf89d88e5 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x04ede3cf ) => Ok ( FeaturedStickers :: NotModified ) , :: ConstructorNumber ( 0xf89d88e5 ) => Ok ( FeaturedStickers :: FeaturedStickers ( _de . read_bare :: < :: mtproto :: messages :: featured_stickers :: FeaturedStickers > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } impl :: BoxedSerialize for Option < :: mtproto :: messages :: featured_stickers :: FeaturedStickers > { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match * self { None => ( :: ConstructorNumber ( 0x04ede3cf ) , & ( ) ) , Some ( ref x ) => ( :: ConstructorNumber ( 0xf89d88e5 ) , x ) , } } } impl :: BoxedDeserialize for Option < :: mtproto :: messages :: featured_stickers :: FeaturedStickers > { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x04ede3cf ) , :: ConstructorNumber ( 0xf89d88e5 ) ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x04ede3cf ) => Ok ( None ) , :: ConstructorNumber ( 0xf89d88e5 ) => Ok ( Some ( _de . read_bare :: < :: mtproto :: messages :: featured_stickers :: FeaturedStickers > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.FoundGifs`\n\n```text\nmessages.foundGifs#450a1c0a next_offset:int results:Vector<FoundGif> = messages.FoundGifs;\n```\n" ] pub enum FoundGifs { FoundGifs ( :: mtproto :: messages :: found_gifs :: FoundGifs ) , } impl FoundGifs { pub fn next_offset ( & self ) -> & :: mtproto :: int { match self { & FoundGifs :: FoundGifs ( ref x ) => & x . next_offset , } } pub fn results ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: FoundGif > { match self { & FoundGifs :: FoundGifs ( ref x ) => & x . results , } } } impl :: BoxedSerialize for FoundGifs { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & FoundGifs :: FoundGifs ( ref x ) => ( :: ConstructorNumber ( 0x450a1c0a ) , x ) , } } } impl :: BoxedDeserialize for FoundGifs { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x450a1c0a ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x450a1c0a ) => Ok ( FoundGifs :: FoundGifs ( _de . read_bare :: < :: mtproto :: messages :: found_gifs :: FoundGifs > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.HighScores`\n\n```text\nmessages.highScores#9a3bfd99 scores:Vector<HighScore> users:Vector<User> = messages.HighScores;\n```\n" ] pub enum HighScores { HighScores ( :: mtproto :: messages :: high_scores :: HighScores ) , } impl HighScores { pub fn scores ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: HighScore > { match self { & HighScores :: HighScores ( ref x ) => & x . scores , } } pub fn users ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > { match self { & HighScores :: HighScores ( ref x ) => & x . users , } } } impl :: BoxedSerialize for HighScores { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & HighScores :: HighScores ( ref x ) => ( :: ConstructorNumber ( 0x9a3bfd99 ) , x ) , } } } impl :: BoxedDeserialize for HighScores { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x9a3bfd99 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x9a3bfd99 ) => Ok ( HighScores :: HighScores ( _de . read_bare :: < :: mtproto :: messages :: high_scores :: HighScores > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.MessageEditData`\n\n```text\nmessages.messageEditData#26b5dde6 flags:# caption:flags.0?true = messages.MessageEditData;\n```\n" ] pub enum MessageEditData { MessageEditData ( :: mtproto :: messages :: message_edit_data :: MessageEditData ) , } impl MessageEditData { pub fn caption ( & self ) -> bool { match self { & MessageEditData :: MessageEditData ( ref x ) => x . caption , } } } impl :: BoxedSerialize for MessageEditData { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & MessageEditData :: MessageEditData ( ref x ) => ( :: ConstructorNumber ( 0x26b5dde6 ) , x ) , } } } impl :: BoxedDeserialize for MessageEditData { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x26b5dde6 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x26b5dde6 ) => Ok ( MessageEditData :: MessageEditData ( _de . read_bare :: < :: mtproto :: messages :: message_edit_data :: MessageEditData > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.Messages`\n\n```text\nmessages.messages#8c718e87 messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;\n\nmessages.messagesSlice#b446ae3 count:int messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;\n\nmessages.channelMessages#99262e37 flags:# pts:int count:int messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;\n\nmessages.messagesNotModified#74535f21 count:int = messages.Messages;\n```\n" ] pub enum Messages { Messages ( :: mtproto :: messages :: messages :: Messages ) , MessagesSlice ( :: mtproto :: messages :: messages :: MessagesSlice ) , ChannelMessages ( :: mtproto :: messages :: messages :: ChannelMessages ) , MessagesNotModified ( :: mtproto :: messages :: messages :: MessagesNotModified ) , } impl Messages { pub fn chats ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > { match self { & Messages :: Messages ( ref x ) => Some ( & x . chats ) , & Messages :: ChannelMessages ( ref x ) => Some ( & x . chats ) , & Messages :: MessagesSlice ( ref x ) => Some ( & x . chats ) , _ => None } } pub fn count ( & self ) -> Option < & :: mtproto :: int > { match self { & Messages :: ChannelMessages ( ref x ) => Some ( & x . count ) , & Messages :: MessagesNotModified ( ref x ) => Some ( & x . count ) , & Messages :: MessagesSlice ( ref x ) => Some ( & x . count ) , _ => None } } pub fn messages ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Message > > { match self { & Messages :: Messages ( ref x ) => Some ( & x . messages ) , & Messages :: ChannelMessages ( ref x ) => Some ( & x . messages ) , & Messages :: MessagesSlice ( ref x ) => Some ( & x . messages ) , _ => None } } pub fn pts ( & self ) -> Option < & :: mtproto :: int > { match self { & Messages :: ChannelMessages ( ref x ) => Some ( & x . pts ) , _ => None } } pub fn users ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > { match self { & Messages :: MessagesSlice ( ref x ) => Some ( & x . users ) , & Messages :: ChannelMessages ( ref x ) => Some ( & x . users ) , & Messages :: Messages ( ref x ) => Some ( & x . users ) , _ => None } } } impl :: BoxedSerialize for Messages { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Messages :: Messages ( ref x ) => ( :: ConstructorNumber ( 0x8c718e87 ) , x ) , & Messages :: MessagesSlice ( ref x ) => ( :: ConstructorNumber ( 0x0b446ae3 ) , x ) , & Messages :: ChannelMessages ( ref x ) => ( :: ConstructorNumber ( 0x99262e37 ) , x ) , & Messages :: MessagesNotModified ( ref x ) => ( :: ConstructorNumber ( 0x74535f21 ) , x ) , } } } impl :: BoxedDeserialize for Messages { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x8c718e87 ) , :: ConstructorNumber ( 0x0b446ae3 ) , :: ConstructorNumber ( 0x99262e37 ) , :: ConstructorNumber ( 0x74535f21 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x8c718e87 ) => Ok ( Messages :: Messages ( _de . read_bare :: < :: mtproto :: messages :: messages :: Messages > ( ) ? ) ) , :: ConstructorNumber ( 0x0b446ae3 ) => Ok ( Messages :: MessagesSlice ( _de . read_bare :: < :: mtproto :: messages :: messages :: MessagesSlice > ( ) ? ) ) , :: ConstructorNumber ( 0x99262e37 ) => Ok ( Messages :: ChannelMessages ( _de . read_bare :: < :: mtproto :: messages :: messages :: ChannelMessages > ( ) ? ) ) , :: ConstructorNumber ( 0x74535f21 ) => Ok ( Messages :: MessagesNotModified ( _de . read_bare :: < :: mtproto :: messages :: messages :: MessagesNotModified > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.PeerDialogs`\n\n```text\nmessages.peerDialogs#3371c354 dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> state:updates.State = messages.PeerDialogs;\n```\n" ] pub enum PeerDialogs { PeerDialogs ( :: mtproto :: messages :: peer_dialogs :: PeerDialogs ) , } impl PeerDialogs { pub fn chats ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > { match self { & PeerDialogs :: PeerDialogs ( ref x ) => & x . chats , } } pub fn dialogs ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Dialog > { match self { & PeerDialogs :: PeerDialogs ( ref x ) => & x . dialogs , } } pub fn messages ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Message > { match self { & PeerDialogs :: PeerDialogs ( ref x ) => & x . messages , } } pub fn state ( & self ) -> & :: mtproto :: updates :: State { match self { & PeerDialogs :: PeerDialogs ( ref x ) => & x . state , } } pub fn users ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > { match self { & PeerDialogs :: PeerDialogs ( ref x ) => & x . users , } } } impl :: BoxedSerialize for PeerDialogs { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & PeerDialogs :: PeerDialogs ( ref x ) => ( :: ConstructorNumber ( 0x3371c354 ) , x ) , } } } impl :: BoxedDeserialize for PeerDialogs { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x3371c354 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x3371c354 ) => Ok ( PeerDialogs :: PeerDialogs ( _de . read_bare :: < :: mtproto :: messages :: peer_dialogs :: PeerDialogs > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.RecentStickers`\n\n```text\nmessages.recentStickersNotModified#b17f890 = messages.RecentStickers;\n\nmessages.recentStickers#5ce20970 hash:int stickers:Vector<Document> = messages.RecentStickers;\n```\n" ] pub enum RecentStickers { NotModified , RecentStickers ( :: mtproto :: messages :: recent_stickers :: RecentStickers ) , } impl RecentStickers { pub fn hash ( & self ) -> Option < & :: mtproto :: int > { match self { & RecentStickers :: RecentStickers ( ref x ) => Some ( & x . hash ) , _ => None } } pub fn stickers ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Document > > { match self { & RecentStickers :: RecentStickers ( ref x ) => Some ( & x . stickers ) , _ => None } } } impl :: BoxedSerialize for RecentStickers { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & RecentStickers :: NotModified => ( :: ConstructorNumber ( 0x0b17f890 ) , & ( ) ) , & RecentStickers :: RecentStickers ( ref x ) => ( :: ConstructorNumber ( 0x5ce20970 ) , x ) , } } } impl :: BoxedDeserialize for RecentStickers { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x0b17f890 ) , :: ConstructorNumber ( 0x5ce20970 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x0b17f890 ) => Ok ( RecentStickers :: NotModified ) , :: ConstructorNumber ( 0x5ce20970 ) => Ok ( RecentStickers :: RecentStickers ( _de . read_bare :: < :: mtproto :: messages :: recent_stickers :: RecentStickers > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } impl :: BoxedSerialize for Option < :: mtproto :: messages :: recent_stickers :: RecentStickers > { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match * self { None => ( :: ConstructorNumber ( 0x0b17f890 ) , & ( ) ) , Some ( ref x ) => ( :: ConstructorNumber ( 0x5ce20970 ) , x ) , } } } impl :: BoxedDeserialize for Option < :: mtproto :: messages :: recent_stickers :: RecentStickers > { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x0b17f890 ) , :: ConstructorNumber ( 0x5ce20970 ) ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x0b17f890 ) => Ok ( None ) , :: ConstructorNumber ( 0x5ce20970 ) => Ok ( Some ( _de . read_bare :: < :: mtproto :: messages :: recent_stickers :: RecentStickers > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.SavedGifs`\n\n```text\nmessages.savedGifsNotModified#e8025ca2 = messages.SavedGifs;\n\nmessages.savedGifs#2e0709a5 hash:int gifs:Vector<Document> = messages.SavedGifs;\n```\n" ] pub enum SavedGifs { NotModified , SavedGifs ( :: mtproto :: messages :: saved_gifs :: SavedGifs ) , } impl SavedGifs { pub fn gifs ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Document > > { match self { & SavedGifs :: SavedGifs ( ref x ) => Some ( & x . gifs ) , _ => None } } pub fn hash ( & self ) -> Option < & :: mtproto :: int > { match self { & SavedGifs :: SavedGifs ( ref x ) => Some ( & x . hash ) , _ => None } } } impl :: BoxedSerialize for SavedGifs { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & SavedGifs :: NotModified => ( :: ConstructorNumber ( 0xe8025ca2 ) , & ( ) ) , & SavedGifs :: SavedGifs ( ref x ) => ( :: ConstructorNumber ( 0x2e0709a5 ) , x ) , } } } impl :: BoxedDeserialize for SavedGifs { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xe8025ca2 ) , :: ConstructorNumber ( 0x2e0709a5 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xe8025ca2 ) => Ok ( SavedGifs :: NotModified ) , :: ConstructorNumber ( 0x2e0709a5 ) => Ok ( SavedGifs :: SavedGifs ( _de . read_bare :: < :: mtproto :: messages :: saved_gifs :: SavedGifs > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } impl :: BoxedSerialize for Option < :: mtproto :: messages :: saved_gifs :: SavedGifs > { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match * self { None => ( :: ConstructorNumber ( 0xe8025ca2 ) , & ( ) ) , Some ( ref x ) => ( :: ConstructorNumber ( 0x2e0709a5 ) , x ) , } } } impl :: BoxedDeserialize for Option < :: mtproto :: messages :: saved_gifs :: SavedGifs > { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xe8025ca2 ) , :: ConstructorNumber ( 0x2e0709a5 ) ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xe8025ca2 ) => Ok ( None ) , :: ConstructorNumber ( 0x2e0709a5 ) => Ok ( Some ( _de . read_bare :: < :: mtproto :: messages :: saved_gifs :: SavedGifs > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.SentEncryptedMessage`\n\n```text\nmessages.sentEncryptedMessage#560f8935 date:int = messages.SentEncryptedMessage;\n\nmessages.sentEncryptedFile#9493ff32 date:int file:EncryptedFile = messages.SentEncryptedMessage;\n```\n" ] pub enum SentEncryptedMessage { Message ( :: mtproto :: messages :: sent_encrypted :: Message ) , File ( :: mtproto :: messages :: sent_encrypted :: File ) , } impl SentEncryptedMessage { pub fn date ( & self ) -> & :: mtproto :: int { match self { & SentEncryptedMessage :: File ( ref x ) => & x . date , & SentEncryptedMessage :: Message ( ref x ) => & x . date , } } pub fn file ( & self ) -> Option < & :: mtproto :: EncryptedFile > { match self { & SentEncryptedMessage :: File ( ref x ) => Some ( & x . file ) , _ => None } } } impl :: BoxedSerialize for SentEncryptedMessage { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & SentEncryptedMessage :: Message ( ref x ) => ( :: ConstructorNumber ( 0x560f8935 ) , x ) , & SentEncryptedMessage :: File ( ref x ) => ( :: ConstructorNumber ( 0x9493ff32 ) , x ) , } } } impl :: BoxedDeserialize for SentEncryptedMessage { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x560f8935 ) , :: ConstructorNumber ( 0x9493ff32 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x560f8935 ) => Ok ( SentEncryptedMessage :: Message ( _de . read_bare :: < :: mtproto :: messages :: sent_encrypted :: Message > ( ) ? ) ) , :: ConstructorNumber ( 0x9493ff32 ) => Ok ( SentEncryptedMessage :: File ( _de . read_bare :: < :: mtproto :: messages :: sent_encrypted :: File > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.StickerSet`\n\n```text\nmessages.stickerSet#b60a24a6 set:StickerSet packs:Vector<StickerPack> documents:Vector<Document> = messages.StickerSet;\n```\n" ] pub enum StickerSet { StickerSet ( :: mtproto :: messages :: sticker_set :: StickerSet ) , } impl StickerSet { pub fn documents ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Document > { match self { & StickerSet :: StickerSet ( ref x ) => & x . documents , } } pub fn packs ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: StickerPack > { match self { & StickerSet :: StickerSet ( ref x ) => & x . packs , } } pub fn set ( & self ) -> & :: mtproto :: StickerSet { match self { & StickerSet :: StickerSet ( ref x ) => & x . set , } } } impl :: BoxedSerialize for StickerSet { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & StickerSet :: StickerSet ( ref x ) => ( :: ConstructorNumber ( 0xb60a24a6 ) , x ) , } } } impl :: BoxedDeserialize for StickerSet { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xb60a24a6 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xb60a24a6 ) => Ok ( StickerSet :: StickerSet ( _de . read_bare :: < :: mtproto :: messages :: sticker_set :: StickerSet > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.StickerSetInstallResult`\n\n```text\nmessages.stickerSetInstallResultSuccess#38641628 = messages.StickerSetInstallResult;\n\nmessages.stickerSetInstallResultArchive#35e410a8 sets:Vector<StickerSetCovered> = messages.StickerSetInstallResult;\n```\n" ] pub enum StickerSetInstallResult { Success , Archive ( :: mtproto :: messages :: sticker_set_install_result :: Archive ) , } impl StickerSetInstallResult { pub fn sets ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: StickerSetCovered > > { match self { & StickerSetInstallResult :: Archive ( ref x ) => Some ( & x . sets ) , _ => None } } } impl :: BoxedSerialize for StickerSetInstallResult { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & StickerSetInstallResult :: Success => ( :: ConstructorNumber ( 0x38641628 ) , & ( ) ) , & StickerSetInstallResult :: Archive ( ref x ) => ( :: ConstructorNumber ( 0x35e410a8 ) , x ) , } } } impl :: BoxedDeserialize for StickerSetInstallResult { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x38641628 ) , :: ConstructorNumber ( 0x35e410a8 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x38641628 ) => Ok ( StickerSetInstallResult :: Success ) , :: ConstructorNumber ( 0x35e410a8 ) => Ok ( StickerSetInstallResult :: Archive ( _de . read_bare :: < :: mtproto :: messages :: sticker_set_install_result :: Archive > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } impl :: BoxedSerialize for Option < :: mtproto :: messages :: sticker_set_install_result :: Archive > { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match * self { None => ( :: ConstructorNumber ( 0x38641628 ) , & ( ) ) , Some ( ref x ) => ( :: ConstructorNumber ( 0x35e410a8 ) , x ) , } } } impl :: BoxedDeserialize for Option < :: mtproto :: messages :: sticker_set_install_result :: Archive > { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x38641628 ) , :: ConstructorNumber ( 0x35e410a8 ) ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x38641628 ) => Ok ( None ) , :: ConstructorNumber ( 0x35e410a8 ) => Ok ( Some ( _de . read_bare :: < :: mtproto :: messages :: sticker_set_install_result :: Archive > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.Stickers`\n\n```text\nmessages.stickersNotModified#f1749a22 = messages.Stickers;\n\nmessages.stickers#8a8ecd32 hash:string stickers:Vector<Document> = messages.Stickers;\n```\n" ] pub enum Stickers { NotModified , Stickers ( :: mtproto :: messages :: stickers :: Stickers ) , } impl Stickers { pub fn hash ( & self ) -> Option < & :: mtproto :: string > { match self { & Stickers :: Stickers ( ref x ) => Some ( & x . hash ) , _ => None } } pub fn stickers ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Document > > { match self { & Stickers :: Stickers ( ref x ) => Some ( & x . stickers ) , _ => None } } } impl :: BoxedSerialize for Stickers { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Stickers :: NotModified => ( :: ConstructorNumber ( 0xf1749a22 ) , & ( ) ) , & Stickers :: Stickers ( ref x ) => ( :: ConstructorNumber ( 0x8a8ecd32 ) , x ) , } } } impl :: BoxedDeserialize for Stickers { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xf1749a22 ) , :: ConstructorNumber ( 0x8a8ecd32 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xf1749a22 ) => Ok ( Stickers :: NotModified ) , :: ConstructorNumber ( 0x8a8ecd32 ) => Ok ( Stickers :: Stickers ( _de . read_bare :: < :: mtproto :: messages :: stickers :: Stickers > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } impl :: BoxedSerialize for Option < :: mtproto :: messages :: stickers :: Stickers > { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match * self { None => ( :: ConstructorNumber ( 0xf1749a22 ) , & ( ) ) , Some ( ref x ) => ( :: ConstructorNumber ( 0x8a8ecd32 ) , x ) , } } } impl :: BoxedDeserialize for Option < :: mtproto :: messages :: stickers :: Stickers > { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xf1749a22 ) , :: ConstructorNumber ( 0x8a8ecd32 ) ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xf1749a22 ) => Ok ( None ) , :: ConstructorNumber ( 0x8a8ecd32 ) => Ok ( Some ( _de . read_bare :: < :: mtproto :: messages :: stickers :: Stickers > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } pub mod affected_history { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.affectedHistory`\n\n```text\nmessages.affectedHistory#b45c69d1 pts:int pts_count:int offset:int = messages.AffectedHistory;\n```\n" ] pub struct AffectedHistory { pub pts : :: mtproto :: int , pub pts_count : :: mtproto :: int , pub offset : :: mtproto :: int , } impl :: BareSerialize for AffectedHistory { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & AffectedHistory { ref pts , ref pts_count , ref offset } = self ; _ser . write_bare :: < :: mtproto :: int > ( pts ) ? ; _ser . write_bare :: < :: mtproto :: int > ( pts_count ) ? ; _ser . write_bare :: < :: mtproto :: int > ( offset ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for AffectedHistory { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( AffectedHistory { pts : _de . read_bare :: < :: mtproto :: int > ( ) ? , pts_count : _de . read_bare :: < :: mtproto :: int > ( ) ? , offset : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for AffectedHistory { type Boxed = :: mtproto :: messages :: AffectedHistory ; fn into_boxed ( self ) -> :: mtproto :: messages :: AffectedHistory { :: mtproto :: messages :: AffectedHistory :: AffectedHistory ( self ) } } } pub mod affected_messages { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.affectedMessages`\n\n```text\nmessages.affectedMessages#84d19185 pts:int pts_count:int = messages.AffectedMessages;\n```\n" ] pub struct AffectedMessages { pub pts : :: mtproto :: int , pub pts_count : :: mtproto :: int , } impl :: BareSerialize for AffectedMessages { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & AffectedMessages { ref pts , ref pts_count } = self ; _ser . write_bare :: < :: mtproto :: int > ( pts ) ? ; _ser . write_bare :: < :: mtproto :: int > ( pts_count ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for AffectedMessages { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( AffectedMessages { pts : _de . read_bare :: < :: mtproto :: int > ( ) ? , pts_count : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for AffectedMessages { type Boxed = :: mtproto :: messages :: AffectedMessages ; fn into_boxed ( self ) -> :: mtproto :: messages :: AffectedMessages { :: mtproto :: messages :: AffectedMessages :: AffectedMessages ( self ) } } } pub mod all_stickers { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.allStickers`\n\n```text\nmessages.allStickers#edfd405f hash:int sets:Vector<StickerSet> = messages.AllStickers;\n```\n" ] pub struct AllStickers { pub hash : :: mtproto :: int , pub sets : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: StickerSet > , } impl :: BareSerialize for AllStickers { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & AllStickers { ref hash , ref sets } = self ; _ser . write_bare :: < :: mtproto :: int > ( hash ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: StickerSet > > ( sets ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for AllStickers { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( AllStickers { hash : _de . read_bare :: < :: mtproto :: int > ( ) ? , sets : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: StickerSet > > ( ) ? , } ) } } impl :: IntoBoxed for AllStickers { type Boxed = :: mtproto :: messages :: AllStickers ; fn into_boxed ( self ) -> :: mtproto :: messages :: AllStickers { :: mtproto :: messages :: AllStickers :: AllStickers ( self ) } } } pub mod archived_stickers { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.archivedStickers`\n\n```text\nmessages.archivedStickers#4fcba9c8 count:int sets:Vector<StickerSetCovered> = messages.ArchivedStickers;\n```\n" ] pub struct ArchivedStickers { pub count : :: mtproto :: int , pub sets : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: StickerSetCovered > , } impl :: BareSerialize for ArchivedStickers { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ArchivedStickers { ref count , ref sets } = self ; _ser . write_bare :: < :: mtproto :: int > ( count ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: StickerSetCovered > > ( sets ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ArchivedStickers { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ArchivedStickers { count : _de . read_bare :: < :: mtproto :: int > ( ) ? , sets : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: StickerSetCovered > > ( ) ? , } ) } } impl :: IntoBoxed for ArchivedStickers { type Boxed = :: mtproto :: messages :: ArchivedStickers ; fn into_boxed ( self ) -> :: mtproto :: messages :: ArchivedStickers { :: mtproto :: messages :: ArchivedStickers :: ArchivedStickers ( self ) } } } pub mod bot_callback_answer { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.botCallbackAnswer`\n\n```text\nmessages.botCallbackAnswer#36585ea4 flags:# alert:flags.1?true has_url:flags.3?true native_ui:flags.4?true message:flags.0?string url:flags.2?string cache_time:int = messages.BotCallbackAnswer;\n```\n" ] pub struct BotCallbackAnswer { pub alert : bool , pub has_url : bool , pub native_ui : bool , pub message : Option < :: mtproto :: string > , pub url : Option < :: mtproto :: string > , pub cache_time : :: mtproto :: int , } impl :: BareSerialize for BotCallbackAnswer { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & BotCallbackAnswer { alert , has_url , native_ui , ref message , ref url , ref cache_time } = self ; let mut _flags = 0i32 ; if alert { _flags |= 1 << 1u32 ; } if has_url { _flags |= 1 << 3u32 ; } if native_ui { _flags |= 1 << 4u32 ; } if message . is_some ( ) { _flags |= 1 << 0u32 ; } if url . is_some ( ) { _flags |= 1 << 2u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; if let & Some ( ref inner ) = message { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = url { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } _ser . write_bare :: < :: mtproto :: int > ( cache_time ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for BotCallbackAnswer { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( BotCallbackAnswer { alert : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 1u32 ) != 0 } , has_url : _flags & ( 1 << 3u32 ) != 0 , native_ui : _flags & ( 1 << 4u32 ) != 0 , message : if _flags & ( 1 << 0u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , url : if _flags & ( 1 << 2u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , cache_time : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for BotCallbackAnswer { type Boxed = :: mtproto :: messages :: BotCallbackAnswer ; fn into_boxed ( self ) -> :: mtproto :: messages :: BotCallbackAnswer { :: mtproto :: messages :: BotCallbackAnswer :: BotCallbackAnswer ( self ) } } } pub mod bot_results { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.botResults`\n\n```text\nmessages.botResults#947ca848 flags:# gallery:flags.0?true query_id:long next_offset:flags.1?string switch_pm:flags.2?InlineBotSwitchPM results:Vector<BotInlineResult> cache_time:int users:Vector<User> = messages.BotResults;\n```\n" ] pub struct BotResults { pub gallery : bool , pub query_id : :: mtproto :: long , pub next_offset : Option < :: mtproto :: string > , pub switch_pm : Option < :: mtproto :: InlineBotSwitchPM > , pub results : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: BotInlineResult > , pub cache_time : :: mtproto :: int , pub users : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > , } impl :: BareSerialize for BotResults { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & BotResults { gallery , ref query_id , ref next_offset , ref switch_pm , ref results , ref cache_time , ref users } = self ; let mut _flags = 0i32 ; if gallery { _flags |= 1 << 0u32 ; } if next_offset . is_some ( ) { _flags |= 1 << 1u32 ; } if switch_pm . is_some ( ) { _flags |= 1 << 2u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: long > ( query_id ) ? ; if let & Some ( ref inner ) = next_offset { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = switch_pm { _ser . write_boxed :: < :: mtproto :: InlineBotSwitchPM > ( inner ) ? ; } _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: BotInlineResult > > ( results ) ? ; _ser . write_bare :: < :: mtproto :: int > ( cache_time ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( users ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for BotResults { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( BotResults { gallery : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 0u32 ) != 0 } , query_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , next_offset : if _flags & ( 1 << 1u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , switch_pm : if _flags & ( 1 << 2u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: InlineBotSwitchPM > ( ) ? ) } else { None } , results : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: BotInlineResult > > ( ) ? , cache_time : _de . read_bare :: < :: mtproto :: int > ( ) ? , users : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( ) ? , } ) } } impl :: IntoBoxed for BotResults { type Boxed = :: mtproto :: messages :: BotResults ; fn into_boxed ( self ) -> :: mtproto :: messages :: BotResults { :: mtproto :: messages :: BotResults :: BotResults ( self ) } } } pub mod chat_full { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.chatFull`\n\n```text\nmessages.chatFull#e5d7d19c full_chat:ChatFull chats:Vector<Chat> users:Vector<User> = messages.ChatFull;\n```\n" ] pub struct ChatFull { pub full_chat : :: mtproto :: ChatFull , pub chats : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > , pub users : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > , } impl :: BareSerialize for ChatFull { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChatFull { ref full_chat , ref chats , ref users } = self ; _ser . write_boxed :: < :: mtproto :: ChatFull > ( full_chat ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > ( chats ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( users ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ChatFull { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ChatFull { full_chat : _de . read_boxed :: < :: mtproto :: ChatFull > ( ) ? , chats : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > ( ) ? , users : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( ) ? , } ) } } impl :: IntoBoxed for ChatFull { type Boxed = :: mtproto :: messages :: ChatFull ; fn into_boxed ( self ) -> :: mtproto :: messages :: ChatFull { :: mtproto :: messages :: ChatFull :: ChatFull ( self ) } } } pub mod chats { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.chats`\n\n```text\nmessages.chats#64ff9fd5 chats:Vector<Chat> = messages.Chats;\n```\n" ] pub struct Chats { pub chats : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > , } impl :: BareSerialize for Chats { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Chats { ref chats } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > ( chats ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Chats { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Chats { chats : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > ( ) ? , } ) } } impl :: IntoBoxed for Chats { type Boxed = :: mtproto :: messages :: Chats ; fn into_boxed ( self ) -> :: mtproto :: messages :: Chats { :: mtproto :: messages :: Chats :: Chats ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.chatsSlice`\n\n```text\nmessages.chatsSlice#9cd81144 count:int chats:Vector<Chat> = messages.Chats;\n```\n" ] pub struct Slice { pub count : :: mtproto :: int , pub chats : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > , } impl :: BareSerialize for Slice { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Slice { ref count , ref chats } = self ; _ser . write_bare :: < :: mtproto :: int > ( count ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > ( chats ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Slice { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Slice { count : _de . read_bare :: < :: mtproto :: int > ( ) ? , chats : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > ( ) ? , } ) } } impl :: IntoBoxed for Slice { type Boxed = :: mtproto :: messages :: Chats ; fn into_boxed ( self ) -> :: mtproto :: messages :: Chats { :: mtproto :: messages :: Chats :: Slice ( self ) } } } pub mod dh_config { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.dhConfig`\n\n```text\nmessages.dhConfig#2c221edd g:int p:bytes version:int random:bytes = messages.DhConfig;\n```\n" ] pub struct DhConfig { pub g : :: mtproto :: int , pub p : :: mtproto :: bytes , pub version : :: mtproto :: int , pub random : :: mtproto :: bytes , } impl :: BareSerialize for DhConfig { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & DhConfig { ref g , ref p , ref version , ref random } = self ; _ser . write_bare :: < :: mtproto :: int > ( g ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( p ) ? ; _ser . write_bare :: < :: mtproto :: int > ( version ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( random ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for DhConfig { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( DhConfig { g : _de . read_bare :: < :: mtproto :: int > ( ) ? , p : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , version : _de . read_bare :: < :: mtproto :: int > ( ) ? , random : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , } ) } } impl :: IntoBoxed for DhConfig { type Boxed = :: mtproto :: messages :: DhConfig ; fn into_boxed ( self ) -> :: mtproto :: messages :: DhConfig { :: mtproto :: messages :: DhConfig :: DhConfig ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.dhConfigNotModified`\n\n```text\nmessages.dhConfigNotModified#c0e24635 random:bytes = messages.DhConfig;\n```\n" ] pub struct NotModified { pub random : :: mtproto :: bytes , } impl :: BareSerialize for NotModified { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & NotModified { ref random } = self ; _ser . write_bare :: < :: mtproto :: bytes > ( random ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for NotModified { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( NotModified { random : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , } ) } } impl :: IntoBoxed for NotModified { type Boxed = :: mtproto :: messages :: DhConfig ; fn into_boxed ( self ) -> :: mtproto :: messages :: DhConfig { :: mtproto :: messages :: DhConfig :: NotModified ( self ) } } } pub mod dialogs { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.dialogs`\n\n```text\nmessages.dialogs#15ba6c40 dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Dialogs;\n```\n" ] pub struct Dialogs { pub dialogs : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Dialog > , pub messages : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Message > , pub chats : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > , pub users : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > , } impl :: BareSerialize for Dialogs { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Dialogs { ref dialogs , ref messages , ref chats , ref users } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Dialog > > ( dialogs ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Message > > ( messages ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > ( chats ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( users ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Dialogs { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Dialogs { dialogs : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Dialog > > ( ) ? , messages : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Message > > ( ) ? , chats : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > ( ) ? , users : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( ) ? , } ) } } impl :: IntoBoxed for Dialogs { type Boxed = :: mtproto :: messages :: Dialogs ; fn into_boxed ( self ) -> :: mtproto :: messages :: Dialogs { :: mtproto :: messages :: Dialogs :: Dialogs ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.dialogsSlice`\n\n```text\nmessages.dialogsSlice#71e094f3 count:int dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Dialogs;\n```\n" ] pub struct Slice { pub count : :: mtproto :: int , pub dialogs : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Dialog > , pub messages : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Message > , pub chats : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > , pub users : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > , } impl :: BareSerialize for Slice { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Slice { ref count , ref dialogs , ref messages , ref chats , ref users } = self ; _ser . write_bare :: < :: mtproto :: int > ( count ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Dialog > > ( dialogs ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Message > > ( messages ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > ( chats ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( users ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Slice { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Slice { count : _de . read_bare :: < :: mtproto :: int > ( ) ? , dialogs : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Dialog > > ( ) ? , messages : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Message > > ( ) ? , chats : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > ( ) ? , users : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( ) ? , } ) } } impl :: IntoBoxed for Slice { type Boxed = :: mtproto :: messages :: Dialogs ; fn into_boxed ( self ) -> :: mtproto :: messages :: Dialogs { :: mtproto :: messages :: Dialogs :: Slice ( self ) } } } pub mod faved_stickers { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.favedStickers`\n\n```text\nmessages.favedStickers#f37f2f16 hash:int packs:Vector<StickerPack> stickers:Vector<Document> = messages.FavedStickers;\n```\n" ] pub struct FavedStickers { pub hash : :: mtproto :: int , pub packs : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: StickerPack > , pub stickers : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Document > , } impl :: BareSerialize for FavedStickers { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & FavedStickers { ref hash , ref packs , ref stickers } = self ; _ser . write_bare :: < :: mtproto :: int > ( hash ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: StickerPack > > ( packs ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Document > > ( stickers ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for FavedStickers { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( FavedStickers { hash : _de . read_bare :: < :: mtproto :: int > ( ) ? , packs : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: StickerPack > > ( ) ? , stickers : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Document > > ( ) ? , } ) } } impl :: IntoBoxed for FavedStickers { type Boxed = :: mtproto :: messages :: FavedStickers ; fn into_boxed ( self ) -> :: mtproto :: messages :: FavedStickers { :: mtproto :: messages :: FavedStickers :: FavedStickers ( self ) } } } pub mod featured_stickers { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.featuredStickers`\n\n```text\nmessages.featuredStickers#f89d88e5 hash:int sets:Vector<StickerSetCovered> unread:Vector<long> = messages.FeaturedStickers;\n```\n" ] pub struct FeaturedStickers { pub hash : :: mtproto :: int , pub sets : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: StickerSetCovered > , pub unread : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > , } impl :: BareSerialize for FeaturedStickers { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & FeaturedStickers { ref hash , ref sets , ref unread } = self ; _ser . write_bare :: < :: mtproto :: int > ( hash ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: StickerSetCovered > > ( sets ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > > ( unread ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for FeaturedStickers { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( FeaturedStickers { hash : _de . read_bare :: < :: mtproto :: int > ( ) ? , sets : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: StickerSetCovered > > ( ) ? , unread : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > > ( ) ? , } ) } } impl :: IntoBoxed for FeaturedStickers { type Boxed = :: mtproto :: messages :: FeaturedStickers ; fn into_boxed ( self ) -> :: mtproto :: messages :: FeaturedStickers { :: mtproto :: messages :: FeaturedStickers :: FeaturedStickers ( self ) } } } pub mod found_gifs { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.foundGifs`\n\n```text\nmessages.foundGifs#450a1c0a next_offset:int results:Vector<FoundGif> = messages.FoundGifs;\n```\n" ] pub struct FoundGifs { pub next_offset : :: mtproto :: int , pub results : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: FoundGif > , } impl :: BareSerialize for FoundGifs { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & FoundGifs { ref next_offset , ref results } = self ; _ser . write_bare :: < :: mtproto :: int > ( next_offset ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: FoundGif > > ( results ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for FoundGifs { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( FoundGifs { next_offset : _de . read_bare :: < :: mtproto :: int > ( ) ? , results : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: FoundGif > > ( ) ? , } ) } } impl :: IntoBoxed for FoundGifs { type Boxed = :: mtproto :: messages :: FoundGifs ; fn into_boxed ( self ) -> :: mtproto :: messages :: FoundGifs { :: mtproto :: messages :: FoundGifs :: FoundGifs ( self ) } } } pub mod high_scores { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.highScores`\n\n```text\nmessages.highScores#9a3bfd99 scores:Vector<HighScore> users:Vector<User> = messages.HighScores;\n```\n" ] pub struct HighScores { pub scores : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: HighScore > , pub users : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > , } impl :: BareSerialize for HighScores { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & HighScores { ref scores , ref users } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: HighScore > > ( scores ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( users ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for HighScores { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( HighScores { scores : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: HighScore > > ( ) ? , users : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( ) ? , } ) } } impl :: IntoBoxed for HighScores { type Boxed = :: mtproto :: messages :: HighScores ; fn into_boxed ( self ) -> :: mtproto :: messages :: HighScores { :: mtproto :: messages :: HighScores :: HighScores ( self ) } } } pub mod message_edit_data { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.messageEditData`\n\n```text\nmessages.messageEditData#26b5dde6 flags:# caption:flags.0?true = messages.MessageEditData;\n```\n" ] pub struct MessageEditData { pub caption : bool , } impl :: BareSerialize for MessageEditData { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & MessageEditData { caption } = self ; let mut _flags = 0i32 ; if caption { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for MessageEditData { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( MessageEditData { caption : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 0u32 ) != 0 } , } ) } } impl :: IntoBoxed for MessageEditData { type Boxed = :: mtproto :: messages :: MessageEditData ; fn into_boxed ( self ) -> :: mtproto :: messages :: MessageEditData { :: mtproto :: messages :: MessageEditData :: MessageEditData ( self ) } } } pub mod messages { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.channelMessages`\n\n```text\nmessages.channelMessages#99262e37 flags:# pts:int count:int messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;\n```\n" ] pub struct ChannelMessages { pub pts : :: mtproto :: int , pub count : :: mtproto :: int , pub messages : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Message > , pub chats : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > , pub users : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > , } impl :: BareSerialize for ChannelMessages { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChannelMessages { ref pts , ref count , ref messages , ref chats , ref users } = self ; let mut _flags = 0i32 ; _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: int > ( pts ) ? ; _ser . write_bare :: < :: mtproto :: int > ( count ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Message > > ( messages ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > ( chats ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( users ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ChannelMessages { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( ChannelMessages { pts : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _de . read_bare :: < :: mtproto :: int > ( ) ? } , count : _de . read_bare :: < :: mtproto :: int > ( ) ? , messages : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Message > > ( ) ? , chats : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > ( ) ? , users : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( ) ? , } ) } } impl :: IntoBoxed for ChannelMessages { type Boxed = :: mtproto :: messages :: Messages ; fn into_boxed ( self ) -> :: mtproto :: messages :: Messages { :: mtproto :: messages :: Messages :: ChannelMessages ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.messages`\n\n```text\nmessages.messages#8c718e87 messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;\n```\n" ] pub struct Messages { pub messages : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Message > , pub chats : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > , pub users : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > , } impl :: BareSerialize for Messages { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Messages { ref messages , ref chats , ref users } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Message > > ( messages ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > ( chats ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( users ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Messages { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Messages { messages : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Message > > ( ) ? , chats : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > ( ) ? , users : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( ) ? , } ) } } impl :: IntoBoxed for Messages { type Boxed = :: mtproto :: messages :: Messages ; fn into_boxed ( self ) -> :: mtproto :: messages :: Messages { :: mtproto :: messages :: Messages :: Messages ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.messagesNotModified`\n\n```text\nmessages.messagesNotModified#74535f21 count:int = messages.Messages;\n```\n" ] pub struct MessagesNotModified { pub count : :: mtproto :: int , } impl :: BareSerialize for MessagesNotModified { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & MessagesNotModified { ref count } = self ; _ser . write_bare :: < :: mtproto :: int > ( count ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for MessagesNotModified { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( MessagesNotModified { count : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for MessagesNotModified { type Boxed = :: mtproto :: messages :: Messages ; fn into_boxed ( self ) -> :: mtproto :: messages :: Messages { :: mtproto :: messages :: Messages :: MessagesNotModified ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.messagesSlice`\n\n```text\nmessages.messagesSlice#b446ae3 count:int messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;\n```\n" ] pub struct MessagesSlice { pub count : :: mtproto :: int , pub messages : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Message > , pub chats : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > , pub users : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > , } impl :: BareSerialize for MessagesSlice { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & MessagesSlice { ref count , ref messages , ref chats , ref users } = self ; _ser . write_bare :: < :: mtproto :: int > ( count ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Message > > ( messages ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > ( chats ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( users ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for MessagesSlice { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( MessagesSlice { count : _de . read_bare :: < :: mtproto :: int > ( ) ? , messages : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Message > > ( ) ? , chats : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > ( ) ? , users : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( ) ? , } ) } } impl :: IntoBoxed for MessagesSlice { type Boxed = :: mtproto :: messages :: Messages ; fn into_boxed ( self ) -> :: mtproto :: messages :: Messages { :: mtproto :: messages :: Messages :: MessagesSlice ( self ) } } } pub mod peer_dialogs { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.peerDialogs`\n\n```text\nmessages.peerDialogs#3371c354 dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> state:updates.State = messages.PeerDialogs;\n```\n" ] pub struct PeerDialogs { pub dialogs : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Dialog > , pub messages : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Message > , pub chats : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > , pub users : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > , pub state : :: mtproto :: updates :: State , } impl :: BareSerialize for PeerDialogs { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & PeerDialogs { ref dialogs , ref messages , ref chats , ref users , ref state } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Dialog > > ( dialogs ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Message > > ( messages ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > ( chats ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( users ) ? ; _ser . write_boxed :: < :: mtproto :: updates :: State > ( state ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for PeerDialogs { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( PeerDialogs { dialogs : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Dialog > > ( ) ? , messages : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Message > > ( ) ? , chats : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > ( ) ? , users : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( ) ? , state : _de . read_boxed :: < :: mtproto :: updates :: State > ( ) ? , } ) } } impl :: IntoBoxed for PeerDialogs { type Boxed = :: mtproto :: messages :: PeerDialogs ; fn into_boxed ( self ) -> :: mtproto :: messages :: PeerDialogs { :: mtproto :: messages :: PeerDialogs :: PeerDialogs ( self ) } } } pub mod recent_stickers { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.recentStickers`\n\n```text\nmessages.recentStickers#5ce20970 hash:int stickers:Vector<Document> = messages.RecentStickers;\n```\n" ] pub struct RecentStickers { pub hash : :: mtproto :: int , pub stickers : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Document > , } impl :: BareSerialize for RecentStickers { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & RecentStickers { ref hash , ref stickers } = self ; _ser . write_bare :: < :: mtproto :: int > ( hash ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Document > > ( stickers ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for RecentStickers { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( RecentStickers { hash : _de . read_bare :: < :: mtproto :: int > ( ) ? , stickers : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Document > > ( ) ? , } ) } } impl :: IntoBoxed for RecentStickers { type Boxed = :: mtproto :: messages :: RecentStickers ; fn into_boxed ( self ) -> :: mtproto :: messages :: RecentStickers { :: mtproto :: messages :: RecentStickers :: RecentStickers ( self ) } } } pub mod saved_gifs { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.savedGifs`\n\n```text\nmessages.savedGifs#2e0709a5 hash:int gifs:Vector<Document> = messages.SavedGifs;\n```\n" ] pub struct SavedGifs { pub hash : :: mtproto :: int , pub gifs : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Document > , } impl :: BareSerialize for SavedGifs { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & SavedGifs { ref hash , ref gifs } = self ; _ser . write_bare :: < :: mtproto :: int > ( hash ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Document > > ( gifs ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for SavedGifs { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( SavedGifs { hash : _de . read_bare :: < :: mtproto :: int > ( ) ? , gifs : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Document > > ( ) ? , } ) } } impl :: IntoBoxed for SavedGifs { type Boxed = :: mtproto :: messages :: SavedGifs ; fn into_boxed ( self ) -> :: mtproto :: messages :: SavedGifs { :: mtproto :: messages :: SavedGifs :: SavedGifs ( self ) } } } pub mod sent_encrypted { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.sentEncryptedFile`\n\n```text\nmessages.sentEncryptedFile#9493ff32 date:int file:EncryptedFile = messages.SentEncryptedMessage;\n```\n" ] pub struct File { pub date : :: mtproto :: int , pub file : :: mtproto :: EncryptedFile , } impl :: BareSerialize for File { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & File { ref date , ref file } = self ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; _ser . write_boxed :: < :: mtproto :: EncryptedFile > ( file ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for File { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( File { date : _de . read_bare :: < :: mtproto :: int > ( ) ? , file : _de . read_boxed :: < :: mtproto :: EncryptedFile > ( ) ? , } ) } } impl :: IntoBoxed for File { type Boxed = :: mtproto :: messages :: SentEncryptedMessage ; fn into_boxed ( self ) -> :: mtproto :: messages :: SentEncryptedMessage { :: mtproto :: messages :: SentEncryptedMessage :: File ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.sentEncryptedMessage`\n\n```text\nmessages.sentEncryptedMessage#560f8935 date:int = messages.SentEncryptedMessage;\n```\n" ] pub struct Message { pub date : :: mtproto :: int , } impl :: BareSerialize for Message { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Message { ref date } = self ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Message { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Message { date : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for Message { type Boxed = :: mtproto :: messages :: SentEncryptedMessage ; fn into_boxed ( self ) -> :: mtproto :: messages :: SentEncryptedMessage { :: mtproto :: messages :: SentEncryptedMessage :: Message ( self ) } } } pub mod sticker_set { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.stickerSet`\n\n```text\nmessages.stickerSet#b60a24a6 set:StickerSet packs:Vector<StickerPack> documents:Vector<Document> = messages.StickerSet;\n```\n" ] pub struct StickerSet { pub set : :: mtproto :: StickerSet , pub packs : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: StickerPack > , pub documents : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Document > , } impl :: BareSerialize for StickerSet { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & StickerSet { ref set , ref packs , ref documents } = self ; _ser . write_boxed :: < :: mtproto :: StickerSet > ( set ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: StickerPack > > ( packs ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Document > > ( documents ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for StickerSet { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( StickerSet { set : _de . read_boxed :: < :: mtproto :: StickerSet > ( ) ? , packs : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: StickerPack > > ( ) ? , documents : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Document > > ( ) ? , } ) } } impl :: IntoBoxed for StickerSet { type Boxed = :: mtproto :: messages :: StickerSet ; fn into_boxed ( self ) -> :: mtproto :: messages :: StickerSet { :: mtproto :: messages :: StickerSet :: StickerSet ( self ) } } } pub mod sticker_set_install_result { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.stickerSetInstallResultArchive`\n\n```text\nmessages.stickerSetInstallResultArchive#35e410a8 sets:Vector<StickerSetCovered> = messages.StickerSetInstallResult;\n```\n" ] pub struct Archive { pub sets : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: StickerSetCovered > , } impl :: BareSerialize for Archive { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Archive { ref sets } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: StickerSetCovered > > ( sets ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Archive { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Archive { sets : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: StickerSetCovered > > ( ) ? , } ) } } impl :: IntoBoxed for Archive { type Boxed = :: mtproto :: messages :: StickerSetInstallResult ; fn into_boxed ( self ) -> :: mtproto :: messages :: StickerSetInstallResult { :: mtproto :: messages :: StickerSetInstallResult :: Archive ( self ) } } } pub mod stickers { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.stickers`\n\n```text\nmessages.stickers#8a8ecd32 hash:string stickers:Vector<Document> = messages.Stickers;\n```\n" ] pub struct Stickers { pub hash : :: mtproto :: string , pub stickers : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Document > , } impl :: BareSerialize for Stickers { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Stickers { ref hash , ref stickers } = self ; _ser . write_bare :: < :: mtproto :: string > ( hash ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Document > > ( stickers ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Stickers { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Stickers { hash : _de . read_bare :: < :: mtproto :: string > ( ) ? , stickers : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Document > > ( ) ? , } ) } } impl :: IntoBoxed for Stickers { type Boxed = :: mtproto :: messages :: Stickers ; fn into_boxed ( self ) -> :: mtproto :: messages :: Stickers { :: mtproto :: messages :: Stickers :: Stickers ( self ) } } } } pub mod msg { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `msg_detailed_info`\n\n```text\nmsg_detailed_info#276d3ec6 msg_id:long answer_msg_id:long bytes:int status:int = MsgDetailedInfo;\n```\n" ] pub struct DetailedInfo { pub msg_id : :: mtproto :: long , pub answer_msg_id : :: mtproto :: long , pub bytes : :: mtproto :: int , pub status : :: mtproto :: int , } impl :: BareSerialize for DetailedInfo { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & DetailedInfo { ref msg_id , ref answer_msg_id , bytes : ref bytes_ , ref status } = self ; _ser . write_bare :: < :: mtproto :: long > ( msg_id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( answer_msg_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( bytes_ ) ? ; _ser . write_bare :: < :: mtproto :: int > ( status ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for DetailedInfo { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( DetailedInfo { msg_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , answer_msg_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , bytes : _de . read_bare :: < :: mtproto :: int > ( ) ? , status : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for DetailedInfo { type Boxed = :: mtproto :: MsgDetailedInfo ; fn into_boxed ( self ) -> :: mtproto :: MsgDetailedInfo { :: mtproto :: MsgDetailedInfo :: DetailedInfo ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `msg_new_detailed_info`\n\n```text\nmsg_new_detailed_info#809db6df answer_msg_id:long bytes:int status:int = MsgDetailedInfo;\n```\n" ] pub struct NewDetailedInfo { pub answer_msg_id : :: mtproto :: long , pub bytes : :: mtproto :: int , pub status : :: mtproto :: int , } impl :: BareSerialize for NewDetailedInfo { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & NewDetailedInfo { ref answer_msg_id , bytes : ref bytes_ , ref status } = self ; _ser . write_bare :: < :: mtproto :: long > ( answer_msg_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( bytes_ ) ? ; _ser . write_bare :: < :: mtproto :: int > ( status ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for NewDetailedInfo { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( NewDetailedInfo { answer_msg_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , bytes : _de . read_bare :: < :: mtproto :: int > ( ) ? , status : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for NewDetailedInfo { type Boxed = :: mtproto :: MsgDetailedInfo ; fn into_boxed ( self ) -> :: mtproto :: MsgDetailedInfo { :: mtproto :: MsgDetailedInfo :: NewDetailedInfo ( self ) } } } pub mod msg_resend_req { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `msg_resend_req`\n\n```text\nmsg_resend_req#7d861a08 msg_ids:Vector<long> = MsgResendReq;\n```\n" ] pub struct MsgResendReq { pub msg_ids : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > , } impl :: BareSerialize for MsgResendReq { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & MsgResendReq { ref msg_ids } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > > ( msg_ids ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for MsgResendReq { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( MsgResendReq { msg_ids : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > > ( ) ? , } ) } } impl :: IntoBoxed for MsgResendReq { type Boxed = :: mtproto :: MsgResendReq ; fn into_boxed ( self ) -> :: mtproto :: MsgResendReq { :: mtproto :: MsgResendReq :: MsgResendReq ( self ) } } } pub mod msgs_ack { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `msgs_ack`\n\n```text\nmsgs_ack#62d6b459 msg_ids:Vector<long> = MsgsAck;\n```\n" ] pub struct MsgsAck { pub msg_ids : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > , } impl :: BareSerialize for MsgsAck { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & MsgsAck { ref msg_ids } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > > ( msg_ids ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for MsgsAck { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( MsgsAck { msg_ids : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > > ( ) ? , } ) } } impl :: IntoBoxed for MsgsAck { type Boxed = :: mtproto :: MsgsAck ; fn into_boxed ( self ) -> :: mtproto :: MsgsAck { :: mtproto :: MsgsAck :: MsgsAck ( self ) } } } pub mod msgs_all_info { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `msgs_all_info`\n\n```text\nmsgs_all_info#8cc0d131 msg_ids:Vector<long> info:string = MsgsAllInfo;\n```\n" ] pub struct MsgsAllInfo { pub msg_ids : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > , pub info : :: mtproto :: string , } impl :: BareSerialize for MsgsAllInfo { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & MsgsAllInfo { ref msg_ids , ref info } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > > ( msg_ids ) ? ; _ser . write_bare :: < :: mtproto :: string > ( info ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for MsgsAllInfo { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( MsgsAllInfo { msg_ids : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > > ( ) ? , info : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for MsgsAllInfo { type Boxed = :: mtproto :: MsgsAllInfo ; fn into_boxed ( self ) -> :: mtproto :: MsgsAllInfo { :: mtproto :: MsgsAllInfo :: MsgsAllInfo ( self ) } } } pub mod msgs_state_info { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `msgs_state_info`\n\n```text\nmsgs_state_info#04deb57d req_msg_id:long info:string = MsgsStateInfo;\n```\n" ] pub struct MsgsStateInfo { pub req_msg_id : :: mtproto :: long , pub info : :: mtproto :: string , } impl :: BareSerialize for MsgsStateInfo { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & MsgsStateInfo { ref req_msg_id , ref info } = self ; _ser . write_bare :: < :: mtproto :: long > ( req_msg_id ) ? ; _ser . write_bare :: < :: mtproto :: string > ( info ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for MsgsStateInfo { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( MsgsStateInfo { req_msg_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , info : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for MsgsStateInfo { type Boxed = :: mtproto :: MsgsStateInfo ; fn into_boxed ( self ) -> :: mtproto :: MsgsStateInfo { :: mtproto :: MsgsStateInfo :: MsgsStateInfo ( self ) } } } pub mod msgs_state_req { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `msgs_state_req`\n\n```text\nmsgs_state_req#da69fb52 msg_ids:Vector<long> = MsgsStateReq;\n```\n" ] pub struct MsgsStateReq { pub msg_ids : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > , } impl :: BareSerialize for MsgsStateReq { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & MsgsStateReq { ref msg_ids } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > > ( msg_ids ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for MsgsStateReq { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( MsgsStateReq { msg_ids : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > > ( ) ? , } ) } } impl :: IntoBoxed for MsgsStateReq { type Boxed = :: mtproto :: MsgsStateReq ; fn into_boxed ( self ) -> :: mtproto :: MsgsStateReq { :: mtproto :: MsgsStateReq :: MsgsStateReq ( self ) } } } pub mod nearest_dc { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `nearestDc`\n\n```text\nnearestDc#8e1a1775 country:string this_dc:int nearest_dc:int = NearestDc;\n```\n" ] pub struct NearestDc { pub country : :: mtproto :: string , pub this_dc : :: mtproto :: int , pub nearest_dc : :: mtproto :: int , } impl :: BareSerialize for NearestDc { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & NearestDc { ref country , ref this_dc , ref nearest_dc } = self ; _ser . write_bare :: < :: mtproto :: string > ( country ) ? ; _ser . write_bare :: < :: mtproto :: int > ( this_dc ) ? ; _ser . write_bare :: < :: mtproto :: int > ( nearest_dc ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for NearestDc { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( NearestDc { country : _de . read_bare :: < :: mtproto :: string > ( ) ? , this_dc : _de . read_bare :: < :: mtproto :: int > ( ) ? , nearest_dc : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for NearestDc { type Boxed = :: mtproto :: NearestDc ; fn into_boxed ( self ) -> :: mtproto :: NearestDc { :: mtproto :: NearestDc :: NearestDc ( self ) } } } pub mod new_session_created { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `new_session_created`\n\n```text\nnew_session_created#9ec20908 first_msg_id:long unique_id:long server_salt:long = NewSession;\n```\n" ] pub struct NewSessionCreated { pub first_msg_id : :: mtproto :: long , pub unique_id : :: mtproto :: long , pub server_salt : :: mtproto :: long , } impl :: BareSerialize for NewSessionCreated { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & NewSessionCreated { ref first_msg_id , ref unique_id , ref server_salt } = self ; _ser . write_bare :: < :: mtproto :: long > ( first_msg_id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( unique_id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( server_salt ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for NewSessionCreated { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( NewSessionCreated { first_msg_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , unique_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , server_salt : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for NewSessionCreated { type Boxed = :: mtproto :: NewSession ; fn into_boxed ( self ) -> :: mtproto :: NewSession { :: mtproto :: NewSession :: NewSessionCreated ( self ) } } } pub mod notify { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `notifyPeer`\n\n```text\nnotifyPeer#9fd40bd8 peer:Peer = NotifyPeer;\n```\n" ] pub struct Peer { pub peer : :: mtproto :: Peer , } impl :: BareSerialize for Peer { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Peer { ref peer } = self ; _ser . write_boxed :: < :: mtproto :: Peer > ( peer ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Peer { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Peer { peer : _de . read_boxed :: < :: mtproto :: Peer > ( ) ? , } ) } } impl :: IntoBoxed for Peer { type Boxed = :: mtproto :: NotifyPeer ; fn into_boxed ( self ) -> :: mtproto :: NotifyPeer { :: mtproto :: NotifyPeer :: Peer ( self ) } } } pub mod null { } pub mod p_q_inner_data { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `p_q_inner_data`\n\n```text\np_q_inner_data#83c95aec pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 = P_Q_inner_data;\n```\n" ] pub struct PQInnerData { pub pq : :: mtproto :: bytes , pub p : :: mtproto :: bytes , pub q : :: mtproto :: bytes , pub nonce : :: mtproto :: int128 , pub server_nonce : :: mtproto :: int128 , pub new_nonce : :: mtproto :: int256 , } impl :: BareSerialize for PQInnerData { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & PQInnerData { ref pq , ref p , ref q , ref nonce , ref server_nonce , ref new_nonce } = self ; _ser . write_bare :: < :: mtproto :: bytes > ( pq ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( p ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( q ) ? ; _ser . write_bare :: < :: mtproto :: int128 > ( nonce ) ? ; _ser . write_bare :: < :: mtproto :: int128 > ( server_nonce ) ? ; _ser . write_bare :: < :: mtproto :: int256 > ( new_nonce ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for PQInnerData { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( PQInnerData { pq : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , p : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , q : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , nonce : _de . read_bare :: < :: mtproto :: int128 > ( ) ? , server_nonce : _de . read_bare :: < :: mtproto :: int128 > ( ) ? , new_nonce : _de . read_bare :: < :: mtproto :: int256 > ( ) ? , } ) } } impl :: IntoBoxed for PQInnerData { type Boxed = :: mtproto :: PQInnerData ; fn into_boxed ( self ) -> :: mtproto :: PQInnerData { :: mtproto :: PQInnerData :: PQInnerData ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `p_q_inner_data_temp`\n\n```text\np_q_inner_data_temp#3c6a84d4 pq:bytes p:bytes q:bytes nonce:int128 server_nonce:int128 new_nonce:int256 expires_in:int = P_Q_inner_data;\n```\n" ] pub struct Temp { pub pq : :: mtproto :: bytes , pub p : :: mtproto :: bytes , pub q : :: mtproto :: bytes , pub nonce : :: mtproto :: int128 , pub server_nonce : :: mtproto :: int128 , pub new_nonce : :: mtproto :: int256 , pub expires_in : :: mtproto :: int , } impl :: BareSerialize for Temp { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Temp { ref pq , ref p , ref q , ref nonce , ref server_nonce , ref new_nonce , ref expires_in } = self ; _ser . write_bare :: < :: mtproto :: bytes > ( pq ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( p ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( q ) ? ; _ser . write_bare :: < :: mtproto :: int128 > ( nonce ) ? ; _ser . write_bare :: < :: mtproto :: int128 > ( server_nonce ) ? ; _ser . write_bare :: < :: mtproto :: int256 > ( new_nonce ) ? ; _ser . write_bare :: < :: mtproto :: int > ( expires_in ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Temp { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Temp { pq : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , p : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , q : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , nonce : _de . read_bare :: < :: mtproto :: int128 > ( ) ? , server_nonce : _de . read_bare :: < :: mtproto :: int128 > ( ) ? , new_nonce : _de . read_bare :: < :: mtproto :: int256 > ( ) ? , expires_in : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for Temp { type Boxed = :: mtproto :: PQInnerData ; fn into_boxed ( self ) -> :: mtproto :: PQInnerData { :: mtproto :: PQInnerData :: Temp ( self ) } } } pub mod page { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `pageFull`\n\n```text\npageFull#556ec7aa blocks:Vector<PageBlock> photos:Vector<Photo> documents:Vector<Document> = Page;\n```\n" ] pub struct Full { pub blocks : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PageBlock > , pub photos : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Photo > , pub documents : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Document > , } impl :: BareSerialize for Full { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Full { ref blocks , ref photos , ref documents } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PageBlock > > ( blocks ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Photo > > ( photos ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Document > > ( documents ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Full { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Full { blocks : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PageBlock > > ( ) ? , photos : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Photo > > ( ) ? , documents : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Document > > ( ) ? , } ) } } impl :: IntoBoxed for Full { type Boxed = :: mtproto :: Page ; fn into_boxed ( self ) -> :: mtproto :: Page { :: mtproto :: Page :: Full ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `pagePart`\n\n```text\npagePart#8e3f9ebe blocks:Vector<PageBlock> photos:Vector<Photo> documents:Vector<Document> = Page;\n```\n" ] pub struct Part { pub blocks : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PageBlock > , pub photos : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Photo > , pub documents : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Document > , } impl :: BareSerialize for Part { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Part { ref blocks , ref photos , ref documents } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PageBlock > > ( blocks ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Photo > > ( photos ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Document > > ( documents ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Part { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Part { blocks : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PageBlock > > ( ) ? , photos : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Photo > > ( ) ? , documents : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Document > > ( ) ? , } ) } } impl :: IntoBoxed for Part { type Boxed = :: mtproto :: Page ; fn into_boxed ( self ) -> :: mtproto :: Page { :: mtproto :: Page :: Part ( self ) } } } pub mod page_block { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `pageBlockAnchor`\n\n```text\npageBlockAnchor#ce0d37b0 name:string = PageBlock;\n```\n" ] pub struct Anchor { pub name : :: mtproto :: string , } impl :: BareSerialize for Anchor { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Anchor { ref name } = self ; _ser . write_bare :: < :: mtproto :: string > ( name ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Anchor { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Anchor { name : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for Anchor { type Boxed = :: mtproto :: PageBlock ; fn into_boxed ( self ) -> :: mtproto :: PageBlock { :: mtproto :: PageBlock :: Anchor ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `pageBlockAudio`\n\n```text\npageBlockAudio#31b81a7f audio_id:long caption:RichText = PageBlock;\n```\n" ] pub struct Audio { pub audio_id : :: mtproto :: long , pub caption : Box < :: mtproto :: RichText > , } impl :: BareSerialize for Audio { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Audio { ref audio_id , ref caption } = self ; _ser . write_bare :: < :: mtproto :: long > ( audio_id ) ? ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( caption ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Audio { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Audio { audio_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , caption : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , } ) } } impl :: IntoBoxed for Audio { type Boxed = :: mtproto :: PageBlock ; fn into_boxed ( self ) -> :: mtproto :: PageBlock { :: mtproto :: PageBlock :: Audio ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `pageBlockAuthorDate`\n\n```text\npageBlockAuthorDate#baafe5e0 author:RichText published_date:int = PageBlock;\n```\n" ] pub struct AuthorDate { pub author : Box < :: mtproto :: RichText > , pub published_date : :: mtproto :: int , } impl :: BareSerialize for AuthorDate { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & AuthorDate { ref author , ref published_date } = self ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( author ) ? ; _ser . write_bare :: < :: mtproto :: int > ( published_date ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for AuthorDate { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( AuthorDate { author : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , published_date : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for AuthorDate { type Boxed = :: mtproto :: PageBlock ; fn into_boxed ( self ) -> :: mtproto :: PageBlock { :: mtproto :: PageBlock :: AuthorDate ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `pageBlockBlockquote`\n\n```text\npageBlockBlockquote#263d7c26 text:RichText caption:RichText = PageBlock;\n```\n" ] pub struct Blockquote { pub text : Box < :: mtproto :: RichText > , pub caption : Box < :: mtproto :: RichText > , } impl :: BareSerialize for Blockquote { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Blockquote { ref text , ref caption } = self ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( text ) ? ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( caption ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Blockquote { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Blockquote { text : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , caption : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , } ) } } impl :: IntoBoxed for Blockquote { type Boxed = :: mtproto :: PageBlock ; fn into_boxed ( self ) -> :: mtproto :: PageBlock { :: mtproto :: PageBlock :: Blockquote ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `pageBlockChannel`\n\n```text\npageBlockChannel#ef1751b5 channel:Chat = PageBlock;\n```\n" ] pub struct Channel { pub channel : :: mtproto :: Chat , } impl :: BareSerialize for Channel { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Channel { ref channel } = self ; _ser . write_boxed :: < :: mtproto :: Chat > ( channel ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Channel { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Channel { channel : _de . read_boxed :: < :: mtproto :: Chat > ( ) ? , } ) } } impl :: IntoBoxed for Channel { type Boxed = :: mtproto :: PageBlock ; fn into_boxed ( self ) -> :: mtproto :: PageBlock { :: mtproto :: PageBlock :: Channel ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `pageBlockCollage`\n\n```text\npageBlockCollage#8b31c4f items:Vector<PageBlock> caption:RichText = PageBlock;\n```\n" ] pub struct Collage { pub items : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PageBlock > , pub caption : Box < :: mtproto :: RichText > , } impl :: BareSerialize for Collage { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Collage { ref items , ref caption } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PageBlock > > ( items ) ? ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( caption ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Collage { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Collage { items : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PageBlock > > ( ) ? , caption : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , } ) } } impl :: IntoBoxed for Collage { type Boxed = :: mtproto :: PageBlock ; fn into_boxed ( self ) -> :: mtproto :: PageBlock { :: mtproto :: PageBlock :: Collage ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `pageBlockCover`\n\n```text\npageBlockCover#39f23300 cover:PageBlock = PageBlock;\n```\n" ] pub struct Cover { pub cover : Box < :: mtproto :: PageBlock > , } impl :: BareSerialize for Cover { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Cover { ref cover } = self ; _ser . write_boxed :: < Box < :: mtproto :: PageBlock > > ( cover ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Cover { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Cover { cover : _de . read_boxed :: < Box < :: mtproto :: PageBlock > > ( ) ? , } ) } } impl :: IntoBoxed for Cover { type Boxed = :: mtproto :: PageBlock ; fn into_boxed ( self ) -> :: mtproto :: PageBlock { :: mtproto :: PageBlock :: Cover ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `pageBlockEmbed`\n\n```text\npageBlockEmbed#cde200d1 flags:# full_width:flags.0?true allow_scrolling:flags.3?true url:flags.1?string html:flags.2?string poster_photo_id:flags.4?long w:int h:int caption:RichText = PageBlock;\n```\n" ] pub struct Embed { pub full_width : bool , pub allow_scrolling : bool , pub url : Option < :: mtproto :: string > , pub html : Option < :: mtproto :: string > , pub poster_photo_id : Option < :: mtproto :: long > , pub w : :: mtproto :: int , pub h : :: mtproto :: int , pub caption : Box < :: mtproto :: RichText > , } impl :: BareSerialize for Embed { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Embed { full_width , allow_scrolling , ref url , ref html , ref poster_photo_id , ref w , ref h , ref caption } = self ; let mut _flags = 0i32 ; if full_width { _flags |= 1 << 0u32 ; } if allow_scrolling { _flags |= 1 << 3u32 ; } if url . is_some ( ) { _flags |= 1 << 1u32 ; } if html . is_some ( ) { _flags |= 1 << 2u32 ; } if poster_photo_id . is_some ( ) { _flags |= 1 << 4u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; if let & Some ( ref inner ) = url { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = html { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = poster_photo_id { _ser . write_bare :: < :: mtproto :: long > ( inner ) ? ; } _ser . write_bare :: < :: mtproto :: int > ( w ) ? ; _ser . write_bare :: < :: mtproto :: int > ( h ) ? ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( caption ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Embed { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( Embed { full_width : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 0u32 ) != 0 } , allow_scrolling : _flags & ( 1 << 3u32 ) != 0 , url : if _flags & ( 1 << 1u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , html : if _flags & ( 1 << 2u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , poster_photo_id : if _flags & ( 1 << 4u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: long > ( ) ? ) } else { None } , w : _de . read_bare :: < :: mtproto :: int > ( ) ? , h : _de . read_bare :: < :: mtproto :: int > ( ) ? , caption : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , } ) } } impl :: IntoBoxed for Embed { type Boxed = :: mtproto :: PageBlock ; fn into_boxed ( self ) -> :: mtproto :: PageBlock { :: mtproto :: PageBlock :: Embed ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `pageBlockEmbedPost`\n\n```text\npageBlockEmbedPost#292c7be9 url:string webpage_id:long author_photo_id:long author:string date:int blocks:Vector<PageBlock> caption:RichText = PageBlock;\n```\n" ] pub struct EmbedPost { pub url : :: mtproto :: string , pub webpage_id : :: mtproto :: long , pub author_photo_id : :: mtproto :: long , pub author : :: mtproto :: string , pub date : :: mtproto :: int , pub blocks : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PageBlock > , pub caption : Box < :: mtproto :: RichText > , } impl :: BareSerialize for EmbedPost { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & EmbedPost { ref url , ref webpage_id , ref author_photo_id , ref author , ref date , ref blocks , ref caption } = self ; _ser . write_bare :: < :: mtproto :: string > ( url ) ? ; _ser . write_bare :: < :: mtproto :: long > ( webpage_id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( author_photo_id ) ? ; _ser . write_bare :: < :: mtproto :: string > ( author ) ? ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PageBlock > > ( blocks ) ? ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( caption ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for EmbedPost { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( EmbedPost { url : _de . read_bare :: < :: mtproto :: string > ( ) ? , webpage_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , author_photo_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , author : _de . read_bare :: < :: mtproto :: string > ( ) ? , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , blocks : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PageBlock > > ( ) ? , caption : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , } ) } } impl :: IntoBoxed for EmbedPost { type Boxed = :: mtproto :: PageBlock ; fn into_boxed ( self ) -> :: mtproto :: PageBlock { :: mtproto :: PageBlock :: EmbedPost ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `pageBlockFooter`\n\n```text\npageBlockFooter#48870999 text:RichText = PageBlock;\n```\n" ] pub struct Footer { pub text : Box < :: mtproto :: RichText > , } impl :: BareSerialize for Footer { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Footer { ref text } = self ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( text ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Footer { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Footer { text : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , } ) } } impl :: IntoBoxed for Footer { type Boxed = :: mtproto :: PageBlock ; fn into_boxed ( self ) -> :: mtproto :: PageBlock { :: mtproto :: PageBlock :: Footer ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `pageBlockHeader`\n\n```text\npageBlockHeader#bfd064ec text:RichText = PageBlock;\n```\n" ] pub struct Header { pub text : Box < :: mtproto :: RichText > , } impl :: BareSerialize for Header { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Header { ref text } = self ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( text ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Header { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Header { text : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , } ) } } impl :: IntoBoxed for Header { type Boxed = :: mtproto :: PageBlock ; fn into_boxed ( self ) -> :: mtproto :: PageBlock { :: mtproto :: PageBlock :: Header ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `pageBlockList`\n\n```text\npageBlockList#3a58c7f4 ordered:Bool items:Vector<RichText> = PageBlock;\n```\n" ] pub struct List { pub ordered : :: mtproto :: Bool , pub items : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: RichText > , } impl :: BareSerialize for List { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & List { ref ordered , ref items } = self ; _ser . write_boxed :: < :: mtproto :: Bool > ( ordered ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: RichText > > ( items ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for List { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( List { ordered : _de . read_boxed :: < :: mtproto :: Bool > ( ) ? , items : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: RichText > > ( ) ? , } ) } } impl :: IntoBoxed for List { type Boxed = :: mtproto :: PageBlock ; fn into_boxed ( self ) -> :: mtproto :: PageBlock { :: mtproto :: PageBlock :: List ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `pageBlockParagraph`\n\n```text\npageBlockParagraph#467a0766 text:RichText = PageBlock;\n```\n" ] pub struct Paragraph { pub text : Box < :: mtproto :: RichText > , } impl :: BareSerialize for Paragraph { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Paragraph { ref text } = self ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( text ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Paragraph { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Paragraph { text : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , } ) } } impl :: IntoBoxed for Paragraph { type Boxed = :: mtproto :: PageBlock ; fn into_boxed ( self ) -> :: mtproto :: PageBlock { :: mtproto :: PageBlock :: Paragraph ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `pageBlockPhoto`\n\n```text\npageBlockPhoto#e9c69982 photo_id:long caption:RichText = PageBlock;\n```\n" ] pub struct Photo { pub photo_id : :: mtproto :: long , pub caption : Box < :: mtproto :: RichText > , } impl :: BareSerialize for Photo { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Photo { ref photo_id , ref caption } = self ; _ser . write_bare :: < :: mtproto :: long > ( photo_id ) ? ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( caption ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Photo { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Photo { photo_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , caption : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , } ) } } impl :: IntoBoxed for Photo { type Boxed = :: mtproto :: PageBlock ; fn into_boxed ( self ) -> :: mtproto :: PageBlock { :: mtproto :: PageBlock :: Photo ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `pageBlockPreformatted`\n\n```text\npageBlockPreformatted#c070d93e text:RichText language:string = PageBlock;\n```\n" ] pub struct Preformatted { pub text : Box < :: mtproto :: RichText > , pub language : :: mtproto :: string , } impl :: BareSerialize for Preformatted { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Preformatted { ref text , ref language } = self ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( text ) ? ; _ser . write_bare :: < :: mtproto :: string > ( language ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Preformatted { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Preformatted { text : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , language : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for Preformatted { type Boxed = :: mtproto :: PageBlock ; fn into_boxed ( self ) -> :: mtproto :: PageBlock { :: mtproto :: PageBlock :: Preformatted ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `pageBlockPullquote`\n\n```text\npageBlockPullquote#4f4456d3 text:RichText caption:RichText = PageBlock;\n```\n" ] pub struct Pullquote { pub text : Box < :: mtproto :: RichText > , pub caption : Box < :: mtproto :: RichText > , } impl :: BareSerialize for Pullquote { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Pullquote { ref text , ref caption } = self ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( text ) ? ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( caption ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Pullquote { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Pullquote { text : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , caption : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , } ) } } impl :: IntoBoxed for Pullquote { type Boxed = :: mtproto :: PageBlock ; fn into_boxed ( self ) -> :: mtproto :: PageBlock { :: mtproto :: PageBlock :: Pullquote ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `pageBlockSlideshow`\n\n```text\npageBlockSlideshow#130c8963 items:Vector<PageBlock> caption:RichText = PageBlock;\n```\n" ] pub struct Slideshow { pub items : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PageBlock > , pub caption : Box < :: mtproto :: RichText > , } impl :: BareSerialize for Slideshow { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Slideshow { ref items , ref caption } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PageBlock > > ( items ) ? ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( caption ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Slideshow { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Slideshow { items : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PageBlock > > ( ) ? , caption : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , } ) } } impl :: IntoBoxed for Slideshow { type Boxed = :: mtproto :: PageBlock ; fn into_boxed ( self ) -> :: mtproto :: PageBlock { :: mtproto :: PageBlock :: Slideshow ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `pageBlockSubheader`\n\n```text\npageBlockSubheader#f12bb6e1 text:RichText = PageBlock;\n```\n" ] pub struct Subheader { pub text : Box < :: mtproto :: RichText > , } impl :: BareSerialize for Subheader { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Subheader { ref text } = self ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( text ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Subheader { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Subheader { text : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , } ) } } impl :: IntoBoxed for Subheader { type Boxed = :: mtproto :: PageBlock ; fn into_boxed ( self ) -> :: mtproto :: PageBlock { :: mtproto :: PageBlock :: Subheader ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `pageBlockSubtitle`\n\n```text\npageBlockSubtitle#8ffa9a1f text:RichText = PageBlock;\n```\n" ] pub struct Subtitle { pub text : Box < :: mtproto :: RichText > , } impl :: BareSerialize for Subtitle { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Subtitle { ref text } = self ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( text ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Subtitle { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Subtitle { text : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , } ) } } impl :: IntoBoxed for Subtitle { type Boxed = :: mtproto :: PageBlock ; fn into_boxed ( self ) -> :: mtproto :: PageBlock { :: mtproto :: PageBlock :: Subtitle ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `pageBlockTitle`\n\n```text\npageBlockTitle#70abc3fd text:RichText = PageBlock;\n```\n" ] pub struct Title { pub text : Box < :: mtproto :: RichText > , } impl :: BareSerialize for Title { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Title { ref text } = self ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( text ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Title { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Title { text : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , } ) } } impl :: IntoBoxed for Title { type Boxed = :: mtproto :: PageBlock ; fn into_boxed ( self ) -> :: mtproto :: PageBlock { :: mtproto :: PageBlock :: Title ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `pageBlockVideo`\n\n```text\npageBlockVideo#d9d71866 flags:# autoplay:flags.0?true loop:flags.1?true video_id:long caption:RichText = PageBlock;\n```\n" ] pub struct Video { pub autoplay : bool , pub loop_ : bool , pub video_id : :: mtproto :: long , pub caption : Box < :: mtproto :: RichText > , } impl :: BareSerialize for Video { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Video { autoplay , loop_ , ref video_id , ref caption } = self ; let mut _flags = 0i32 ; if autoplay { _flags |= 1 << 0u32 ; } if loop_ { _flags |= 1 << 1u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: long > ( video_id ) ? ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( caption ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Video { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( Video { autoplay : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 0u32 ) != 0 } , loop_ : _flags & ( 1 << 1u32 ) != 0 , video_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , caption : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , } ) } } impl :: IntoBoxed for Video { type Boxed = :: mtproto :: PageBlock ; fn into_boxed ( self ) -> :: mtproto :: PageBlock { :: mtproto :: PageBlock :: Video ( self ) } } } pub mod payment_charge { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `paymentCharge`\n\n```text\npaymentCharge#ea02c27e id:string provider_charge_id:string = PaymentCharge;\n```\n" ] pub struct PaymentCharge { pub id : :: mtproto :: string , pub provider_charge_id : :: mtproto :: string , } impl :: BareSerialize for PaymentCharge { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & PaymentCharge { ref id , ref provider_charge_id } = self ; _ser . write_bare :: < :: mtproto :: string > ( id ) ? ; _ser . write_bare :: < :: mtproto :: string > ( provider_charge_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for PaymentCharge { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( PaymentCharge { id : _de . read_bare :: < :: mtproto :: string > ( ) ? , provider_charge_id : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for PaymentCharge { type Boxed = :: mtproto :: PaymentCharge ; fn into_boxed ( self ) -> :: mtproto :: PaymentCharge { :: mtproto :: PaymentCharge :: PaymentCharge ( self ) } } } pub mod payment_requested_info { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `paymentRequestedInfo`\n\n```text\npaymentRequestedInfo#909c3f94 flags:# name:flags.0?string phone:flags.1?string email:flags.2?string shipping_address:flags.3?PostAddress = PaymentRequestedInfo;\n```\n" ] pub struct PaymentRequestedInfo { pub name : Option < :: mtproto :: string > , pub phone : Option < :: mtproto :: string > , pub email : Option < :: mtproto :: string > , pub shipping_address : Option < :: mtproto :: PostAddress > , } impl :: BareSerialize for PaymentRequestedInfo { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & PaymentRequestedInfo { ref name , ref phone , ref email , ref shipping_address } = self ; let mut _flags = 0i32 ; if name . is_some ( ) { _flags |= 1 << 0u32 ; } if phone . is_some ( ) { _flags |= 1 << 1u32 ; } if email . is_some ( ) { _flags |= 1 << 2u32 ; } if shipping_address . is_some ( ) { _flags |= 1 << 3u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; if let & Some ( ref inner ) = name { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = phone { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = email { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = shipping_address { _ser . write_boxed :: < :: mtproto :: PostAddress > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for PaymentRequestedInfo { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( PaymentRequestedInfo { name : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; if _flags & ( 1 << 0u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } } , phone : if _flags & ( 1 << 1u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , email : if _flags & ( 1 << 2u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , shipping_address : if _flags & ( 1 << 3u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: PostAddress > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for PaymentRequestedInfo { type Boxed = :: mtproto :: PaymentRequestedInfo ; fn into_boxed ( self ) -> :: mtproto :: PaymentRequestedInfo { :: mtproto :: PaymentRequestedInfo :: PaymentRequestedInfo ( self ) } } } pub mod payment_saved_credentials_card { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `paymentSavedCredentialsCard`\n\n```text\npaymentSavedCredentialsCard#cdc27a1f id:string title:string = PaymentSavedCredentials;\n```\n" ] pub struct PaymentSavedCredentialsCard { pub id : :: mtproto :: string , pub title : :: mtproto :: string , } impl :: BareSerialize for PaymentSavedCredentialsCard { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & PaymentSavedCredentialsCard { ref id , ref title } = self ; _ser . write_bare :: < :: mtproto :: string > ( id ) ? ; _ser . write_bare :: < :: mtproto :: string > ( title ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for PaymentSavedCredentialsCard { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( PaymentSavedCredentialsCard { id : _de . read_bare :: < :: mtproto :: string > ( ) ? , title : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for PaymentSavedCredentialsCard { type Boxed = :: mtproto :: PaymentSavedCredentials ; fn into_boxed ( self ) -> :: mtproto :: PaymentSavedCredentials { :: mtproto :: PaymentSavedCredentials :: PaymentSavedCredentialsCard ( self ) } } } pub mod payments { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `payments.PaymentForm`\n\n```text\npayments.paymentForm#3f56aea3 flags:# can_save_credentials:flags.2?true password_missing:flags.3?true bot_id:int invoice:Invoice provider_id:int url:string native_provider:flags.4?string native_params:flags.4?DataJSON saved_info:flags.0?PaymentRequestedInfo saved_credentials:flags.1?PaymentSavedCredentials users:Vector<User> = payments.PaymentForm;\n```\n" ] pub enum PaymentForm { PaymentForm ( :: mtproto :: payments :: payment_form :: PaymentForm ) , } impl PaymentForm { pub fn bot_id ( & self ) -> & :: mtproto :: int { match self { & PaymentForm :: PaymentForm ( ref x ) => & x . bot_id , } } pub fn can_save_credentials ( & self ) -> bool { match self { & PaymentForm :: PaymentForm ( ref x ) => x . can_save_credentials , } } pub fn invoice ( & self ) -> & :: mtproto :: Invoice { match self { & PaymentForm :: PaymentForm ( ref x ) => & x . invoice , } } pub fn native_params ( & self ) -> Option < & :: mtproto :: DataJSON > { match self { & PaymentForm :: PaymentForm ( ref x ) => x . native_params . as_ref ( ) , } } pub fn native_provider ( & self ) -> Option < & :: mtproto :: string > { match self { & PaymentForm :: PaymentForm ( ref x ) => x . native_provider . as_ref ( ) , } } pub fn password_missing ( & self ) -> bool { match self { & PaymentForm :: PaymentForm ( ref x ) => x . password_missing , } } pub fn provider_id ( & self ) -> & :: mtproto :: int { match self { & PaymentForm :: PaymentForm ( ref x ) => & x . provider_id , } } pub fn saved_credentials ( & self ) -> Option < & :: mtproto :: PaymentSavedCredentials > { match self { & PaymentForm :: PaymentForm ( ref x ) => x . saved_credentials . as_ref ( ) , } } pub fn saved_info ( & self ) -> Option < & :: mtproto :: PaymentRequestedInfo > { match self { & PaymentForm :: PaymentForm ( ref x ) => x . saved_info . as_ref ( ) , } } pub fn url ( & self ) -> & :: mtproto :: string { match self { & PaymentForm :: PaymentForm ( ref x ) => & x . url , } } pub fn users ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > { match self { & PaymentForm :: PaymentForm ( ref x ) => & x . users , } } } impl :: BoxedSerialize for PaymentForm { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & PaymentForm :: PaymentForm ( ref x ) => ( :: ConstructorNumber ( 0x3f56aea3 ) , x ) , } } } impl :: BoxedDeserialize for PaymentForm { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x3f56aea3 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x3f56aea3 ) => Ok ( PaymentForm :: PaymentForm ( _de . read_bare :: < :: mtproto :: payments :: payment_form :: PaymentForm > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `payments.PaymentReceipt`\n\n```text\npayments.paymentReceipt#500911e1 flags:# date:int bot_id:int invoice:Invoice provider_id:int info:flags.0?PaymentRequestedInfo shipping:flags.1?ShippingOption currency:string total_amount:long credentials_title:string users:Vector<User> = payments.PaymentReceipt;\n```\n" ] pub enum PaymentReceipt { PaymentReceipt ( :: mtproto :: payments :: payment_receipt :: PaymentReceipt ) , } impl PaymentReceipt { pub fn bot_id ( & self ) -> & :: mtproto :: int { match self { & PaymentReceipt :: PaymentReceipt ( ref x ) => & x . bot_id , } } pub fn credentials_title ( & self ) -> & :: mtproto :: string { match self { & PaymentReceipt :: PaymentReceipt ( ref x ) => & x . credentials_title , } } pub fn currency ( & self ) -> & :: mtproto :: string { match self { & PaymentReceipt :: PaymentReceipt ( ref x ) => & x . currency , } } pub fn date ( & self ) -> & :: mtproto :: int { match self { & PaymentReceipt :: PaymentReceipt ( ref x ) => & x . date , } } pub fn info ( & self ) -> Option < & :: mtproto :: PaymentRequestedInfo > { match self { & PaymentReceipt :: PaymentReceipt ( ref x ) => x . info . as_ref ( ) , } } pub fn invoice ( & self ) -> & :: mtproto :: Invoice { match self { & PaymentReceipt :: PaymentReceipt ( ref x ) => & x . invoice , } } pub fn provider_id ( & self ) -> & :: mtproto :: int { match self { & PaymentReceipt :: PaymentReceipt ( ref x ) => & x . provider_id , } } pub fn shipping ( & self ) -> Option < & :: mtproto :: ShippingOption > { match self { & PaymentReceipt :: PaymentReceipt ( ref x ) => x . shipping . as_ref ( ) , } } pub fn total_amount ( & self ) -> & :: mtproto :: long { match self { & PaymentReceipt :: PaymentReceipt ( ref x ) => & x . total_amount , } } pub fn users ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > { match self { & PaymentReceipt :: PaymentReceipt ( ref x ) => & x . users , } } } impl :: BoxedSerialize for PaymentReceipt { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & PaymentReceipt :: PaymentReceipt ( ref x ) => ( :: ConstructorNumber ( 0x500911e1 ) , x ) , } } } impl :: BoxedDeserialize for PaymentReceipt { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x500911e1 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x500911e1 ) => Ok ( PaymentReceipt :: PaymentReceipt ( _de . read_bare :: < :: mtproto :: payments :: payment_receipt :: PaymentReceipt > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `payments.PaymentResult`\n\n```text\npayments.paymentResult#4e5f810d updates:Updates = payments.PaymentResult;\n\npayments.paymentVerficationNeeded#6b56b921 url:string = payments.PaymentResult;\n```\n" ] pub enum PaymentResult { Result ( :: mtproto :: payments :: payment :: Result ) , VerficationNeeded ( :: mtproto :: payments :: payment :: VerficationNeeded ) , } impl PaymentResult { pub fn updates ( & self ) -> Option < & :: mtproto :: Updates > { match self { & PaymentResult :: Result ( ref x ) => Some ( & x . updates ) , _ => None } } pub fn url ( & self ) -> Option < & :: mtproto :: string > { match self { & PaymentResult :: VerficationNeeded ( ref x ) => Some ( & x . url ) , _ => None } } } impl :: BoxedSerialize for PaymentResult { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & PaymentResult :: Result ( ref x ) => ( :: ConstructorNumber ( 0x4e5f810d ) , x ) , & PaymentResult :: VerficationNeeded ( ref x ) => ( :: ConstructorNumber ( 0x6b56b921 ) , x ) , } } } impl :: BoxedDeserialize for PaymentResult { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x4e5f810d ) , :: ConstructorNumber ( 0x6b56b921 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x4e5f810d ) => Ok ( PaymentResult :: Result ( _de . read_bare :: < :: mtproto :: payments :: payment :: Result > ( ) ? ) ) , :: ConstructorNumber ( 0x6b56b921 ) => Ok ( PaymentResult :: VerficationNeeded ( _de . read_bare :: < :: mtproto :: payments :: payment :: VerficationNeeded > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `payments.SavedInfo`\n\n```text\npayments.savedInfo#fb8fe43c flags:# has_saved_credentials:flags.1?true saved_info:flags.0?PaymentRequestedInfo = payments.SavedInfo;\n```\n" ] pub enum SavedInfo { SavedInfo ( :: mtproto :: payments :: saved_info :: SavedInfo ) , } impl SavedInfo { pub fn has_saved_credentials ( & self ) -> bool { match self { & SavedInfo :: SavedInfo ( ref x ) => x . has_saved_credentials , } } pub fn saved_info ( & self ) -> Option < & :: mtproto :: PaymentRequestedInfo > { match self { & SavedInfo :: SavedInfo ( ref x ) => x . saved_info . as_ref ( ) , } } } impl :: BoxedSerialize for SavedInfo { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & SavedInfo :: SavedInfo ( ref x ) => ( :: ConstructorNumber ( 0xfb8fe43c ) , x ) , } } } impl :: BoxedDeserialize for SavedInfo { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xfb8fe43c ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xfb8fe43c ) => Ok ( SavedInfo :: SavedInfo ( _de . read_bare :: < :: mtproto :: payments :: saved_info :: SavedInfo > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `payments.ValidatedRequestedInfo`\n\n```text\npayments.validatedRequestedInfo#d1451883 flags:# id:flags.0?string shipping_options:flags.1?Vector<ShippingOption> = payments.ValidatedRequestedInfo;\n```\n" ] pub enum ValidatedRequestedInfo { ValidatedRequestedInfo ( :: mtproto :: payments :: validated_requested_info :: ValidatedRequestedInfo ) , } impl ValidatedRequestedInfo { pub fn id ( & self ) -> Option < & :: mtproto :: string > { match self { & ValidatedRequestedInfo :: ValidatedRequestedInfo ( ref x ) => x . id . as_ref ( ) , } } pub fn shipping_options ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: ShippingOption > > { match self { & ValidatedRequestedInfo :: ValidatedRequestedInfo ( ref x ) => x . shipping_options . as_ref ( ) , } } } impl :: BoxedSerialize for ValidatedRequestedInfo { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ValidatedRequestedInfo :: ValidatedRequestedInfo ( ref x ) => ( :: ConstructorNumber ( 0xd1451883 ) , x ) , } } } impl :: BoxedDeserialize for ValidatedRequestedInfo { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xd1451883 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xd1451883 ) => Ok ( ValidatedRequestedInfo :: ValidatedRequestedInfo ( _de . read_bare :: < :: mtproto :: payments :: validated_requested_info :: ValidatedRequestedInfo > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } pub mod payment { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `payments.paymentResult`\n\n```text\npayments.paymentResult#4e5f810d updates:Updates = payments.PaymentResult;\n```\n" ] pub struct Result { pub updates : :: mtproto :: Updates , } impl :: BareSerialize for Result { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Result { ref updates } = self ; _ser . write_boxed :: < :: mtproto :: Updates > ( updates ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Result { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Result { updates : _de . read_boxed :: < :: mtproto :: Updates > ( ) ? , } ) } } impl :: IntoBoxed for Result { type Boxed = :: mtproto :: payments :: PaymentResult ; fn into_boxed ( self ) -> :: mtproto :: payments :: PaymentResult { :: mtproto :: payments :: PaymentResult :: Result ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `payments.paymentVerficationNeeded`\n\n```text\npayments.paymentVerficationNeeded#6b56b921 url:string = payments.PaymentResult;\n```\n" ] pub struct VerficationNeeded { pub url : :: mtproto :: string , } impl :: BareSerialize for VerficationNeeded { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & VerficationNeeded { ref url } = self ; _ser . write_bare :: < :: mtproto :: string > ( url ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for VerficationNeeded { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( VerficationNeeded { url : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for VerficationNeeded { type Boxed = :: mtproto :: payments :: PaymentResult ; fn into_boxed ( self ) -> :: mtproto :: payments :: PaymentResult { :: mtproto :: payments :: PaymentResult :: VerficationNeeded ( self ) } } } pub mod payment_form { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `payments.paymentForm`\n\n```text\npayments.paymentForm#3f56aea3 flags:# can_save_credentials:flags.2?true password_missing:flags.3?true bot_id:int invoice:Invoice provider_id:int url:string native_provider:flags.4?string native_params:flags.4?DataJSON saved_info:flags.0?PaymentRequestedInfo saved_credentials:flags.1?PaymentSavedCredentials users:Vector<User> = payments.PaymentForm;\n```\n" ] pub struct PaymentForm { pub can_save_credentials : bool , pub password_missing : bool , pub bot_id : :: mtproto :: int , pub invoice : :: mtproto :: Invoice , pub provider_id : :: mtproto :: int , pub url : :: mtproto :: string , pub native_provider : Option < :: mtproto :: string > , pub native_params : Option < :: mtproto :: DataJSON > , pub saved_info : Option < :: mtproto :: PaymentRequestedInfo > , pub saved_credentials : Option < :: mtproto :: PaymentSavedCredentials > , pub users : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > , } impl :: BareSerialize for PaymentForm { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & PaymentForm { can_save_credentials , password_missing , ref bot_id , ref invoice , ref provider_id , ref url , ref native_provider , ref native_params , ref saved_info , ref saved_credentials , ref users } = self ; let mut _flags = 0i32 ; if can_save_credentials { _flags |= 1 << 2u32 ; } if password_missing { _flags |= 1 << 3u32 ; } if native_provider . is_some ( ) { _flags |= 1 << 4u32 ; } if native_params . is_some ( ) { _flags |= 1 << 4u32 ; } if saved_info . is_some ( ) { _flags |= 1 << 0u32 ; } if saved_credentials . is_some ( ) { _flags |= 1 << 1u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: int > ( bot_id ) ? ; _ser . write_boxed :: < :: mtproto :: Invoice > ( invoice ) ? ; _ser . write_bare :: < :: mtproto :: int > ( provider_id ) ? ; _ser . write_bare :: < :: mtproto :: string > ( url ) ? ; if let & Some ( ref inner ) = native_provider { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = native_params { _ser . write_boxed :: < :: mtproto :: DataJSON > ( inner ) ? ; } if let & Some ( ref inner ) = saved_info { _ser . write_boxed :: < :: mtproto :: PaymentRequestedInfo > ( inner ) ? ; } if let & Some ( ref inner ) = saved_credentials { _ser . write_boxed :: < :: mtproto :: PaymentSavedCredentials > ( inner ) ? ; } _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( users ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for PaymentForm { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( PaymentForm { can_save_credentials : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 2u32 ) != 0 } , password_missing : _flags & ( 1 << 3u32 ) != 0 , bot_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , invoice : _de . read_boxed :: < :: mtproto :: Invoice > ( ) ? , provider_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , url : _de . read_bare :: < :: mtproto :: string > ( ) ? , native_provider : if _flags & ( 1 << 4u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , native_params : if _flags & ( 1 << 4u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: DataJSON > ( ) ? ) } else { None } , saved_info : if _flags & ( 1 << 0u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: PaymentRequestedInfo > ( ) ? ) } else { None } , saved_credentials : if _flags & ( 1 << 1u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: PaymentSavedCredentials > ( ) ? ) } else { None } , users : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( ) ? , } ) } } impl :: IntoBoxed for PaymentForm { type Boxed = :: mtproto :: payments :: PaymentForm ; fn into_boxed ( self ) -> :: mtproto :: payments :: PaymentForm { :: mtproto :: payments :: PaymentForm :: PaymentForm ( self ) } } } pub mod payment_receipt { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `payments.paymentReceipt`\n\n```text\npayments.paymentReceipt#500911e1 flags:# date:int bot_id:int invoice:Invoice provider_id:int info:flags.0?PaymentRequestedInfo shipping:flags.1?ShippingOption currency:string total_amount:long credentials_title:string users:Vector<User> = payments.PaymentReceipt;\n```\n" ] pub struct PaymentReceipt { pub date : :: mtproto :: int , pub bot_id : :: mtproto :: int , pub invoice : :: mtproto :: Invoice , pub provider_id : :: mtproto :: int , pub info : Option < :: mtproto :: PaymentRequestedInfo > , pub shipping : Option < :: mtproto :: ShippingOption > , pub currency : :: mtproto :: string , pub total_amount : :: mtproto :: long , pub credentials_title : :: mtproto :: string , pub users : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > , } impl :: BareSerialize for PaymentReceipt { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & PaymentReceipt { ref date , ref bot_id , ref invoice , ref provider_id , ref info , ref shipping , ref currency , ref total_amount , ref credentials_title , ref users } = self ; let mut _flags = 0i32 ; if info . is_some ( ) { _flags |= 1 << 0u32 ; } if shipping . is_some ( ) { _flags |= 1 << 1u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; _ser . write_bare :: < :: mtproto :: int > ( bot_id ) ? ; _ser . write_boxed :: < :: mtproto :: Invoice > ( invoice ) ? ; _ser . write_bare :: < :: mtproto :: int > ( provider_id ) ? ; if let & Some ( ref inner ) = info { _ser . write_boxed :: < :: mtproto :: PaymentRequestedInfo > ( inner ) ? ; } if let & Some ( ref inner ) = shipping { _ser . write_boxed :: < :: mtproto :: ShippingOption > ( inner ) ? ; } _ser . write_bare :: < :: mtproto :: string > ( currency ) ? ; _ser . write_bare :: < :: mtproto :: long > ( total_amount ) ? ; _ser . write_bare :: < :: mtproto :: string > ( credentials_title ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( users ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for PaymentReceipt { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( PaymentReceipt { date : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _de . read_bare :: < :: mtproto :: int > ( ) ? } , bot_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , invoice : _de . read_boxed :: < :: mtproto :: Invoice > ( ) ? , provider_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , info : if _flags & ( 1 << 0u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: PaymentRequestedInfo > ( ) ? ) } else { None } , shipping : if _flags & ( 1 << 1u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: ShippingOption > ( ) ? ) } else { None } , currency : _de . read_bare :: < :: mtproto :: string > ( ) ? , total_amount : _de . read_bare :: < :: mtproto :: long > ( ) ? , credentials_title : _de . read_bare :: < :: mtproto :: string > ( ) ? , users : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( ) ? , } ) } } impl :: IntoBoxed for PaymentReceipt { type Boxed = :: mtproto :: payments :: PaymentReceipt ; fn into_boxed ( self ) -> :: mtproto :: payments :: PaymentReceipt { :: mtproto :: payments :: PaymentReceipt :: PaymentReceipt ( self ) } } } pub mod saved_info { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `payments.savedInfo`\n\n```text\npayments.savedInfo#fb8fe43c flags:# has_saved_credentials:flags.1?true saved_info:flags.0?PaymentRequestedInfo = payments.SavedInfo;\n```\n" ] pub struct SavedInfo { pub has_saved_credentials : bool , pub saved_info : Option < :: mtproto :: PaymentRequestedInfo > , } impl :: BareSerialize for SavedInfo { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & SavedInfo { has_saved_credentials , ref saved_info } = self ; let mut _flags = 0i32 ; if has_saved_credentials { _flags |= 1 << 1u32 ; } if saved_info . is_some ( ) { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; if let & Some ( ref inner ) = saved_info { _ser . write_boxed :: < :: mtproto :: PaymentRequestedInfo > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for SavedInfo { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( SavedInfo { has_saved_credentials : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 1u32 ) != 0 } , saved_info : if _flags & ( 1 << 0u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: PaymentRequestedInfo > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for SavedInfo { type Boxed = :: mtproto :: payments :: SavedInfo ; fn into_boxed ( self ) -> :: mtproto :: payments :: SavedInfo { :: mtproto :: payments :: SavedInfo :: SavedInfo ( self ) } } } pub mod validated_requested_info { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `payments.validatedRequestedInfo`\n\n```text\npayments.validatedRequestedInfo#d1451883 flags:# id:flags.0?string shipping_options:flags.1?Vector<ShippingOption> = payments.ValidatedRequestedInfo;\n```\n" ] pub struct ValidatedRequestedInfo { pub id : Option < :: mtproto :: string > , pub shipping_options : Option < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: ShippingOption > > , } impl :: BareSerialize for ValidatedRequestedInfo { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ValidatedRequestedInfo { ref id , ref shipping_options } = self ; let mut _flags = 0i32 ; if id . is_some ( ) { _flags |= 1 << 0u32 ; } if shipping_options . is_some ( ) { _flags |= 1 << 1u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; if let & Some ( ref inner ) = id { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = shipping_options { _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: ShippingOption > > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for ValidatedRequestedInfo { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( ValidatedRequestedInfo { id : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; if _flags & ( 1 << 0u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } } , shipping_options : if _flags & ( 1 << 1u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: ShippingOption > > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for ValidatedRequestedInfo { type Boxed = :: mtproto :: payments :: ValidatedRequestedInfo ; fn into_boxed ( self ) -> :: mtproto :: payments :: ValidatedRequestedInfo { :: mtproto :: payments :: ValidatedRequestedInfo :: ValidatedRequestedInfo ( self ) } } } } pub mod peer { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `peerChannel`\n\n```text\npeerChannel#bddde532 channel_id:int = Peer;\n```\n" ] pub struct Channel { pub channel_id : :: mtproto :: int , } impl :: BareSerialize for Channel { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Channel { ref channel_id } = self ; _ser . write_bare :: < :: mtproto :: int > ( channel_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Channel { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Channel { channel_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for Channel { type Boxed = :: mtproto :: Peer ; fn into_boxed ( self ) -> :: mtproto :: Peer { :: mtproto :: Peer :: Channel ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `peerChat`\n\n```text\npeerChat#bad0e5bb chat_id:int = Peer;\n```\n" ] pub struct Chat { pub chat_id : :: mtproto :: int , } impl :: BareSerialize for Chat { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Chat { ref chat_id } = self ; _ser . write_bare :: < :: mtproto :: int > ( chat_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Chat { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Chat { chat_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for Chat { type Boxed = :: mtproto :: Peer ; fn into_boxed ( self ) -> :: mtproto :: Peer { :: mtproto :: Peer :: Chat ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `peerUser`\n\n```text\npeerUser#9db1bc6d user_id:int = Peer;\n```\n" ] pub struct User { pub user_id : :: mtproto :: int , } impl :: BareSerialize for User { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & User { ref user_id } = self ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for User { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( User { user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for User { type Boxed = :: mtproto :: Peer ; fn into_boxed ( self ) -> :: mtproto :: Peer { :: mtproto :: Peer :: User ( self ) } } } pub mod peer_notify_events { } pub mod peer_notify_settings { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `peerNotifySettings`\n\n```text\npeerNotifySettings#9acda4c0 flags:# show_previews:flags.0?true silent:flags.1?true mute_until:int sound:string = PeerNotifySettings;\n```\n" ] pub struct PeerNotifySettings { pub show_previews : bool , pub silent : bool , pub mute_until : :: mtproto :: int , pub sound : :: mtproto :: string , } impl :: BareSerialize for PeerNotifySettings { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & PeerNotifySettings { show_previews , silent , ref mute_until , ref sound } = self ; let mut _flags = 0i32 ; if show_previews { _flags |= 1 << 0u32 ; } if silent { _flags |= 1 << 1u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: int > ( mute_until ) ? ; _ser . write_bare :: < :: mtproto :: string > ( sound ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for PeerNotifySettings { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( PeerNotifySettings { show_previews : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 0u32 ) != 0 } , silent : _flags & ( 1 << 1u32 ) != 0 , mute_until : _de . read_bare :: < :: mtproto :: int > ( ) ? , sound : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for PeerNotifySettings { type Boxed = :: mtproto :: PeerNotifySettings ; fn into_boxed ( self ) -> :: mtproto :: PeerNotifySettings { :: mtproto :: PeerNotifySettings :: PeerNotifySettings ( self ) } } } pub mod peer_settings { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `peerSettings`\n\n```text\npeerSettings#818426cd flags:# report_spam:flags.0?true = PeerSettings;\n```\n" ] pub struct PeerSettings { pub report_spam : bool , } impl :: BareSerialize for PeerSettings { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & PeerSettings { report_spam } = self ; let mut _flags = 0i32 ; if report_spam { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for PeerSettings { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( PeerSettings { report_spam : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 0u32 ) != 0 } , } ) } } impl :: IntoBoxed for PeerSettings { type Boxed = :: mtproto :: PeerSettings ; fn into_boxed ( self ) -> :: mtproto :: PeerSettings { :: mtproto :: PeerSettings :: PeerSettings ( self ) } } } pub mod phone { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `phone.PhoneCall`\n\n```text\nphone.phoneCall#ec82e140 phone_call:PhoneCall users:Vector<User> = phone.PhoneCall;\n```\n" ] pub enum PhoneCall { PhoneCall ( :: mtproto :: phone :: phone_call :: PhoneCall ) , } impl PhoneCall { pub fn phone_call ( & self ) -> & :: mtproto :: PhoneCall { match self { & PhoneCall :: PhoneCall ( ref x ) => & x . phone_call , } } pub fn users ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > { match self { & PhoneCall :: PhoneCall ( ref x ) => & x . users , } } } impl :: BoxedSerialize for PhoneCall { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & PhoneCall :: PhoneCall ( ref x ) => ( :: ConstructorNumber ( 0xec82e140 ) , x ) , } } } impl :: BoxedDeserialize for PhoneCall { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xec82e140 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xec82e140 ) => Ok ( PhoneCall :: PhoneCall ( _de . read_bare :: < :: mtproto :: phone :: phone_call :: PhoneCall > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } pub mod phone_call { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `phone.phoneCall`\n\n```text\nphone.phoneCall#ec82e140 phone_call:PhoneCall users:Vector<User> = phone.PhoneCall;\n```\n" ] pub struct PhoneCall { pub phone_call : :: mtproto :: PhoneCall , pub users : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > , } impl :: BareSerialize for PhoneCall { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & PhoneCall { ref phone_call , ref users } = self ; _ser . write_boxed :: < :: mtproto :: PhoneCall > ( phone_call ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( users ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for PhoneCall { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( PhoneCall { phone_call : _de . read_boxed :: < :: mtproto :: PhoneCall > ( ) ? , users : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( ) ? , } ) } } impl :: IntoBoxed for PhoneCall { type Boxed = :: mtproto :: phone :: PhoneCall ; fn into_boxed ( self ) -> :: mtproto :: phone :: PhoneCall { :: mtproto :: phone :: PhoneCall :: PhoneCall ( self ) } } } } pub mod phone_call { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `phoneCallAccepted`\n\n```text\nphoneCallAccepted#6d003d3f id:long access_hash:long date:int admin_id:int participant_id:int g_b:bytes protocol:PhoneCallProtocol = PhoneCall;\n```\n" ] pub struct Accepted { pub id : :: mtproto :: long , pub access_hash : :: mtproto :: long , pub date : :: mtproto :: int , pub admin_id : :: mtproto :: int , pub participant_id : :: mtproto :: int , pub g_b : :: mtproto :: bytes , pub protocol : :: mtproto :: PhoneCallProtocol , } impl :: BareSerialize for Accepted { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Accepted { ref id , ref access_hash , ref date , ref admin_id , ref participant_id , ref g_b , ref protocol } = self ; _ser . write_bare :: < :: mtproto :: long > ( id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( access_hash ) ? ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; _ser . write_bare :: < :: mtproto :: int > ( admin_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( participant_id ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( g_b ) ? ; _ser . write_boxed :: < :: mtproto :: PhoneCallProtocol > ( protocol ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Accepted { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Accepted { id : _de . read_bare :: < :: mtproto :: long > ( ) ? , access_hash : _de . read_bare :: < :: mtproto :: long > ( ) ? , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , admin_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , participant_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , g_b : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , protocol : _de . read_boxed :: < :: mtproto :: PhoneCallProtocol > ( ) ? , } ) } } impl :: IntoBoxed for Accepted { type Boxed = :: mtproto :: PhoneCall ; fn into_boxed ( self ) -> :: mtproto :: PhoneCall { :: mtproto :: PhoneCall :: Accepted ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `phoneCallDiscarded`\n\n```text\nphoneCallDiscarded#50ca4de1 flags:# need_rating:flags.2?true need_debug:flags.3?true id:long reason:flags.0?PhoneCallDiscardReason duration:flags.1?int = PhoneCall;\n```\n" ] pub struct Discarded { pub need_rating : bool , pub need_debug : bool , pub id : :: mtproto :: long , pub reason : Option < :: mtproto :: PhoneCallDiscardReason > , pub duration : Option < :: mtproto :: int > , } impl :: BareSerialize for Discarded { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Discarded { need_rating , need_debug , ref id , ref reason , ref duration } = self ; let mut _flags = 0i32 ; if need_rating { _flags |= 1 << 2u32 ; } if need_debug { _flags |= 1 << 3u32 ; } if reason . is_some ( ) { _flags |= 1 << 0u32 ; } if duration . is_some ( ) { _flags |= 1 << 1u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: long > ( id ) ? ; if let & Some ( ref inner ) = reason { _ser . write_boxed :: < :: mtproto :: PhoneCallDiscardReason > ( inner ) ? ; } if let & Some ( ref inner ) = duration { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for Discarded { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( Discarded { need_rating : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 2u32 ) != 0 } , need_debug : _flags & ( 1 << 3u32 ) != 0 , id : _de . read_bare :: < :: mtproto :: long > ( ) ? , reason : if _flags & ( 1 << 0u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: PhoneCallDiscardReason > ( ) ? ) } else { None } , duration : if _flags & ( 1 << 1u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for Discarded { type Boxed = :: mtproto :: PhoneCall ; fn into_boxed ( self ) -> :: mtproto :: PhoneCall { :: mtproto :: PhoneCall :: Discarded ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `phoneCallEmpty`\n\n```text\nphoneCallEmpty#5366c915 id:long = PhoneCall;\n```\n" ] pub struct Empty { pub id : :: mtproto :: long , } impl :: BareSerialize for Empty { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Empty { ref id } = self ; _ser . write_bare :: < :: mtproto :: long > ( id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Empty { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Empty { id : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for Empty { type Boxed = :: mtproto :: PhoneCall ; fn into_boxed ( self ) -> :: mtproto :: PhoneCall { :: mtproto :: PhoneCall :: Empty ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `phoneCall`\n\n```text\nphoneCall#ffe6ab67 id:long access_hash:long date:int admin_id:int participant_id:int g_a_or_b:bytes key_fingerprint:long protocol:PhoneCallProtocol connection:PhoneConnection alternative_connections:Vector<PhoneConnection> start_date:int = PhoneCall;\n```\n" ] pub struct PhoneCall { pub id : :: mtproto :: long , pub access_hash : :: mtproto :: long , pub date : :: mtproto :: int , pub admin_id : :: mtproto :: int , pub participant_id : :: mtproto :: int , pub g_a_or_b : :: mtproto :: bytes , pub key_fingerprint : :: mtproto :: long , pub protocol : :: mtproto :: PhoneCallProtocol , pub connection : :: mtproto :: PhoneConnection , pub alternative_connections : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PhoneConnection > , pub start_date : :: mtproto :: int , } impl :: BareSerialize for PhoneCall { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & PhoneCall { ref id , ref access_hash , ref date , ref admin_id , ref participant_id , ref g_a_or_b , ref key_fingerprint , ref protocol , ref connection , ref alternative_connections , ref start_date } = self ; _ser . write_bare :: < :: mtproto :: long > ( id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( access_hash ) ? ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; _ser . write_bare :: < :: mtproto :: int > ( admin_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( participant_id ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( g_a_or_b ) ? ; _ser . write_bare :: < :: mtproto :: long > ( key_fingerprint ) ? ; _ser . write_boxed :: < :: mtproto :: PhoneCallProtocol > ( protocol ) ? ; _ser . write_boxed :: < :: mtproto :: PhoneConnection > ( connection ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PhoneConnection > > ( alternative_connections ) ? ; _ser . write_bare :: < :: mtproto :: int > ( start_date ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for PhoneCall { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( PhoneCall { id : _de . read_bare :: < :: mtproto :: long > ( ) ? , access_hash : _de . read_bare :: < :: mtproto :: long > ( ) ? , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , admin_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , participant_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , g_a_or_b : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , key_fingerprint : _de . read_bare :: < :: mtproto :: long > ( ) ? , protocol : _de . read_boxed :: < :: mtproto :: PhoneCallProtocol > ( ) ? , connection : _de . read_boxed :: < :: mtproto :: PhoneConnection > ( ) ? , alternative_connections : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PhoneConnection > > ( ) ? , start_date : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for PhoneCall { type Boxed = :: mtproto :: PhoneCall ; fn into_boxed ( self ) -> :: mtproto :: PhoneCall { :: mtproto :: PhoneCall :: PhoneCall ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `phoneCallRequested`\n\n```text\nphoneCallRequested#83761ce4 id:long access_hash:long date:int admin_id:int participant_id:int g_a_hash:bytes protocol:PhoneCallProtocol = PhoneCall;\n```\n" ] pub struct Requested { pub id : :: mtproto :: long , pub access_hash : :: mtproto :: long , pub date : :: mtproto :: int , pub admin_id : :: mtproto :: int , pub participant_id : :: mtproto :: int , pub g_a_hash : :: mtproto :: bytes , pub protocol : :: mtproto :: PhoneCallProtocol , } impl :: BareSerialize for Requested { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Requested { ref id , ref access_hash , ref date , ref admin_id , ref participant_id , ref g_a_hash , ref protocol } = self ; _ser . write_bare :: < :: mtproto :: long > ( id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( access_hash ) ? ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; _ser . write_bare :: < :: mtproto :: int > ( admin_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( participant_id ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( g_a_hash ) ? ; _ser . write_boxed :: < :: mtproto :: PhoneCallProtocol > ( protocol ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Requested { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Requested { id : _de . read_bare :: < :: mtproto :: long > ( ) ? , access_hash : _de . read_bare :: < :: mtproto :: long > ( ) ? , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , admin_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , participant_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , g_a_hash : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , protocol : _de . read_boxed :: < :: mtproto :: PhoneCallProtocol > ( ) ? , } ) } } impl :: IntoBoxed for Requested { type Boxed = :: mtproto :: PhoneCall ; fn into_boxed ( self ) -> :: mtproto :: PhoneCall { :: mtproto :: PhoneCall :: Requested ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `phoneCallWaiting`\n\n```text\nphoneCallWaiting#1b8f4ad1 flags:# id:long access_hash:long date:int admin_id:int participant_id:int protocol:PhoneCallProtocol receive_date:flags.0?int = PhoneCall;\n```\n" ] pub struct Waiting { pub id : :: mtproto :: long , pub access_hash : :: mtproto :: long , pub date : :: mtproto :: int , pub admin_id : :: mtproto :: int , pub participant_id : :: mtproto :: int , pub protocol : :: mtproto :: PhoneCallProtocol , pub receive_date : Option < :: mtproto :: int > , } impl :: BareSerialize for Waiting { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Waiting { ref id , ref access_hash , ref date , ref admin_id , ref participant_id , ref protocol , ref receive_date } = self ; let mut _flags = 0i32 ; if receive_date . is_some ( ) { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: long > ( id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( access_hash ) ? ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; _ser . write_bare :: < :: mtproto :: int > ( admin_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( participant_id ) ? ; _ser . write_boxed :: < :: mtproto :: PhoneCallProtocol > ( protocol ) ? ; if let & Some ( ref inner ) = receive_date { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for Waiting { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( Waiting { id : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _de . read_bare :: < :: mtproto :: long > ( ) ? } , access_hash : _de . read_bare :: < :: mtproto :: long > ( ) ? , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , admin_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , participant_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , protocol : _de . read_boxed :: < :: mtproto :: PhoneCallProtocol > ( ) ? , receive_date : if _flags & ( 1 << 0u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for Waiting { type Boxed = :: mtproto :: PhoneCall ; fn into_boxed ( self ) -> :: mtproto :: PhoneCall { :: mtproto :: PhoneCall :: Waiting ( self ) } } } pub mod phone_call_discard_reason { } pub mod phone_call_protocol { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `phoneCallProtocol`\n\n```text\nphoneCallProtocol#a2bb35cb flags:# udp_p2p:flags.0?true udp_reflector:flags.1?true min_layer:int max_layer:int = PhoneCallProtocol;\n```\n" ] pub struct PhoneCallProtocol { pub udp_p2p : bool , pub udp_reflector : bool , pub min_layer : :: mtproto :: int , pub max_layer : :: mtproto :: int , } impl :: BareSerialize for PhoneCallProtocol { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & PhoneCallProtocol { udp_p2p , udp_reflector , ref min_layer , ref max_layer } = self ; let mut _flags = 0i32 ; if udp_p2p { _flags |= 1 << 0u32 ; } if udp_reflector { _flags |= 1 << 1u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: int > ( min_layer ) ? ; _ser . write_bare :: < :: mtproto :: int > ( max_layer ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for PhoneCallProtocol { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( PhoneCallProtocol { udp_p2p : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 0u32 ) != 0 } , udp_reflector : _flags & ( 1 << 1u32 ) != 0 , min_layer : _de . read_bare :: < :: mtproto :: int > ( ) ? , max_layer : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for PhoneCallProtocol { type Boxed = :: mtproto :: PhoneCallProtocol ; fn into_boxed ( self ) -> :: mtproto :: PhoneCallProtocol { :: mtproto :: PhoneCallProtocol :: PhoneCallProtocol ( self ) } } } pub mod phone_connection { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `phoneConnection`\n\n```text\nphoneConnection#9d4c17c0 id:long ip:string ipv6:string port:int peer_tag:bytes = PhoneConnection;\n```\n" ] pub struct PhoneConnection { pub id : :: mtproto :: long , pub ip : :: mtproto :: string , pub ipv6 : :: mtproto :: string , pub port : :: mtproto :: int , pub peer_tag : :: mtproto :: bytes , } impl :: BareSerialize for PhoneConnection { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & PhoneConnection { ref id , ref ip , ref ipv6 , ref port , ref peer_tag } = self ; _ser . write_bare :: < :: mtproto :: long > ( id ) ? ; _ser . write_bare :: < :: mtproto :: string > ( ip ) ? ; _ser . write_bare :: < :: mtproto :: string > ( ipv6 ) ? ; _ser . write_bare :: < :: mtproto :: int > ( port ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( peer_tag ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for PhoneConnection { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( PhoneConnection { id : _de . read_bare :: < :: mtproto :: long > ( ) ? , ip : _de . read_bare :: < :: mtproto :: string > ( ) ? , ipv6 : _de . read_bare :: < :: mtproto :: string > ( ) ? , port : _de . read_bare :: < :: mtproto :: int > ( ) ? , peer_tag : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , } ) } } impl :: IntoBoxed for PhoneConnection { type Boxed = :: mtproto :: PhoneConnection ; fn into_boxed ( self ) -> :: mtproto :: PhoneConnection { :: mtproto :: PhoneConnection :: PhoneConnection ( self ) } } } pub mod photo { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `photoCachedSize`\n\n```text\nphotoCachedSize#e9a734fa type:string location:FileLocation w:int h:int bytes:bytes = PhotoSize;\n```\n" ] pub struct CachedSize { pub type_ : :: mtproto :: string , pub location : :: mtproto :: FileLocation , pub w : :: mtproto :: int , pub h : :: mtproto :: int , pub bytes : :: mtproto :: bytes , } impl :: BareSerialize for CachedSize { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & CachedSize { ref type_ , ref location , ref w , ref h , bytes : ref bytes_ } = self ; _ser . write_bare :: < :: mtproto :: string > ( type_ ) ? ; _ser . write_boxed :: < :: mtproto :: FileLocation > ( location ) ? ; _ser . write_bare :: < :: mtproto :: int > ( w ) ? ; _ser . write_bare :: < :: mtproto :: int > ( h ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( bytes_ ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for CachedSize { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( CachedSize { type_ : _de . read_bare :: < :: mtproto :: string > ( ) ? , location : _de . read_boxed :: < :: mtproto :: FileLocation > ( ) ? , w : _de . read_bare :: < :: mtproto :: int > ( ) ? , h : _de . read_bare :: < :: mtproto :: int > ( ) ? , bytes : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , } ) } } impl :: IntoBoxed for CachedSize { type Boxed = :: mtproto :: PhotoSize ; fn into_boxed ( self ) -> :: mtproto :: PhotoSize { :: mtproto :: PhotoSize :: CachedSize ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `photoEmpty`\n\n```text\nphotoEmpty#2331b22d id:long = Photo;\n```\n" ] pub struct Empty { pub id : :: mtproto :: long , } impl :: BareSerialize for Empty { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Empty { ref id } = self ; _ser . write_bare :: < :: mtproto :: long > ( id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Empty { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Empty { id : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for Empty { type Boxed = :: mtproto :: Photo ; fn into_boxed ( self ) -> :: mtproto :: Photo { :: mtproto :: Photo :: Empty ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `photo`\n\n```text\nphoto#9288dd29 flags:# has_stickers:flags.0?true id:long access_hash:long date:int sizes:Vector<PhotoSize> = Photo;\n```\n" ] pub struct Photo { pub has_stickers : bool , pub id : :: mtproto :: long , pub access_hash : :: mtproto :: long , pub date : :: mtproto :: int , pub sizes : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PhotoSize > , } impl :: BareSerialize for Photo { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Photo { has_stickers , ref id , ref access_hash , ref date , ref sizes } = self ; let mut _flags = 0i32 ; if has_stickers { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: long > ( id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( access_hash ) ? ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PhotoSize > > ( sizes ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Photo { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( Photo { has_stickers : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 0u32 ) != 0 } , id : _de . read_bare :: < :: mtproto :: long > ( ) ? , access_hash : _de . read_bare :: < :: mtproto :: long > ( ) ? , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , sizes : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PhotoSize > > ( ) ? , } ) } } impl :: IntoBoxed for Photo { type Boxed = :: mtproto :: Photo ; fn into_boxed ( self ) -> :: mtproto :: Photo { :: mtproto :: Photo :: Photo ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `photoSize`\n\n```text\nphotoSize#77bfb61b type:string location:FileLocation w:int h:int size:int = PhotoSize;\n```\n" ] pub struct Size { pub type_ : :: mtproto :: string , pub location : :: mtproto :: FileLocation , pub w : :: mtproto :: int , pub h : :: mtproto :: int , pub size : :: mtproto :: int , } impl :: BareSerialize for Size { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Size { ref type_ , ref location , ref w , ref h , ref size } = self ; _ser . write_bare :: < :: mtproto :: string > ( type_ ) ? ; _ser . write_boxed :: < :: mtproto :: FileLocation > ( location ) ? ; _ser . write_bare :: < :: mtproto :: int > ( w ) ? ; _ser . write_bare :: < :: mtproto :: int > ( h ) ? ; _ser . write_bare :: < :: mtproto :: int > ( size ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Size { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Size { type_ : _de . read_bare :: < :: mtproto :: string > ( ) ? , location : _de . read_boxed :: < :: mtproto :: FileLocation > ( ) ? , w : _de . read_bare :: < :: mtproto :: int > ( ) ? , h : _de . read_bare :: < :: mtproto :: int > ( ) ? , size : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for Size { type Boxed = :: mtproto :: PhotoSize ; fn into_boxed ( self ) -> :: mtproto :: PhotoSize { :: mtproto :: PhotoSize :: Size ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `photoSizeEmpty`\n\n```text\nphotoSizeEmpty#e17e23c type:string = PhotoSize;\n```\n" ] pub struct SizeEmpty { pub type_ : :: mtproto :: string , } impl :: BareSerialize for SizeEmpty { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & SizeEmpty { ref type_ } = self ; _ser . write_bare :: < :: mtproto :: string > ( type_ ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for SizeEmpty { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( SizeEmpty { type_ : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for SizeEmpty { type Boxed = :: mtproto :: PhotoSize ; fn into_boxed ( self ) -> :: mtproto :: PhotoSize { :: mtproto :: PhotoSize :: SizeEmpty ( self ) } } } pub mod photos { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `photos.Photo`\n\n```text\nphotos.photo#20212ca8 photo:Photo users:Vector<User> = photos.Photo;\n```\n" ] pub enum Photo { Photo ( :: mtproto :: photos :: photo :: Photo ) , } impl Photo { pub fn photo ( & self ) -> & :: mtproto :: Photo { match self { & Photo :: Photo ( ref x ) => & x . photo , } } pub fn users ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > { match self { & Photo :: Photo ( ref x ) => & x . users , } } } impl :: BoxedSerialize for Photo { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Photo :: Photo ( ref x ) => ( :: ConstructorNumber ( 0x20212ca8 ) , x ) , } } } impl :: BoxedDeserialize for Photo { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x20212ca8 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x20212ca8 ) => Ok ( Photo :: Photo ( _de . read_bare :: < :: mtproto :: photos :: photo :: Photo > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `photos.Photos`\n\n```text\nphotos.photos#8dca6aa5 photos:Vector<Photo> users:Vector<User> = photos.Photos;\n\nphotos.photosSlice#15051f54 count:int photos:Vector<Photo> users:Vector<User> = photos.Photos;\n```\n" ] pub enum Photos { Photos ( :: mtproto :: photos :: photos :: Photos ) , Slice ( :: mtproto :: photos :: photos :: Slice ) , } impl Photos { pub fn count ( & self ) -> Option < & :: mtproto :: int > { match self { & Photos :: Slice ( ref x ) => Some ( & x . count ) , _ => None } } pub fn photos ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Photo > { match self { & Photos :: Photos ( ref x ) => & x . photos , & Photos :: Slice ( ref x ) => & x . photos , } } pub fn users ( & self ) -> & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > { match self { & Photos :: Slice ( ref x ) => & x . users , & Photos :: Photos ( ref x ) => & x . users , } } } impl :: BoxedSerialize for Photos { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Photos :: Photos ( ref x ) => ( :: ConstructorNumber ( 0x8dca6aa5 ) , x ) , & Photos :: Slice ( ref x ) => ( :: ConstructorNumber ( 0x15051f54 ) , x ) , } } } impl :: BoxedDeserialize for Photos { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x8dca6aa5 ) , :: ConstructorNumber ( 0x15051f54 ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x8dca6aa5 ) => Ok ( Photos :: Photos ( _de . read_bare :: < :: mtproto :: photos :: photos :: Photos > ( ) ? ) ) , :: ConstructorNumber ( 0x15051f54 ) => Ok ( Photos :: Slice ( _de . read_bare :: < :: mtproto :: photos :: photos :: Slice > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } pub mod photo { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `photos.photo`\n\n```text\nphotos.photo#20212ca8 photo:Photo users:Vector<User> = photos.Photo;\n```\n" ] pub struct Photo { pub photo : :: mtproto :: Photo , pub users : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > , } impl :: BareSerialize for Photo { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Photo { ref photo , ref users } = self ; _ser . write_boxed :: < :: mtproto :: Photo > ( photo ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( users ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Photo { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Photo { photo : _de . read_boxed :: < :: mtproto :: Photo > ( ) ? , users : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( ) ? , } ) } } impl :: IntoBoxed for Photo { type Boxed = :: mtproto :: photos :: Photo ; fn into_boxed ( self ) -> :: mtproto :: photos :: Photo { :: mtproto :: photos :: Photo :: Photo ( self ) } } } pub mod photos { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `photos.photos`\n\n```text\nphotos.photos#8dca6aa5 photos:Vector<Photo> users:Vector<User> = photos.Photos;\n```\n" ] pub struct Photos { pub photos : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Photo > , pub users : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > , } impl :: BareSerialize for Photos { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Photos { ref photos , ref users } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Photo > > ( photos ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( users ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Photos { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Photos { photos : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Photo > > ( ) ? , users : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( ) ? , } ) } } impl :: IntoBoxed for Photos { type Boxed = :: mtproto :: photos :: Photos ; fn into_boxed ( self ) -> :: mtproto :: photos :: Photos { :: mtproto :: photos :: Photos :: Photos ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `photos.photosSlice`\n\n```text\nphotos.photosSlice#15051f54 count:int photos:Vector<Photo> users:Vector<User> = photos.Photos;\n```\n" ] pub struct Slice { pub count : :: mtproto :: int , pub photos : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Photo > , pub users : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > , } impl :: BareSerialize for Slice { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Slice { ref count , ref photos , ref users } = self ; _ser . write_bare :: < :: mtproto :: int > ( count ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Photo > > ( photos ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( users ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Slice { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Slice { count : _de . read_bare :: < :: mtproto :: int > ( ) ? , photos : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Photo > > ( ) ? , users : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( ) ? , } ) } } impl :: IntoBoxed for Slice { type Boxed = :: mtproto :: photos :: Photos ; fn into_boxed ( self ) -> :: mtproto :: photos :: Photos { :: mtproto :: photos :: Photos :: Slice ( self ) } } } } pub mod pong { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `pong`\n\n```text\npong#347773c5 msg_id:long ping_id:long = Pong;\n```\n" ] pub struct Pong { pub msg_id : :: mtproto :: long , pub ping_id : :: mtproto :: long , } impl :: BareSerialize for Pong { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Pong { ref msg_id , ref ping_id } = self ; _ser . write_bare :: < :: mtproto :: long > ( msg_id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( ping_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Pong { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Pong { msg_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , ping_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for Pong { type Boxed = :: mtproto :: Pong ; fn into_boxed ( self ) -> :: mtproto :: Pong { :: mtproto :: Pong :: Pong ( self ) } } } pub mod popular_contact { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `popularContact`\n\n```text\npopularContact#5ce14175 client_id:long importers:int = PopularContact;\n```\n" ] pub struct PopularContact { pub client_id : :: mtproto :: long , pub importers : :: mtproto :: int , } impl :: BareSerialize for PopularContact { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & PopularContact { ref client_id , ref importers } = self ; _ser . write_bare :: < :: mtproto :: long > ( client_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( importers ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for PopularContact { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( PopularContact { client_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , importers : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for PopularContact { type Boxed = :: mtproto :: PopularContact ; fn into_boxed ( self ) -> :: mtproto :: PopularContact { :: mtproto :: PopularContact :: PopularContact ( self ) } } } pub mod post_address { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `postAddress`\n\n```text\npostAddress#1e8caaeb street_line1:string street_line2:string city:string state:string country_iso2:string post_code:string = PostAddress;\n```\n" ] pub struct PostAddress { pub street_line1 : :: mtproto :: string , pub street_line2 : :: mtproto :: string , pub city : :: mtproto :: string , pub state : :: mtproto :: string , pub country_iso2 : :: mtproto :: string , pub post_code : :: mtproto :: string , } impl :: BareSerialize for PostAddress { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & PostAddress { ref street_line1 , ref street_line2 , ref city , ref state , ref country_iso2 , ref post_code } = self ; _ser . write_bare :: < :: mtproto :: string > ( street_line1 ) ? ; _ser . write_bare :: < :: mtproto :: string > ( street_line2 ) ? ; _ser . write_bare :: < :: mtproto :: string > ( city ) ? ; _ser . write_bare :: < :: mtproto :: string > ( state ) ? ; _ser . write_bare :: < :: mtproto :: string > ( country_iso2 ) ? ; _ser . write_bare :: < :: mtproto :: string > ( post_code ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for PostAddress { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( PostAddress { street_line1 : _de . read_bare :: < :: mtproto :: string > ( ) ? , street_line2 : _de . read_bare :: < :: mtproto :: string > ( ) ? , city : _de . read_bare :: < :: mtproto :: string > ( ) ? , state : _de . read_bare :: < :: mtproto :: string > ( ) ? , country_iso2 : _de . read_bare :: < :: mtproto :: string > ( ) ? , post_code : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for PostAddress { type Boxed = :: mtproto :: PostAddress ; fn into_boxed ( self ) -> :: mtproto :: PostAddress { :: mtproto :: PostAddress :: PostAddress ( self ) } } } pub mod privacy_key { } pub mod privacy_value { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `privacyValueAllowUsers`\n\n```text\nprivacyValueAllowUsers#4d5bbe0c users:Vector<int> = PrivacyRule;\n```\n" ] pub struct AllowUsers { pub users : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > , } impl :: BareSerialize for AllowUsers { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & AllowUsers { ref users } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > > ( users ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for AllowUsers { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( AllowUsers { users : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > > ( ) ? , } ) } } impl :: IntoBoxed for AllowUsers { type Boxed = :: mtproto :: PrivacyRule ; fn into_boxed ( self ) -> :: mtproto :: PrivacyRule { :: mtproto :: PrivacyRule :: AllowUsers ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `privacyValueDisallowUsers`\n\n```text\nprivacyValueDisallowUsers#c7f49b7 users:Vector<int> = PrivacyRule;\n```\n" ] pub struct DisallowUsers { pub users : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > , } impl :: BareSerialize for DisallowUsers { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & DisallowUsers { ref users } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > > ( users ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for DisallowUsers { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( DisallowUsers { users : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > > ( ) ? , } ) } } impl :: IntoBoxed for DisallowUsers { type Boxed = :: mtproto :: PrivacyRule ; fn into_boxed ( self ) -> :: mtproto :: PrivacyRule { :: mtproto :: PrivacyRule :: DisallowUsers ( self ) } } } pub mod received_notify_message { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `receivedNotifyMessage`\n\n```text\nreceivedNotifyMessage#a384b779 id:int flags:int = ReceivedNotifyMessage;\n```\n" ] pub struct ReceivedNotifyMessage { pub id : :: mtproto :: int , pub flags : :: mtproto :: int , } impl :: BareSerialize for ReceivedNotifyMessage { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ReceivedNotifyMessage { ref id , ref flags } = self ; _ser . write_bare :: < :: mtproto :: int > ( id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( flags ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ReceivedNotifyMessage { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ReceivedNotifyMessage { id : _de . read_bare :: < :: mtproto :: int > ( ) ? , flags : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for ReceivedNotifyMessage { type Boxed = :: mtproto :: ReceivedNotifyMessage ; fn into_boxed ( self ) -> :: mtproto :: ReceivedNotifyMessage { :: mtproto :: ReceivedNotifyMessage :: ReceivedNotifyMessage ( self ) } } } pub mod recent_me_url { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `recentMeUrlChat`\n\n```text\nrecentMeUrlChat#a01b22f9 url:string chat_id:int = RecentMeUrl;\n```\n" ] pub struct Chat { pub url : :: mtproto :: string , pub chat_id : :: mtproto :: int , } impl :: BareSerialize for Chat { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Chat { ref url , ref chat_id } = self ; _ser . write_bare :: < :: mtproto :: string > ( url ) ? ; _ser . write_bare :: < :: mtproto :: int > ( chat_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Chat { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Chat { url : _de . read_bare :: < :: mtproto :: string > ( ) ? , chat_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for Chat { type Boxed = :: mtproto :: RecentMeUrl ; fn into_boxed ( self ) -> :: mtproto :: RecentMeUrl { :: mtproto :: RecentMeUrl :: Chat ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `recentMeUrlChatInvite`\n\n```text\nrecentMeUrlChatInvite#eb49081d url:string chat_invite:ChatInvite = RecentMeUrl;\n```\n" ] pub struct ChatInvite { pub url : :: mtproto :: string , pub chat_invite : :: mtproto :: ChatInvite , } impl :: BareSerialize for ChatInvite { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChatInvite { ref url , ref chat_invite } = self ; _ser . write_bare :: < :: mtproto :: string > ( url ) ? ; _ser . write_boxed :: < :: mtproto :: ChatInvite > ( chat_invite ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ChatInvite { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ChatInvite { url : _de . read_bare :: < :: mtproto :: string > ( ) ? , chat_invite : _de . read_boxed :: < :: mtproto :: ChatInvite > ( ) ? , } ) } } impl :: IntoBoxed for ChatInvite { type Boxed = :: mtproto :: RecentMeUrl ; fn into_boxed ( self ) -> :: mtproto :: RecentMeUrl { :: mtproto :: RecentMeUrl :: ChatInvite ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `recentMeUrlStickerSet`\n\n```text\nrecentMeUrlStickerSet#bc0a57dc url:string set:StickerSetCovered = RecentMeUrl;\n```\n" ] pub struct StickerSet { pub url : :: mtproto :: string , pub set : :: mtproto :: StickerSetCovered , } impl :: BareSerialize for StickerSet { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & StickerSet { ref url , ref set } = self ; _ser . write_bare :: < :: mtproto :: string > ( url ) ? ; _ser . write_boxed :: < :: mtproto :: StickerSetCovered > ( set ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for StickerSet { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( StickerSet { url : _de . read_bare :: < :: mtproto :: string > ( ) ? , set : _de . read_boxed :: < :: mtproto :: StickerSetCovered > ( ) ? , } ) } } impl :: IntoBoxed for StickerSet { type Boxed = :: mtproto :: RecentMeUrl ; fn into_boxed ( self ) -> :: mtproto :: RecentMeUrl { :: mtproto :: RecentMeUrl :: StickerSet ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `recentMeUrlUnknown`\n\n```text\nrecentMeUrlUnknown#46e1d13d url:string = RecentMeUrl;\n```\n" ] pub struct Unknown { pub url : :: mtproto :: string , } impl :: BareSerialize for Unknown { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Unknown { ref url } = self ; _ser . write_bare :: < :: mtproto :: string > ( url ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Unknown { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Unknown { url : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for Unknown { type Boxed = :: mtproto :: RecentMeUrl ; fn into_boxed ( self ) -> :: mtproto :: RecentMeUrl { :: mtproto :: RecentMeUrl :: Unknown ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `recentMeUrlUser`\n\n```text\nrecentMeUrlUser#8dbc3336 url:string user_id:int = RecentMeUrl;\n```\n" ] pub struct User { pub url : :: mtproto :: string , pub user_id : :: mtproto :: int , } impl :: BareSerialize for User { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & User { ref url , ref user_id } = self ; _ser . write_bare :: < :: mtproto :: string > ( url ) ? ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for User { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( User { url : _de . read_bare :: < :: mtproto :: string > ( ) ? , user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for User { type Boxed = :: mtproto :: RecentMeUrl ; fn into_boxed ( self ) -> :: mtproto :: RecentMeUrl { :: mtproto :: RecentMeUrl :: User ( self ) } } } pub mod reply { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `replyInlineMarkup`\n\n```text\nreplyInlineMarkup#48a30254 rows:Vector<KeyboardButtonRow> = ReplyMarkup;\n```\n" ] pub struct InlineMarkup { pub rows : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: KeyboardButtonRow > , } impl :: BareSerialize for InlineMarkup { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & InlineMarkup { ref rows } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: KeyboardButtonRow > > ( rows ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for InlineMarkup { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( InlineMarkup { rows : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: KeyboardButtonRow > > ( ) ? , } ) } } impl :: IntoBoxed for InlineMarkup { type Boxed = :: mtproto :: ReplyMarkup ; fn into_boxed ( self ) -> :: mtproto :: ReplyMarkup { :: mtproto :: ReplyMarkup :: InlineMarkup ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `replyKeyboardForceReply`\n\n```text\nreplyKeyboardForceReply#f4108aa0 flags:# single_use:flags.1?true selective:flags.2?true = ReplyMarkup;\n```\n" ] pub struct KeyboardForceReply { pub single_use : bool , pub selective : bool , } impl :: BareSerialize for KeyboardForceReply { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & KeyboardForceReply { single_use , selective } = self ; let mut _flags = 0i32 ; if single_use { _flags |= 1 << 1u32 ; } if selective { _flags |= 1 << 2u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for KeyboardForceReply { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( KeyboardForceReply { single_use : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 1u32 ) != 0 } , selective : _flags & ( 1 << 2u32 ) != 0 , } ) } } impl :: IntoBoxed for KeyboardForceReply { type Boxed = :: mtproto :: ReplyMarkup ; fn into_boxed ( self ) -> :: mtproto :: ReplyMarkup { :: mtproto :: ReplyMarkup :: KeyboardForceReply ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `replyKeyboardHide`\n\n```text\nreplyKeyboardHide#a03e5b85 flags:# selective:flags.2?true = ReplyMarkup;\n```\n" ] pub struct KeyboardHide { pub selective : bool , } impl :: BareSerialize for KeyboardHide { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & KeyboardHide { selective } = self ; let mut _flags = 0i32 ; if selective { _flags |= 1 << 2u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for KeyboardHide { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( KeyboardHide { selective : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 2u32 ) != 0 } , } ) } } impl :: IntoBoxed for KeyboardHide { type Boxed = :: mtproto :: ReplyMarkup ; fn into_boxed ( self ) -> :: mtproto :: ReplyMarkup { :: mtproto :: ReplyMarkup :: KeyboardHide ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `replyKeyboardMarkup`\n\n```text\nreplyKeyboardMarkup#3502758c flags:# resize:flags.0?true single_use:flags.1?true selective:flags.2?true rows:Vector<KeyboardButtonRow> = ReplyMarkup;\n```\n" ] pub struct KeyboardMarkup { pub resize : bool , pub single_use : bool , pub selective : bool , pub rows : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: KeyboardButtonRow > , } impl :: BareSerialize for KeyboardMarkup { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & KeyboardMarkup { resize , single_use , selective , ref rows } = self ; let mut _flags = 0i32 ; if resize { _flags |= 1 << 0u32 ; } if single_use { _flags |= 1 << 1u32 ; } if selective { _flags |= 1 << 2u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: KeyboardButtonRow > > ( rows ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for KeyboardMarkup { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( KeyboardMarkup { resize : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 0u32 ) != 0 } , single_use : _flags & ( 1 << 1u32 ) != 0 , selective : _flags & ( 1 << 2u32 ) != 0 , rows : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: KeyboardButtonRow > > ( ) ? , } ) } } impl :: IntoBoxed for KeyboardMarkup { type Boxed = :: mtproto :: ReplyMarkup ; fn into_boxed ( self ) -> :: mtproto :: ReplyMarkup { :: mtproto :: ReplyMarkup :: KeyboardMarkup ( self ) } } } pub mod res_pq { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `resPQ`\n\n```text\nresPQ#05162463 nonce:int128 server_nonce:int128 pq:string server_public_key_fingerprints:Vector<long> = ResPQ;\n```\n" ] pub struct ResPQ { pub nonce : :: mtproto :: int128 , pub server_nonce : :: mtproto :: int128 , pub pq : :: mtproto :: bytes , pub server_public_key_fingerprints : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > , } impl :: BareSerialize for ResPQ { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ResPQ { ref nonce , ref server_nonce , ref pq , ref server_public_key_fingerprints } = self ; _ser . write_bare :: < :: mtproto :: int128 > ( nonce ) ? ; _ser . write_bare :: < :: mtproto :: int128 > ( server_nonce ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( pq ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > > ( server_public_key_fingerprints ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ResPQ { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ResPQ { nonce : _de . read_bare :: < :: mtproto :: int128 > ( ) ? , server_nonce : _de . read_bare :: < :: mtproto :: int128 > ( ) ? , pq : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , server_public_key_fingerprints : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > > ( ) ? , } ) } } impl :: IntoBoxed for ResPQ { type Boxed = :: mtproto :: ResPQ ; fn into_boxed ( self ) -> :: mtproto :: ResPQ { :: mtproto :: ResPQ :: ResPQ ( self ) } } } pub mod rpc { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `destroy_auth_key`\n\n```text\ndestroy_auth_key#d1435160 = DestroyAuthKeyRes;\n```\n" ] pub struct DestroyAuthKey ; impl :: BoxedSerialize for DestroyAuthKey { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xd1435160 ) , self ) } } impl :: Function for DestroyAuthKey { type Reply = :: mtproto :: DestroyAuthKeyRes ; } impl :: BareSerialize for DestroyAuthKey { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `destroy_session`\n\n```text\ndestroy_session#e7512126 session_id:long = DestroySessionRes;\n```\n" ] pub struct DestroySession { pub session_id : :: mtproto :: long , } impl :: BoxedSerialize for DestroySession { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xe7512126 ) , self ) } } impl :: Function for DestroySession { type Reply = :: mtproto :: DestroySessionRes ; } impl :: BareSerialize for DestroySession { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & DestroySession { ref session_id } = self ; _ser . write_bare :: < :: mtproto :: long > ( session_id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `get_future_salts`\n\n```text\nget_future_salts#b921bd04 num:int = FutureSalts;\n```\n" ] pub struct GetFutureSalts { pub num : :: mtproto :: int , } impl :: BoxedSerialize for GetFutureSalts { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xb921bd04 ) , self ) } } impl :: Function for GetFutureSalts { type Reply = :: mtproto :: FutureSalts ; } impl :: BareSerialize for GetFutureSalts { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetFutureSalts { ref num } = self ; _ser . write_bare :: < :: mtproto :: int > ( num ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `initConnection`\n\n```text\ninitConnection#c7481da6 {X:Type} api_id:int device_model:string system_version:string app_version:string system_lang_code:string lang_pack:string lang_code:string query:!X = X;\n```\n" ] pub struct InitConnection < X > { pub api_id : :: mtproto :: int , pub device_model : :: mtproto :: string , pub system_version : :: mtproto :: string , pub app_version : :: mtproto :: string , pub system_lang_code : :: mtproto :: string , pub lang_pack : :: mtproto :: string , pub lang_code : :: mtproto :: string , pub query : X , } impl < X : :: AnyBoxedSerialize > :: BoxedSerialize for InitConnection < X > { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xc7481da6 ) , self ) } } impl < X : :: Function > :: Function for InitConnection < X > { type Reply = X :: Reply ; } impl < X : :: AnyBoxedSerialize > :: BareSerialize for InitConnection < X > { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & InitConnection { ref api_id , ref device_model , ref system_version , ref app_version , ref system_lang_code , ref lang_pack , ref lang_code , ref query } = self ; _ser . write_bare :: < :: mtproto :: int > ( api_id ) ? ; _ser . write_bare :: < :: mtproto :: string > ( device_model ) ? ; _ser . write_bare :: < :: mtproto :: string > ( system_version ) ? ; _ser . write_bare :: < :: mtproto :: string > ( app_version ) ? ; _ser . write_bare :: < :: mtproto :: string > ( system_lang_code ) ? ; _ser . write_bare :: < :: mtproto :: string > ( lang_pack ) ? ; _ser . write_bare :: < :: mtproto :: string > ( lang_code ) ? ; _ser . write_boxed :: < X > ( query ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `invokeAfterMsg`\n\n```text\ninvokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X;\n```\n" ] pub struct InvokeAfterMsg < X > { pub msg_id : :: mtproto :: long , pub query : X , } impl < X : :: AnyBoxedSerialize > :: BoxedSerialize for InvokeAfterMsg < X > { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xcb9f372d ) , self ) } } impl < X : :: Function > :: Function for InvokeAfterMsg < X > { type Reply = X :: Reply ; } impl < X : :: AnyBoxedSerialize > :: BareSerialize for InvokeAfterMsg < X > { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & InvokeAfterMsg { ref msg_id , ref query } = self ; _ser . write_bare :: < :: mtproto :: long > ( msg_id ) ? ; _ser . write_boxed :: < X > ( query ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `invokeAfterMsgs`\n\n```text\ninvokeAfterMsgs#3dc4b4f0 {X:Type} msg_ids:Vector<long> query:!X = X;\n```\n" ] pub struct InvokeAfterMsgs < X > { pub msg_ids : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > , pub query : X , } impl < X : :: AnyBoxedSerialize > :: BoxedSerialize for InvokeAfterMsgs < X > { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x3dc4b4f0 ) , self ) } } impl < X : :: Function > :: Function for InvokeAfterMsgs < X > { type Reply = X :: Reply ; } impl < X : :: AnyBoxedSerialize > :: BareSerialize for InvokeAfterMsgs < X > { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & InvokeAfterMsgs { ref msg_ids , ref query } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > > ( msg_ids ) ? ; _ser . write_boxed :: < X > ( query ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `invokeWithLayer`\n\n```text\ninvokeWithLayer#da9b0d0d {X:Type} layer:int query:!X = X;\n```\n" ] pub struct InvokeWithLayer < X > { pub layer : :: mtproto :: int , pub query : X , } impl < X : :: AnyBoxedSerialize > :: BoxedSerialize for InvokeWithLayer < X > { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xda9b0d0d ) , self ) } } impl < X : :: Function > :: Function for InvokeWithLayer < X > { type Reply = X :: Reply ; } impl < X : :: AnyBoxedSerialize > :: BareSerialize for InvokeWithLayer < X > { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & InvokeWithLayer { ref layer , ref query } = self ; _ser . write_bare :: < :: mtproto :: int > ( layer ) ? ; _ser . write_boxed :: < X > ( query ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `invokeWithoutUpdates`\n\n```text\ninvokeWithoutUpdates#bf9459b7 {X:Type} query:!X = X;\n```\n" ] pub struct InvokeWithoutUpdates < X > { pub query : X , } impl < X : :: AnyBoxedSerialize > :: BoxedSerialize for InvokeWithoutUpdates < X > { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xbf9459b7 ) , self ) } } impl < X : :: Function > :: Function for InvokeWithoutUpdates < X > { type Reply = X :: Reply ; } impl < X : :: AnyBoxedSerialize > :: BareSerialize for InvokeWithoutUpdates < X > { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & InvokeWithoutUpdates { ref query } = self ; _ser . write_boxed :: < X > ( query ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `ping`\n\n```text\nping#7abe77ec ping_id:long = Pong;\n```\n" ] pub struct Ping { pub ping_id : :: mtproto :: long , } impl :: BoxedSerialize for Ping { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x7abe77ec ) , self ) } } impl :: Function for Ping { type Reply = :: mtproto :: Pong ; } impl :: BareSerialize for Ping { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Ping { ref ping_id } = self ; _ser . write_bare :: < :: mtproto :: long > ( ping_id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `ping_delay_disconnect`\n\n```text\nping_delay_disconnect#f3427b8c ping_id:long disconnect_delay:int = Pong;\n```\n" ] pub struct PingDelayDisconnect { pub ping_id : :: mtproto :: long , pub disconnect_delay : :: mtproto :: int , } impl :: BoxedSerialize for PingDelayDisconnect { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xf3427b8c ) , self ) } } impl :: Function for PingDelayDisconnect { type Reply = :: mtproto :: Pong ; } impl :: BareSerialize for PingDelayDisconnect { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & PingDelayDisconnect { ref ping_id , ref disconnect_delay } = self ; _ser . write_bare :: < :: mtproto :: long > ( ping_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( disconnect_delay ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `req_DH_params`\n\n```text\nreq_DH_params#d712e4be nonce:int128 server_nonce:int128 p:string q:string public_key_fingerprint:long encrypted_data:string = Server_DH_Params;\n```\n" ] pub struct ReqDHParams { pub nonce : :: mtproto :: int128 , pub server_nonce : :: mtproto :: int128 , pub p : :: mtproto :: bytes , pub q : :: mtproto :: bytes , pub public_key_fingerprint : :: mtproto :: long , pub encrypted_data : :: mtproto :: bytes , } impl :: BoxedSerialize for ReqDHParams { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xd712e4be ) , self ) } } impl :: Function for ReqDHParams { type Reply = :: mtproto :: ServerDHParams ; } impl :: BareSerialize for ReqDHParams { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ReqDHParams { ref nonce , ref server_nonce , ref p , ref q , ref public_key_fingerprint , ref encrypted_data } = self ; _ser . write_bare :: < :: mtproto :: int128 > ( nonce ) ? ; _ser . write_bare :: < :: mtproto :: int128 > ( server_nonce ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( p ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( q ) ? ; _ser . write_bare :: < :: mtproto :: long > ( public_key_fingerprint ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( encrypted_data ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `req_pq`\n\n```text\nreq_pq#60469778 nonce:int128 = ResPQ;\n```\n" ] pub struct ReqPq { pub nonce : :: mtproto :: int128 , } impl :: BoxedSerialize for ReqPq { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x60469778 ) , self ) } } impl :: Function for ReqPq { type Reply = :: mtproto :: ResPQ ; } impl :: BareSerialize for ReqPq { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ReqPq { ref nonce } = self ; _ser . write_bare :: < :: mtproto :: int128 > ( nonce ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `rpc_drop_answer`\n\n```text\nrpc_drop_answer#58e4a740 req_msg_id:long = RpcDropAnswer;\n```\n" ] pub struct RpcDropAnswer { pub req_msg_id : :: mtproto :: long , } impl :: BoxedSerialize for RpcDropAnswer { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x58e4a740 ) , self ) } } impl :: Function for RpcDropAnswer { type Reply = :: mtproto :: RpcDropAnswer ; } impl :: BareSerialize for RpcDropAnswer { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & RpcDropAnswer { ref req_msg_id } = self ; _ser . write_bare :: < :: mtproto :: long > ( req_msg_id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `set_client_DH_params`\n\n```text\nset_client_DH_params#f5045f1f nonce:int128 server_nonce:int128 encrypted_data:string = Set_client_DH_params_answer;\n```\n" ] pub struct SetClientDHParams { pub nonce : :: mtproto :: int128 , pub server_nonce : :: mtproto :: int128 , pub encrypted_data : :: mtproto :: bytes , } impl :: BoxedSerialize for SetClientDHParams { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xf5045f1f ) , self ) } } impl :: Function for SetClientDHParams { type Reply = :: mtproto :: SetClientDHParamsAnswer ; } impl :: BareSerialize for SetClientDHParams { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & SetClientDHParams { ref nonce , ref server_nonce , ref encrypted_data } = self ; _ser . write_bare :: < :: mtproto :: int128 > ( nonce ) ? ; _ser . write_bare :: < :: mtproto :: int128 > ( server_nonce ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( encrypted_data ) ? ; Ok ( ( ) ) } } pub mod account { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `account.changePhone`\n\n```text\naccount.changePhone#70c32edb phone_number:string phone_code_hash:string phone_code:string = User;\n```\n" ] pub struct ChangePhone { pub phone_number : :: mtproto :: string , pub phone_code_hash : :: mtproto :: string , pub phone_code : :: mtproto :: string , } impl :: BoxedSerialize for ChangePhone { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x70c32edb ) , self ) } } impl :: Function for ChangePhone { type Reply = :: mtproto :: User ; } impl :: BareSerialize for ChangePhone { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChangePhone { ref phone_number , ref phone_code_hash , ref phone_code } = self ; _ser . write_bare :: < :: mtproto :: string > ( phone_number ) ? ; _ser . write_bare :: < :: mtproto :: string > ( phone_code_hash ) ? ; _ser . write_bare :: < :: mtproto :: string > ( phone_code ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `account.checkUsername`\n\n```text\naccount.checkUsername#2714d86c username:string = Bool;\n```\n" ] pub struct CheckUsername { pub username : :: mtproto :: string , } impl :: BoxedSerialize for CheckUsername { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x2714d86c ) , self ) } } impl :: Function for CheckUsername { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for CheckUsername { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & CheckUsername { ref username } = self ; _ser . write_bare :: < :: mtproto :: string > ( username ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `account.confirmPhone`\n\n```text\naccount.confirmPhone#5f2178c3 phone_code_hash:string phone_code:string = Bool;\n```\n" ] pub struct ConfirmPhone { pub phone_code_hash : :: mtproto :: string , pub phone_code : :: mtproto :: string , } impl :: BoxedSerialize for ConfirmPhone { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x5f2178c3 ) , self ) } } impl :: Function for ConfirmPhone { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for ConfirmPhone { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ConfirmPhone { ref phone_code_hash , ref phone_code } = self ; _ser . write_bare :: < :: mtproto :: string > ( phone_code_hash ) ? ; _ser . write_bare :: < :: mtproto :: string > ( phone_code ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `account.deleteAccount`\n\n```text\naccount.deleteAccount#418d4e0b reason:string = Bool;\n```\n" ] pub struct DeleteAccount { pub reason : :: mtproto :: string , } impl :: BoxedSerialize for DeleteAccount { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x418d4e0b ) , self ) } } impl :: Function for DeleteAccount { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for DeleteAccount { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & DeleteAccount { ref reason } = self ; _ser . write_bare :: < :: mtproto :: string > ( reason ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `account.getAccountTTL`\n\n```text\naccount.getAccountTTL#8fc711d = AccountDaysTTL;\n```\n" ] pub struct GetAccountTTL ; impl :: BoxedSerialize for GetAccountTTL { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x08fc711d ) , self ) } } impl :: Function for GetAccountTTL { type Reply = :: mtproto :: AccountDaysTTL ; } impl :: BareSerialize for GetAccountTTL { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `account.getAuthorizations`\n\n```text\naccount.getAuthorizations#e320c158 = account.Authorizations;\n```\n" ] pub struct GetAuthorizations ; impl :: BoxedSerialize for GetAuthorizations { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xe320c158 ) , self ) } } impl :: Function for GetAuthorizations { type Reply = :: mtproto :: account :: Authorizations ; } impl :: BareSerialize for GetAuthorizations { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `account.getNotifySettings`\n\n```text\naccount.getNotifySettings#12b3ad31 peer:InputNotifyPeer = PeerNotifySettings;\n```\n" ] pub struct GetNotifySettings { pub peer : :: mtproto :: InputNotifyPeer , } impl :: BoxedSerialize for GetNotifySettings { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x12b3ad31 ) , self ) } } impl :: Function for GetNotifySettings { type Reply = :: mtproto :: PeerNotifySettings ; } impl :: BareSerialize for GetNotifySettings { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetNotifySettings { ref peer } = self ; _ser . write_boxed :: < :: mtproto :: InputNotifyPeer > ( peer ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `account.getPassword`\n\n```text\naccount.getPassword#548a30f5 = account.Password;\n```\n" ] pub struct GetPassword ; impl :: BoxedSerialize for GetPassword { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x548a30f5 ) , self ) } } impl :: Function for GetPassword { type Reply = :: mtproto :: account :: Password ; } impl :: BareSerialize for GetPassword { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `account.getPasswordSettings`\n\n```text\naccount.getPasswordSettings#bc8d11bb current_password_hash:bytes = account.PasswordSettings;\n```\n" ] pub struct GetPasswordSettings { pub current_password_hash : :: mtproto :: bytes , } impl :: BoxedSerialize for GetPasswordSettings { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xbc8d11bb ) , self ) } } impl :: Function for GetPasswordSettings { type Reply = :: mtproto :: account :: PasswordSettings ; } impl :: BareSerialize for GetPasswordSettings { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetPasswordSettings { ref current_password_hash } = self ; _ser . write_bare :: < :: mtproto :: bytes > ( current_password_hash ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `account.getPrivacy`\n\n```text\naccount.getPrivacy#dadbc950 key:InputPrivacyKey = account.PrivacyRules;\n```\n" ] pub struct GetPrivacy { pub key : :: mtproto :: InputPrivacyKey , } impl :: BoxedSerialize for GetPrivacy { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xdadbc950 ) , self ) } } impl :: Function for GetPrivacy { type Reply = :: mtproto :: account :: PrivacyRules ; } impl :: BareSerialize for GetPrivacy { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetPrivacy { ref key } = self ; _ser . write_boxed :: < :: mtproto :: InputPrivacyKey > ( key ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `account.getTmpPassword`\n\n```text\naccount.getTmpPassword#4a82327e password_hash:bytes period:int = account.TmpPassword;\n```\n" ] pub struct GetTmpPassword { pub password_hash : :: mtproto :: bytes , pub period : :: mtproto :: int , } impl :: BoxedSerialize for GetTmpPassword { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x4a82327e ) , self ) } } impl :: Function for GetTmpPassword { type Reply = :: mtproto :: account :: TmpPassword ; } impl :: BareSerialize for GetTmpPassword { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetTmpPassword { ref password_hash , ref period } = self ; _ser . write_bare :: < :: mtproto :: bytes > ( password_hash ) ? ; _ser . write_bare :: < :: mtproto :: int > ( period ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `account.getWallPapers`\n\n```text\naccount.getWallPapers#c04cfac2 = Vector<WallPaper>;\n```\n" ] pub struct GetWallPapers ; impl :: BoxedSerialize for GetWallPapers { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xc04cfac2 ) , self ) } } impl :: Function for GetWallPapers { type Reply = :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: WallPaper > ; } impl :: BareSerialize for GetWallPapers { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `account.registerDevice`\n\n```text\naccount.registerDevice#637ea878 token_type:int token:string = Bool;\n```\n" ] pub struct RegisterDevice { pub token_type : :: mtproto :: int , pub token : :: mtproto :: string , } impl :: BoxedSerialize for RegisterDevice { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x637ea878 ) , self ) } } impl :: Function for RegisterDevice { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for RegisterDevice { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & RegisterDevice { ref token_type , ref token } = self ; _ser . write_bare :: < :: mtproto :: int > ( token_type ) ? ; _ser . write_bare :: < :: mtproto :: string > ( token ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `account.reportPeer`\n\n```text\naccount.reportPeer#ae189d5f peer:InputPeer reason:ReportReason = Bool;\n```\n" ] pub struct ReportPeer { pub peer : :: mtproto :: InputPeer , pub reason : :: mtproto :: ReportReason , } impl :: BoxedSerialize for ReportPeer { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xae189d5f ) , self ) } } impl :: Function for ReportPeer { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for ReportPeer { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ReportPeer { ref peer , ref reason } = self ; _ser . write_boxed :: < :: mtproto :: InputPeer > ( peer ) ? ; _ser . write_boxed :: < :: mtproto :: ReportReason > ( reason ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `account.resetAuthorization`\n\n```text\naccount.resetAuthorization#df77f3bc hash:long = Bool;\n```\n" ] pub struct ResetAuthorization { pub hash : :: mtproto :: long , } impl :: BoxedSerialize for ResetAuthorization { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xdf77f3bc ) , self ) } } impl :: Function for ResetAuthorization { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for ResetAuthorization { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ResetAuthorization { ref hash } = self ; _ser . write_bare :: < :: mtproto :: long > ( hash ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `account.resetNotifySettings`\n\n```text\naccount.resetNotifySettings#db7e1747 = Bool;\n```\n" ] pub struct ResetNotifySettings ; impl :: BoxedSerialize for ResetNotifySettings { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xdb7e1747 ) , self ) } } impl :: Function for ResetNotifySettings { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for ResetNotifySettings { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `account.sendChangePhoneCode`\n\n```text\naccount.sendChangePhoneCode#8e57deb flags:# allow_flashcall:flags.0?true phone_number:string current_number:flags.0?Bool = auth.SentCode;\n```\n" ] pub struct SendChangePhoneCode { pub allow_flashcall : bool , pub phone_number : :: mtproto :: string , pub current_number : Option < :: mtproto :: Bool > , } impl :: BoxedSerialize for SendChangePhoneCode { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x08e57deb ) , self ) } } impl :: Function for SendChangePhoneCode { type Reply = :: mtproto :: auth :: SentCode ; } impl :: BareSerialize for SendChangePhoneCode { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & SendChangePhoneCode { allow_flashcall , ref phone_number , ref current_number } = self ; let mut _flags = 0i32 ; if allow_flashcall { _flags |= 1 << 0u32 ; } if current_number . is_some ( ) { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: string > ( phone_number ) ? ; if let & Some ( ref inner ) = current_number { _ser . write_boxed :: < :: mtproto :: Bool > ( inner ) ? ; } Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `account.sendConfirmPhoneCode`\n\n```text\naccount.sendConfirmPhoneCode#1516d7bd flags:# allow_flashcall:flags.0?true hash:string current_number:flags.0?Bool = auth.SentCode;\n```\n" ] pub struct SendConfirmPhoneCode { pub allow_flashcall : bool , pub hash : :: mtproto :: string , pub current_number : Option < :: mtproto :: Bool > , } impl :: BoxedSerialize for SendConfirmPhoneCode { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x1516d7bd ) , self ) } } impl :: Function for SendConfirmPhoneCode { type Reply = :: mtproto :: auth :: SentCode ; } impl :: BareSerialize for SendConfirmPhoneCode { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & SendConfirmPhoneCode { allow_flashcall , ref hash , ref current_number } = self ; let mut _flags = 0i32 ; if allow_flashcall { _flags |= 1 << 0u32 ; } if current_number . is_some ( ) { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: string > ( hash ) ? ; if let & Some ( ref inner ) = current_number { _ser . write_boxed :: < :: mtproto :: Bool > ( inner ) ? ; } Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `account.setAccountTTL`\n\n```text\naccount.setAccountTTL#2442485e ttl:AccountDaysTTL = Bool;\n```\n" ] pub struct SetAccountTTL { pub ttl : :: mtproto :: AccountDaysTTL , } impl :: BoxedSerialize for SetAccountTTL { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x2442485e ) , self ) } } impl :: Function for SetAccountTTL { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for SetAccountTTL { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & SetAccountTTL { ref ttl } = self ; _ser . write_boxed :: < :: mtproto :: AccountDaysTTL > ( ttl ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `account.setPrivacy`\n\n```text\naccount.setPrivacy#c9f81ce8 key:InputPrivacyKey rules:Vector<InputPrivacyRule> = account.PrivacyRules;\n```\n" ] pub struct SetPrivacy { pub key : :: mtproto :: InputPrivacyKey , pub rules : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputPrivacyRule > , } impl :: BoxedSerialize for SetPrivacy { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xc9f81ce8 ) , self ) } } impl :: Function for SetPrivacy { type Reply = :: mtproto :: account :: PrivacyRules ; } impl :: BareSerialize for SetPrivacy { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & SetPrivacy { ref key , ref rules } = self ; _ser . write_boxed :: < :: mtproto :: InputPrivacyKey > ( key ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputPrivacyRule > > ( rules ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `account.unregisterDevice`\n\n```text\naccount.unregisterDevice#65c55b40 token_type:int token:string = Bool;\n```\n" ] pub struct UnregisterDevice { pub token_type : :: mtproto :: int , pub token : :: mtproto :: string , } impl :: BoxedSerialize for UnregisterDevice { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x65c55b40 ) , self ) } } impl :: Function for UnregisterDevice { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for UnregisterDevice { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & UnregisterDevice { ref token_type , ref token } = self ; _ser . write_bare :: < :: mtproto :: int > ( token_type ) ? ; _ser . write_bare :: < :: mtproto :: string > ( token ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `account.updateDeviceLocked`\n\n```text\naccount.updateDeviceLocked#38df3532 period:int = Bool;\n```\n" ] pub struct UpdateDeviceLocked { pub period : :: mtproto :: int , } impl :: BoxedSerialize for UpdateDeviceLocked { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x38df3532 ) , self ) } } impl :: Function for UpdateDeviceLocked { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for UpdateDeviceLocked { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & UpdateDeviceLocked { ref period } = self ; _ser . write_bare :: < :: mtproto :: int > ( period ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `account.updateNotifySettings`\n\n```text\naccount.updateNotifySettings#84be5b93 peer:InputNotifyPeer settings:InputPeerNotifySettings = Bool;\n```\n" ] pub struct UpdateNotifySettings { pub peer : :: mtproto :: InputNotifyPeer , pub settings : :: mtproto :: InputPeerNotifySettings , } impl :: BoxedSerialize for UpdateNotifySettings { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x84be5b93 ) , self ) } } impl :: Function for UpdateNotifySettings { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for UpdateNotifySettings { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & UpdateNotifySettings { ref peer , ref settings } = self ; _ser . write_boxed :: < :: mtproto :: InputNotifyPeer > ( peer ) ? ; _ser . write_boxed :: < :: mtproto :: InputPeerNotifySettings > ( settings ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `account.updatePasswordSettings`\n\n```text\naccount.updatePasswordSettings#fa7c4b86 current_password_hash:bytes new_settings:account.PasswordInputSettings = Bool;\n```\n" ] pub struct UpdatePasswordSettings { pub current_password_hash : :: mtproto :: bytes , pub new_settings : :: mtproto :: account :: PasswordInputSettings , } impl :: BoxedSerialize for UpdatePasswordSettings { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xfa7c4b86 ) , self ) } } impl :: Function for UpdatePasswordSettings { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for UpdatePasswordSettings { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & UpdatePasswordSettings { ref current_password_hash , ref new_settings } = self ; _ser . write_bare :: < :: mtproto :: bytes > ( current_password_hash ) ? ; _ser . write_boxed :: < :: mtproto :: account :: PasswordInputSettings > ( new_settings ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `account.updateProfile`\n\n```text\naccount.updateProfile#78515775 flags:# first_name:flags.0?string last_name:flags.1?string about:flags.2?string = User;\n```\n" ] pub struct UpdateProfile { pub first_name : Option < :: mtproto :: string > , pub last_name : Option < :: mtproto :: string > , pub about : Option < :: mtproto :: string > , } impl :: BoxedSerialize for UpdateProfile { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x78515775 ) , self ) } } impl :: Function for UpdateProfile { type Reply = :: mtproto :: User ; } impl :: BareSerialize for UpdateProfile { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & UpdateProfile { ref first_name , ref last_name , ref about } = self ; let mut _flags = 0i32 ; if first_name . is_some ( ) { _flags |= 1 << 0u32 ; } if last_name . is_some ( ) { _flags |= 1 << 1u32 ; } if about . is_some ( ) { _flags |= 1 << 2u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; if let & Some ( ref inner ) = first_name { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = last_name { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = about { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `account.updateStatus`\n\n```text\naccount.updateStatus#6628562c offline:Bool = Bool;\n```\n" ] pub struct UpdateStatus { pub offline : :: mtproto :: Bool , } impl :: BoxedSerialize for UpdateStatus { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x6628562c ) , self ) } } impl :: Function for UpdateStatus { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for UpdateStatus { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & UpdateStatus { ref offline } = self ; _ser . write_boxed :: < :: mtproto :: Bool > ( offline ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `account.updateUsername`\n\n```text\naccount.updateUsername#3e0bdd7c username:string = User;\n```\n" ] pub struct UpdateUsername { pub username : :: mtproto :: string , } impl :: BoxedSerialize for UpdateUsername { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x3e0bdd7c ) , self ) } } impl :: Function for UpdateUsername { type Reply = :: mtproto :: User ; } impl :: BareSerialize for UpdateUsername { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & UpdateUsername { ref username } = self ; _ser . write_bare :: < :: mtproto :: string > ( username ) ? ; Ok ( ( ) ) } } } pub mod auth { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `auth.bindTempAuthKey`\n\n```text\nauth.bindTempAuthKey#cdd42a05 perm_auth_key_id:long nonce:long expires_at:int encrypted_message:bytes = Bool;\n```\n" ] pub struct BindTempAuthKey { pub perm_auth_key_id : :: mtproto :: long , pub nonce : :: mtproto :: long , pub expires_at : :: mtproto :: int , pub encrypted_message : :: mtproto :: bytes , } impl :: BoxedSerialize for BindTempAuthKey { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xcdd42a05 ) , self ) } } impl :: Function for BindTempAuthKey { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for BindTempAuthKey { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & BindTempAuthKey { ref perm_auth_key_id , ref nonce , ref expires_at , ref encrypted_message } = self ; _ser . write_bare :: < :: mtproto :: long > ( perm_auth_key_id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( nonce ) ? ; _ser . write_bare :: < :: mtproto :: int > ( expires_at ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( encrypted_message ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `auth.cancelCode`\n\n```text\nauth.cancelCode#1f040578 phone_number:string phone_code_hash:string = Bool;\n```\n" ] pub struct CancelCode { pub phone_number : :: mtproto :: string , pub phone_code_hash : :: mtproto :: string , } impl :: BoxedSerialize for CancelCode { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x1f040578 ) , self ) } } impl :: Function for CancelCode { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for CancelCode { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & CancelCode { ref phone_number , ref phone_code_hash } = self ; _ser . write_bare :: < :: mtproto :: string > ( phone_number ) ? ; _ser . write_bare :: < :: mtproto :: string > ( phone_code_hash ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `auth.checkPassword`\n\n```text\nauth.checkPassword#a63011e password_hash:bytes = auth.Authorization;\n```\n" ] pub struct CheckPassword { pub password_hash : :: mtproto :: bytes , } impl :: BoxedSerialize for CheckPassword { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x0a63011e ) , self ) } } impl :: Function for CheckPassword { type Reply = :: mtproto :: auth :: Authorization ; } impl :: BareSerialize for CheckPassword { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & CheckPassword { ref password_hash } = self ; _ser . write_bare :: < :: mtproto :: bytes > ( password_hash ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `auth.checkPhone`\n\n```text\nauth.checkPhone#6fe51dfb phone_number:string = auth.CheckedPhone;\n```\n" ] pub struct CheckPhone { pub phone_number : :: mtproto :: string , } impl :: BoxedSerialize for CheckPhone { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x6fe51dfb ) , self ) } } impl :: Function for CheckPhone { type Reply = :: mtproto :: auth :: CheckedPhone ; } impl :: BareSerialize for CheckPhone { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & CheckPhone { ref phone_number } = self ; _ser . write_bare :: < :: mtproto :: string > ( phone_number ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `auth.dropTempAuthKeys`\n\n```text\nauth.dropTempAuthKeys#8e48a188 except_auth_keys:Vector<long> = Bool;\n```\n" ] pub struct DropTempAuthKeys { pub except_auth_keys : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > , } impl :: BoxedSerialize for DropTempAuthKeys { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x8e48a188 ) , self ) } } impl :: Function for DropTempAuthKeys { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for DropTempAuthKeys { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & DropTempAuthKeys { ref except_auth_keys } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > > ( except_auth_keys ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `auth.exportAuthorization`\n\n```text\nauth.exportAuthorization#e5bfffcd dc_id:int = auth.ExportedAuthorization;\n```\n" ] pub struct ExportAuthorization { pub dc_id : :: mtproto :: int , } impl :: BoxedSerialize for ExportAuthorization { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xe5bfffcd ) , self ) } } impl :: Function for ExportAuthorization { type Reply = :: mtproto :: auth :: ExportedAuthorization ; } impl :: BareSerialize for ExportAuthorization { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ExportAuthorization { ref dc_id } = self ; _ser . write_bare :: < :: mtproto :: int > ( dc_id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `auth.importAuthorization`\n\n```text\nauth.importAuthorization#e3ef9613 id:int bytes:bytes = auth.Authorization;\n```\n" ] pub struct ImportAuthorization { pub id : :: mtproto :: int , pub bytes : :: mtproto :: bytes , } impl :: BoxedSerialize for ImportAuthorization { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xe3ef9613 ) , self ) } } impl :: Function for ImportAuthorization { type Reply = :: mtproto :: auth :: Authorization ; } impl :: BareSerialize for ImportAuthorization { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ImportAuthorization { ref id , bytes : ref bytes_ } = self ; _ser . write_bare :: < :: mtproto :: int > ( id ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( bytes_ ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `auth.importBotAuthorization`\n\n```text\nauth.importBotAuthorization#67a3ff2c flags:int api_id:int api_hash:string bot_auth_token:string = auth.Authorization;\n```\n" ] pub struct ImportBotAuthorization { pub flags : :: mtproto :: int , pub api_id : :: mtproto :: int , pub api_hash : :: mtproto :: string , pub bot_auth_token : :: mtproto :: string , } impl :: BoxedSerialize for ImportBotAuthorization { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x67a3ff2c ) , self ) } } impl :: Function for ImportBotAuthorization { type Reply = :: mtproto :: auth :: Authorization ; } impl :: BareSerialize for ImportBotAuthorization { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ImportBotAuthorization { ref flags , ref api_id , ref api_hash , ref bot_auth_token } = self ; _ser . write_bare :: < :: mtproto :: int > ( flags ) ? ; _ser . write_bare :: < :: mtproto :: int > ( api_id ) ? ; _ser . write_bare :: < :: mtproto :: string > ( api_hash ) ? ; _ser . write_bare :: < :: mtproto :: string > ( bot_auth_token ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `auth.logOut`\n\n```text\nauth.logOut#5717da40 = Bool;\n```\n" ] pub struct LogOut ; impl :: BoxedSerialize for LogOut { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x5717da40 ) , self ) } } impl :: Function for LogOut { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for LogOut { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `auth.recoverPassword`\n\n```text\nauth.recoverPassword#4ea56e92 code:string = auth.Authorization;\n```\n" ] pub struct RecoverPassword { pub code : :: mtproto :: string , } impl :: BoxedSerialize for RecoverPassword { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x4ea56e92 ) , self ) } } impl :: Function for RecoverPassword { type Reply = :: mtproto :: auth :: Authorization ; } impl :: BareSerialize for RecoverPassword { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & RecoverPassword { ref code } = self ; _ser . write_bare :: < :: mtproto :: string > ( code ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `auth.requestPasswordRecovery`\n\n```text\nauth.requestPasswordRecovery#d897bc66 = auth.PasswordRecovery;\n```\n" ] pub struct RequestPasswordRecovery ; impl :: BoxedSerialize for RequestPasswordRecovery { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xd897bc66 ) , self ) } } impl :: Function for RequestPasswordRecovery { type Reply = :: mtproto :: auth :: PasswordRecovery ; } impl :: BareSerialize for RequestPasswordRecovery { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `auth.resendCode`\n\n```text\nauth.resendCode#3ef1a9bf phone_number:string phone_code_hash:string = auth.SentCode;\n```\n" ] pub struct ResendCode { pub phone_number : :: mtproto :: string , pub phone_code_hash : :: mtproto :: string , } impl :: BoxedSerialize for ResendCode { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x3ef1a9bf ) , self ) } } impl :: Function for ResendCode { type Reply = :: mtproto :: auth :: SentCode ; } impl :: BareSerialize for ResendCode { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ResendCode { ref phone_number , ref phone_code_hash } = self ; _ser . write_bare :: < :: mtproto :: string > ( phone_number ) ? ; _ser . write_bare :: < :: mtproto :: string > ( phone_code_hash ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `auth.resetAuthorizations`\n\n```text\nauth.resetAuthorizations#9fab0d1a = Bool;\n```\n" ] pub struct ResetAuthorizations ; impl :: BoxedSerialize for ResetAuthorizations { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x9fab0d1a ) , self ) } } impl :: Function for ResetAuthorizations { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for ResetAuthorizations { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `auth.sendCode`\n\n```text\nauth.sendCode#86aef0ec flags:# allow_flashcall:flags.0?true phone_number:string current_number:flags.0?Bool api_id:int api_hash:string = auth.SentCode;\n```\n" ] pub struct SendCode { pub allow_flashcall : bool , pub phone_number : :: mtproto :: string , pub current_number : Option < :: mtproto :: Bool > , pub api_id : :: mtproto :: int , pub api_hash : :: mtproto :: string , } impl :: BoxedSerialize for SendCode { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x86aef0ec ) , self ) } } impl :: Function for SendCode { type Reply = :: mtproto :: auth :: SentCode ; } impl :: BareSerialize for SendCode { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & SendCode { allow_flashcall , ref phone_number , ref current_number , ref api_id , ref api_hash } = self ; let mut _flags = 0i32 ; if allow_flashcall { _flags |= 1 << 0u32 ; } if current_number . is_some ( ) { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: string > ( phone_number ) ? ; if let & Some ( ref inner ) = current_number { _ser . write_boxed :: < :: mtproto :: Bool > ( inner ) ? ; } _ser . write_bare :: < :: mtproto :: int > ( api_id ) ? ; _ser . write_bare :: < :: mtproto :: string > ( api_hash ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `auth.sendInvites`\n\n```text\nauth.sendInvites#771c1d97 phone_numbers:Vector<string> message:string = Bool;\n```\n" ] pub struct SendInvites { pub phone_numbers : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: string > , pub message : :: mtproto :: string , } impl :: BoxedSerialize for SendInvites { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x771c1d97 ) , self ) } } impl :: Function for SendInvites { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for SendInvites { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & SendInvites { ref phone_numbers , ref message } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: string > > ( phone_numbers ) ? ; _ser . write_bare :: < :: mtproto :: string > ( message ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `auth.signIn`\n\n```text\nauth.signIn#bcd51581 phone_number:string phone_code_hash:string phone_code:string = auth.Authorization;\n```\n" ] pub struct SignIn { pub phone_number : :: mtproto :: string , pub phone_code_hash : :: mtproto :: string , pub phone_code : :: mtproto :: string , } impl :: BoxedSerialize for SignIn { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xbcd51581 ) , self ) } } impl :: Function for SignIn { type Reply = :: mtproto :: auth :: Authorization ; } impl :: BareSerialize for SignIn { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & SignIn { ref phone_number , ref phone_code_hash , ref phone_code } = self ; _ser . write_bare :: < :: mtproto :: string > ( phone_number ) ? ; _ser . write_bare :: < :: mtproto :: string > ( phone_code_hash ) ? ; _ser . write_bare :: < :: mtproto :: string > ( phone_code ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `auth.signUp`\n\n```text\nauth.signUp#1b067634 phone_number:string phone_code_hash:string phone_code:string first_name:string last_name:string = auth.Authorization;\n```\n" ] pub struct SignUp { pub phone_number : :: mtproto :: string , pub phone_code_hash : :: mtproto :: string , pub phone_code : :: mtproto :: string , pub first_name : :: mtproto :: string , pub last_name : :: mtproto :: string , } impl :: BoxedSerialize for SignUp { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x1b067634 ) , self ) } } impl :: Function for SignUp { type Reply = :: mtproto :: auth :: Authorization ; } impl :: BareSerialize for SignUp { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & SignUp { ref phone_number , ref phone_code_hash , ref phone_code , ref first_name , ref last_name } = self ; _ser . write_bare :: < :: mtproto :: string > ( phone_number ) ? ; _ser . write_bare :: < :: mtproto :: string > ( phone_code_hash ) ? ; _ser . write_bare :: < :: mtproto :: string > ( phone_code ) ? ; _ser . write_bare :: < :: mtproto :: string > ( first_name ) ? ; _ser . write_bare :: < :: mtproto :: string > ( last_name ) ? ; Ok ( ( ) ) } } } pub mod bots { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `bots.answerWebhookJSONQuery`\n\n```text\nbots.answerWebhookJSONQuery#e6213f4d query_id:long data:DataJSON = Bool;\n```\n" ] pub struct AnswerWebhookJSONQuery { pub query_id : :: mtproto :: long , pub data : :: mtproto :: DataJSON , } impl :: BoxedSerialize for AnswerWebhookJSONQuery { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xe6213f4d ) , self ) } } impl :: Function for AnswerWebhookJSONQuery { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for AnswerWebhookJSONQuery { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & AnswerWebhookJSONQuery { ref query_id , ref data } = self ; _ser . write_bare :: < :: mtproto :: long > ( query_id ) ? ; _ser . write_boxed :: < :: mtproto :: DataJSON > ( data ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `bots.sendCustomRequest`\n\n```text\nbots.sendCustomRequest#aa2769ed custom_method:string params:DataJSON = DataJSON;\n```\n" ] pub struct SendCustomRequest { pub custom_method : :: mtproto :: string , pub params : :: mtproto :: DataJSON , } impl :: BoxedSerialize for SendCustomRequest { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xaa2769ed ) , self ) } } impl :: Function for SendCustomRequest { type Reply = :: mtproto :: DataJSON ; } impl :: BareSerialize for SendCustomRequest { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & SendCustomRequest { ref custom_method , ref params } = self ; _ser . write_bare :: < :: mtproto :: string > ( custom_method ) ? ; _ser . write_boxed :: < :: mtproto :: DataJSON > ( params ) ? ; Ok ( ( ) ) } } } pub mod channels { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channels.checkUsername`\n\n```text\nchannels.checkUsername#10e6bd2c channel:InputChannel username:string = Bool;\n```\n" ] pub struct CheckUsername { pub channel : :: mtproto :: InputChannel , pub username : :: mtproto :: string , } impl :: BoxedSerialize for CheckUsername { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x10e6bd2c ) , self ) } } impl :: Function for CheckUsername { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for CheckUsername { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & CheckUsername { ref channel , ref username } = self ; _ser . write_boxed :: < :: mtproto :: InputChannel > ( channel ) ? ; _ser . write_bare :: < :: mtproto :: string > ( username ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channels.createChannel`\n\n```text\nchannels.createChannel#f4893d7f flags:# broadcast:flags.0?true megagroup:flags.1?true title:string about:string = Updates;\n```\n" ] pub struct CreateChannel { pub broadcast : bool , pub megagroup : bool , pub title : :: mtproto :: string , pub about : :: mtproto :: string , } impl :: BoxedSerialize for CreateChannel { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xf4893d7f ) , self ) } } impl :: Function for CreateChannel { type Reply = :: mtproto :: Updates ; } impl :: BareSerialize for CreateChannel { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & CreateChannel { broadcast , megagroup , ref title , ref about } = self ; let mut _flags = 0i32 ; if broadcast { _flags |= 1 << 0u32 ; } if megagroup { _flags |= 1 << 1u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: string > ( title ) ? ; _ser . write_bare :: < :: mtproto :: string > ( about ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channels.deleteChannel`\n\n```text\nchannels.deleteChannel#c0111fe3 channel:InputChannel = Updates;\n```\n" ] pub struct DeleteChannel { pub channel : :: mtproto :: InputChannel , } impl :: BoxedSerialize for DeleteChannel { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xc0111fe3 ) , self ) } } impl :: Function for DeleteChannel { type Reply = :: mtproto :: Updates ; } impl :: BareSerialize for DeleteChannel { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & DeleteChannel { ref channel } = self ; _ser . write_boxed :: < :: mtproto :: InputChannel > ( channel ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channels.deleteHistory`\n\n```text\nchannels.deleteHistory#af369d42 channel:InputChannel max_id:int = Bool;\n```\n" ] pub struct DeleteHistory { pub channel : :: mtproto :: InputChannel , pub max_id : :: mtproto :: int , } impl :: BoxedSerialize for DeleteHistory { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xaf369d42 ) , self ) } } impl :: Function for DeleteHistory { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for DeleteHistory { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & DeleteHistory { ref channel , ref max_id } = self ; _ser . write_boxed :: < :: mtproto :: InputChannel > ( channel ) ? ; _ser . write_bare :: < :: mtproto :: int > ( max_id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channels.deleteMessages`\n\n```text\nchannels.deleteMessages#84c1fd4e channel:InputChannel id:Vector<int> = messages.AffectedMessages;\n```\n" ] pub struct DeleteMessages { pub channel : :: mtproto :: InputChannel , pub id : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > , } impl :: BoxedSerialize for DeleteMessages { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x84c1fd4e ) , self ) } } impl :: Function for DeleteMessages { type Reply = :: mtproto :: messages :: AffectedMessages ; } impl :: BareSerialize for DeleteMessages { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & DeleteMessages { ref channel , ref id } = self ; _ser . write_boxed :: < :: mtproto :: InputChannel > ( channel ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > > ( id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channels.deleteUserHistory`\n\n```text\nchannels.deleteUserHistory#d10dd71b channel:InputChannel user_id:InputUser = messages.AffectedHistory;\n```\n" ] pub struct DeleteUserHistory { pub channel : :: mtproto :: InputChannel , pub user_id : :: mtproto :: InputUser , } impl :: BoxedSerialize for DeleteUserHistory { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xd10dd71b ) , self ) } } impl :: Function for DeleteUserHistory { type Reply = :: mtproto :: messages :: AffectedHistory ; } impl :: BareSerialize for DeleteUserHistory { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & DeleteUserHistory { ref channel , ref user_id } = self ; _ser . write_boxed :: < :: mtproto :: InputChannel > ( channel ) ? ; _ser . write_boxed :: < :: mtproto :: InputUser > ( user_id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channels.editAbout`\n\n```text\nchannels.editAbout#13e27f1e channel:InputChannel about:string = Bool;\n```\n" ] pub struct EditAbout { pub channel : :: mtproto :: InputChannel , pub about : :: mtproto :: string , } impl :: BoxedSerialize for EditAbout { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x13e27f1e ) , self ) } } impl :: Function for EditAbout { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for EditAbout { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & EditAbout { ref channel , ref about } = self ; _ser . write_boxed :: < :: mtproto :: InputChannel > ( channel ) ? ; _ser . write_bare :: < :: mtproto :: string > ( about ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channels.editAdmin`\n\n```text\nchannels.editAdmin#20b88214 channel:InputChannel user_id:InputUser admin_rights:ChannelAdminRights = Updates;\n```\n" ] pub struct EditAdmin { pub channel : :: mtproto :: InputChannel , pub user_id : :: mtproto :: InputUser , pub admin_rights : :: mtproto :: ChannelAdminRights , } impl :: BoxedSerialize for EditAdmin { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x20b88214 ) , self ) } } impl :: Function for EditAdmin { type Reply = :: mtproto :: Updates ; } impl :: BareSerialize for EditAdmin { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & EditAdmin { ref channel , ref user_id , ref admin_rights } = self ; _ser . write_boxed :: < :: mtproto :: InputChannel > ( channel ) ? ; _ser . write_boxed :: < :: mtproto :: InputUser > ( user_id ) ? ; _ser . write_boxed :: < :: mtproto :: ChannelAdminRights > ( admin_rights ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channels.editBanned`\n\n```text\nchannels.editBanned#bfd915cd channel:InputChannel user_id:InputUser banned_rights:ChannelBannedRights = Updates;\n```\n" ] pub struct EditBanned { pub channel : :: mtproto :: InputChannel , pub user_id : :: mtproto :: InputUser , pub banned_rights : :: mtproto :: ChannelBannedRights , } impl :: BoxedSerialize for EditBanned { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xbfd915cd ) , self ) } } impl :: Function for EditBanned { type Reply = :: mtproto :: Updates ; } impl :: BareSerialize for EditBanned { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & EditBanned { ref channel , ref user_id , ref banned_rights } = self ; _ser . write_boxed :: < :: mtproto :: InputChannel > ( channel ) ? ; _ser . write_boxed :: < :: mtproto :: InputUser > ( user_id ) ? ; _ser . write_boxed :: < :: mtproto :: ChannelBannedRights > ( banned_rights ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channels.editPhoto`\n\n```text\nchannels.editPhoto#f12e57c9 channel:InputChannel photo:InputChatPhoto = Updates;\n```\n" ] pub struct EditPhoto { pub channel : :: mtproto :: InputChannel , pub photo : :: mtproto :: InputChatPhoto , } impl :: BoxedSerialize for EditPhoto { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xf12e57c9 ) , self ) } } impl :: Function for EditPhoto { type Reply = :: mtproto :: Updates ; } impl :: BareSerialize for EditPhoto { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & EditPhoto { ref channel , ref photo } = self ; _ser . write_boxed :: < :: mtproto :: InputChannel > ( channel ) ? ; _ser . write_boxed :: < :: mtproto :: InputChatPhoto > ( photo ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channels.editTitle`\n\n```text\nchannels.editTitle#566decd0 channel:InputChannel title:string = Updates;\n```\n" ] pub struct EditTitle { pub channel : :: mtproto :: InputChannel , pub title : :: mtproto :: string , } impl :: BoxedSerialize for EditTitle { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x566decd0 ) , self ) } } impl :: Function for EditTitle { type Reply = :: mtproto :: Updates ; } impl :: BareSerialize for EditTitle { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & EditTitle { ref channel , ref title } = self ; _ser . write_boxed :: < :: mtproto :: InputChannel > ( channel ) ? ; _ser . write_bare :: < :: mtproto :: string > ( title ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channels.exportInvite`\n\n```text\nchannels.exportInvite#c7560885 channel:InputChannel = ExportedChatInvite;\n```\n" ] pub struct ExportInvite { pub channel : :: mtproto :: InputChannel , } impl :: BoxedSerialize for ExportInvite { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xc7560885 ) , self ) } } impl :: Function for ExportInvite { type Reply = :: mtproto :: ExportedChatInvite ; } impl :: BareSerialize for ExportInvite { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ExportInvite { ref channel } = self ; _ser . write_boxed :: < :: mtproto :: InputChannel > ( channel ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channels.exportMessageLink`\n\n```text\nchannels.exportMessageLink#c846d22d channel:InputChannel id:int = ExportedMessageLink;\n```\n" ] pub struct ExportMessageLink { pub channel : :: mtproto :: InputChannel , pub id : :: mtproto :: int , } impl :: BoxedSerialize for ExportMessageLink { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xc846d22d ) , self ) } } impl :: Function for ExportMessageLink { type Reply = :: mtproto :: ExportedMessageLink ; } impl :: BareSerialize for ExportMessageLink { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ExportMessageLink { ref channel , ref id } = self ; _ser . write_boxed :: < :: mtproto :: InputChannel > ( channel ) ? ; _ser . write_bare :: < :: mtproto :: int > ( id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channels.getAdminLog`\n\n```text\nchannels.getAdminLog#33ddf480 flags:# channel:InputChannel q:string events_filter:flags.0?ChannelAdminLogEventsFilter admins:flags.1?Vector<InputUser> max_id:long min_id:long limit:int = channels.AdminLogResults;\n```\n" ] pub struct GetAdminLog { pub channel : :: mtproto :: InputChannel , pub q : :: mtproto :: string , pub events_filter : Option < :: mtproto :: ChannelAdminLogEventsFilter > , pub admins : Option < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputUser > > , pub max_id : :: mtproto :: long , pub min_id : :: mtproto :: long , pub limit : :: mtproto :: int , } impl :: BoxedSerialize for GetAdminLog { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x33ddf480 ) , self ) } } impl :: Function for GetAdminLog { type Reply = :: mtproto :: channels :: AdminLogResults ; } impl :: BareSerialize for GetAdminLog { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetAdminLog { ref channel , ref q , ref events_filter , ref admins , ref max_id , ref min_id , ref limit } = self ; let mut _flags = 0i32 ; if events_filter . is_some ( ) { _flags |= 1 << 0u32 ; } if admins . is_some ( ) { _flags |= 1 << 1u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_boxed :: < :: mtproto :: InputChannel > ( channel ) ? ; _ser . write_bare :: < :: mtproto :: string > ( q ) ? ; if let & Some ( ref inner ) = events_filter { _ser . write_boxed :: < :: mtproto :: ChannelAdminLogEventsFilter > ( inner ) ? ; } if let & Some ( ref inner ) = admins { _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputUser > > ( inner ) ? ; } _ser . write_bare :: < :: mtproto :: long > ( max_id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( min_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( limit ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channels.getAdminedPublicChannels`\n\n```text\nchannels.getAdminedPublicChannels#8d8d82d7 = messages.Chats;\n```\n" ] pub struct GetAdminedPublicChannels ; impl :: BoxedSerialize for GetAdminedPublicChannels { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x8d8d82d7 ) , self ) } } impl :: Function for GetAdminedPublicChannels { type Reply = :: mtproto :: messages :: Chats ; } impl :: BareSerialize for GetAdminedPublicChannels { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channels.getChannels`\n\n```text\nchannels.getChannels#a7f6bbb id:Vector<InputChannel> = messages.Chats;\n```\n" ] pub struct GetChannels { pub id : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputChannel > , } impl :: BoxedSerialize for GetChannels { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x0a7f6bbb ) , self ) } } impl :: Function for GetChannels { type Reply = :: mtproto :: messages :: Chats ; } impl :: BareSerialize for GetChannels { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetChannels { ref id } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputChannel > > ( id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channels.getFullChannel`\n\n```text\nchannels.getFullChannel#8736a09 channel:InputChannel = messages.ChatFull;\n```\n" ] pub struct GetFullChannel { pub channel : :: mtproto :: InputChannel , } impl :: BoxedSerialize for GetFullChannel { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x08736a09 ) , self ) } } impl :: Function for GetFullChannel { type Reply = :: mtproto :: messages :: ChatFull ; } impl :: BareSerialize for GetFullChannel { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetFullChannel { ref channel } = self ; _ser . write_boxed :: < :: mtproto :: InputChannel > ( channel ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channels.getMessages`\n\n```text\nchannels.getMessages#93d7b347 channel:InputChannel id:Vector<int> = messages.Messages;\n```\n" ] pub struct GetMessages { pub channel : :: mtproto :: InputChannel , pub id : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > , } impl :: BoxedSerialize for GetMessages { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x93d7b347 ) , self ) } } impl :: Function for GetMessages { type Reply = :: mtproto :: messages :: Messages ; } impl :: BareSerialize for GetMessages { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetMessages { ref channel , ref id } = self ; _ser . write_boxed :: < :: mtproto :: InputChannel > ( channel ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > > ( id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channels.getParticipant`\n\n```text\nchannels.getParticipant#546dd7a6 channel:InputChannel user_id:InputUser = channels.ChannelParticipant;\n```\n" ] pub struct GetParticipant { pub channel : :: mtproto :: InputChannel , pub user_id : :: mtproto :: InputUser , } impl :: BoxedSerialize for GetParticipant { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x546dd7a6 ) , self ) } } impl :: Function for GetParticipant { type Reply = :: mtproto :: channels :: ChannelParticipant ; } impl :: BareSerialize for GetParticipant { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetParticipant { ref channel , ref user_id } = self ; _ser . write_boxed :: < :: mtproto :: InputChannel > ( channel ) ? ; _ser . write_boxed :: < :: mtproto :: InputUser > ( user_id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channels.getParticipants`\n\n```text\nchannels.getParticipants#123e05e9 channel:InputChannel filter:ChannelParticipantsFilter offset:int limit:int hash:int = channels.ChannelParticipants;\n```\n" ] pub struct GetParticipants { pub channel : :: mtproto :: InputChannel , pub filter : :: mtproto :: ChannelParticipantsFilter , pub offset : :: mtproto :: int , pub limit : :: mtproto :: int , pub hash : :: mtproto :: int , } impl :: BoxedSerialize for GetParticipants { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x123e05e9 ) , self ) } } impl :: Function for GetParticipants { type Reply = :: mtproto :: channels :: ChannelParticipants ; } impl :: BareSerialize for GetParticipants { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetParticipants { ref channel , ref filter , ref offset , ref limit , ref hash } = self ; _ser . write_boxed :: < :: mtproto :: InputChannel > ( channel ) ? ; _ser . write_boxed :: < :: mtproto :: ChannelParticipantsFilter > ( filter ) ? ; _ser . write_bare :: < :: mtproto :: int > ( offset ) ? ; _ser . write_bare :: < :: mtproto :: int > ( limit ) ? ; _ser . write_bare :: < :: mtproto :: int > ( hash ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channels.inviteToChannel`\n\n```text\nchannels.inviteToChannel#199f3a6c channel:InputChannel users:Vector<InputUser> = Updates;\n```\n" ] pub struct InviteToChannel { pub channel : :: mtproto :: InputChannel , pub users : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputUser > , } impl :: BoxedSerialize for InviteToChannel { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x199f3a6c ) , self ) } } impl :: Function for InviteToChannel { type Reply = :: mtproto :: Updates ; } impl :: BareSerialize for InviteToChannel { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & InviteToChannel { ref channel , ref users } = self ; _ser . write_boxed :: < :: mtproto :: InputChannel > ( channel ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputUser > > ( users ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channels.joinChannel`\n\n```text\nchannels.joinChannel#24b524c5 channel:InputChannel = Updates;\n```\n" ] pub struct JoinChannel { pub channel : :: mtproto :: InputChannel , } impl :: BoxedSerialize for JoinChannel { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x24b524c5 ) , self ) } } impl :: Function for JoinChannel { type Reply = :: mtproto :: Updates ; } impl :: BareSerialize for JoinChannel { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & JoinChannel { ref channel } = self ; _ser . write_boxed :: < :: mtproto :: InputChannel > ( channel ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channels.leaveChannel`\n\n```text\nchannels.leaveChannel#f836aa95 channel:InputChannel = Updates;\n```\n" ] pub struct LeaveChannel { pub channel : :: mtproto :: InputChannel , } impl :: BoxedSerialize for LeaveChannel { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xf836aa95 ) , self ) } } impl :: Function for LeaveChannel { type Reply = :: mtproto :: Updates ; } impl :: BareSerialize for LeaveChannel { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & LeaveChannel { ref channel } = self ; _ser . write_boxed :: < :: mtproto :: InputChannel > ( channel ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channels.readHistory`\n\n```text\nchannels.readHistory#cc104937 channel:InputChannel max_id:int = Bool;\n```\n" ] pub struct ReadHistory { pub channel : :: mtproto :: InputChannel , pub max_id : :: mtproto :: int , } impl :: BoxedSerialize for ReadHistory { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xcc104937 ) , self ) } } impl :: Function for ReadHistory { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for ReadHistory { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ReadHistory { ref channel , ref max_id } = self ; _ser . write_boxed :: < :: mtproto :: InputChannel > ( channel ) ? ; _ser . write_bare :: < :: mtproto :: int > ( max_id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channels.readMessageContents`\n\n```text\nchannels.readMessageContents#eab5dc38 channel:InputChannel id:Vector<int> = Bool;\n```\n" ] pub struct ReadMessageContents { pub channel : :: mtproto :: InputChannel , pub id : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > , } impl :: BoxedSerialize for ReadMessageContents { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xeab5dc38 ) , self ) } } impl :: Function for ReadMessageContents { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for ReadMessageContents { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ReadMessageContents { ref channel , ref id } = self ; _ser . write_boxed :: < :: mtproto :: InputChannel > ( channel ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > > ( id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channels.reportSpam`\n\n```text\nchannels.reportSpam#fe087810 channel:InputChannel user_id:InputUser id:Vector<int> = Bool;\n```\n" ] pub struct ReportSpam { pub channel : :: mtproto :: InputChannel , pub user_id : :: mtproto :: InputUser , pub id : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > , } impl :: BoxedSerialize for ReportSpam { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xfe087810 ) , self ) } } impl :: Function for ReportSpam { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for ReportSpam { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ReportSpam { ref channel , ref user_id , ref id } = self ; _ser . write_boxed :: < :: mtproto :: InputChannel > ( channel ) ? ; _ser . write_boxed :: < :: mtproto :: InputUser > ( user_id ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > > ( id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channels.setStickers`\n\n```text\nchannels.setStickers#ea8ca4f9 channel:InputChannel stickerset:InputStickerSet = Bool;\n```\n" ] pub struct SetStickers { pub channel : :: mtproto :: InputChannel , pub stickerset : :: mtproto :: InputStickerSet , } impl :: BoxedSerialize for SetStickers { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xea8ca4f9 ) , self ) } } impl :: Function for SetStickers { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for SetStickers { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & SetStickers { ref channel , ref stickerset } = self ; _ser . write_boxed :: < :: mtproto :: InputChannel > ( channel ) ? ; _ser . write_boxed :: < :: mtproto :: InputStickerSet > ( stickerset ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channels.toggleInvites`\n\n```text\nchannels.toggleInvites#49609307 channel:InputChannel enabled:Bool = Updates;\n```\n" ] pub struct ToggleInvites { pub channel : :: mtproto :: InputChannel , pub enabled : :: mtproto :: Bool , } impl :: BoxedSerialize for ToggleInvites { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x49609307 ) , self ) } } impl :: Function for ToggleInvites { type Reply = :: mtproto :: Updates ; } impl :: BareSerialize for ToggleInvites { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ToggleInvites { ref channel , ref enabled } = self ; _ser . write_boxed :: < :: mtproto :: InputChannel > ( channel ) ? ; _ser . write_boxed :: < :: mtproto :: Bool > ( enabled ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channels.togglePreHistoryHidden`\n\n```text\nchannels.togglePreHistoryHidden#eabbb94c channel:InputChannel enabled:Bool = Updates;\n```\n" ] pub struct TogglePreHistoryHidden { pub channel : :: mtproto :: InputChannel , pub enabled : :: mtproto :: Bool , } impl :: BoxedSerialize for TogglePreHistoryHidden { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xeabbb94c ) , self ) } } impl :: Function for TogglePreHistoryHidden { type Reply = :: mtproto :: Updates ; } impl :: BareSerialize for TogglePreHistoryHidden { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & TogglePreHistoryHidden { ref channel , ref enabled } = self ; _ser . write_boxed :: < :: mtproto :: InputChannel > ( channel ) ? ; _ser . write_boxed :: < :: mtproto :: Bool > ( enabled ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channels.toggleSignatures`\n\n```text\nchannels.toggleSignatures#1f69b606 channel:InputChannel enabled:Bool = Updates;\n```\n" ] pub struct ToggleSignatures { pub channel : :: mtproto :: InputChannel , pub enabled : :: mtproto :: Bool , } impl :: BoxedSerialize for ToggleSignatures { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x1f69b606 ) , self ) } } impl :: Function for ToggleSignatures { type Reply = :: mtproto :: Updates ; } impl :: BareSerialize for ToggleSignatures { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ToggleSignatures { ref channel , ref enabled } = self ; _ser . write_boxed :: < :: mtproto :: InputChannel > ( channel ) ? ; _ser . write_boxed :: < :: mtproto :: Bool > ( enabled ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channels.updatePinnedMessage`\n\n```text\nchannels.updatePinnedMessage#a72ded52 flags:# silent:flags.0?true channel:InputChannel id:int = Updates;\n```\n" ] pub struct UpdatePinnedMessage { pub silent : bool , pub channel : :: mtproto :: InputChannel , pub id : :: mtproto :: int , } impl :: BoxedSerialize for UpdatePinnedMessage { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xa72ded52 ) , self ) } } impl :: Function for UpdatePinnedMessage { type Reply = :: mtproto :: Updates ; } impl :: BareSerialize for UpdatePinnedMessage { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & UpdatePinnedMessage { silent , ref channel , ref id } = self ; let mut _flags = 0i32 ; if silent { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_boxed :: < :: mtproto :: InputChannel > ( channel ) ? ; _ser . write_bare :: < :: mtproto :: int > ( id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `channels.updateUsername`\n\n```text\nchannels.updateUsername#3514b3de channel:InputChannel username:string = Bool;\n```\n" ] pub struct UpdateUsername { pub channel : :: mtproto :: InputChannel , pub username : :: mtproto :: string , } impl :: BoxedSerialize for UpdateUsername { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x3514b3de ) , self ) } } impl :: Function for UpdateUsername { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for UpdateUsername { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & UpdateUsername { ref channel , ref username } = self ; _ser . write_boxed :: < :: mtproto :: InputChannel > ( channel ) ? ; _ser . write_bare :: < :: mtproto :: string > ( username ) ? ; Ok ( ( ) ) } } } pub mod contacts { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `contacts.block`\n\n```text\ncontacts.block#332b49fc id:InputUser = Bool;\n```\n" ] pub struct Block { pub id : :: mtproto :: InputUser , } impl :: BoxedSerialize for Block { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x332b49fc ) , self ) } } impl :: Function for Block { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for Block { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Block { ref id } = self ; _ser . write_boxed :: < :: mtproto :: InputUser > ( id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `contacts.deleteContact`\n\n```text\ncontacts.deleteContact#8e953744 id:InputUser = contacts.Link;\n```\n" ] pub struct DeleteContact { pub id : :: mtproto :: InputUser , } impl :: BoxedSerialize for DeleteContact { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x8e953744 ) , self ) } } impl :: Function for DeleteContact { type Reply = :: mtproto :: contacts :: Link ; } impl :: BareSerialize for DeleteContact { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & DeleteContact { ref id } = self ; _ser . write_boxed :: < :: mtproto :: InputUser > ( id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `contacts.deleteContacts`\n\n```text\ncontacts.deleteContacts#59ab389e id:Vector<InputUser> = Bool;\n```\n" ] pub struct DeleteContacts { pub id : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputUser > , } impl :: BoxedSerialize for DeleteContacts { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x59ab389e ) , self ) } } impl :: Function for DeleteContacts { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for DeleteContacts { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & DeleteContacts { ref id } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputUser > > ( id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `contacts.exportCard`\n\n```text\ncontacts.exportCard#84e53737 = Vector<int>;\n```\n" ] pub struct ExportCard ; impl :: BoxedSerialize for ExportCard { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x84e53737 ) , self ) } } impl :: Function for ExportCard { type Reply = :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > ; } impl :: BareSerialize for ExportCard { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `contacts.getBlocked`\n\n```text\ncontacts.getBlocked#f57c350f offset:int limit:int = contacts.Blocked;\n```\n" ] pub struct GetBlocked { pub offset : :: mtproto :: int , pub limit : :: mtproto :: int , } impl :: BoxedSerialize for GetBlocked { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xf57c350f ) , self ) } } impl :: Function for GetBlocked { type Reply = :: mtproto :: contacts :: Blocked ; } impl :: BareSerialize for GetBlocked { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetBlocked { ref offset , ref limit } = self ; _ser . write_bare :: < :: mtproto :: int > ( offset ) ? ; _ser . write_bare :: < :: mtproto :: int > ( limit ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `contacts.getContacts`\n\n```text\ncontacts.getContacts#c023849f hash:int = contacts.Contacts;\n```\n" ] pub struct GetContacts { pub hash : :: mtproto :: int , } impl :: BoxedSerialize for GetContacts { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xc023849f ) , self ) } } impl :: Function for GetContacts { type Reply = :: mtproto :: contacts :: Contacts ; } impl :: BareSerialize for GetContacts { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetContacts { ref hash } = self ; _ser . write_bare :: < :: mtproto :: int > ( hash ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `contacts.getStatuses`\n\n```text\ncontacts.getStatuses#c4a353ee = Vector<ContactStatus>;\n```\n" ] pub struct GetStatuses ; impl :: BoxedSerialize for GetStatuses { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xc4a353ee ) , self ) } } impl :: Function for GetStatuses { type Reply = :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: ContactStatus > ; } impl :: BareSerialize for GetStatuses { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `contacts.getTopPeers`\n\n```text\ncontacts.getTopPeers#d4982db5 flags:# correspondents:flags.0?true bots_pm:flags.1?true bots_inline:flags.2?true phone_calls:flags.3?true groups:flags.10?true channels:flags.15?true offset:int limit:int hash:int = contacts.TopPeers;\n```\n" ] pub struct GetTopPeers { pub correspondents : bool , pub bots_pm : bool , pub bots_inline : bool , pub phone_calls : bool , pub groups : bool , pub channels : bool , pub offset : :: mtproto :: int , pub limit : :: mtproto :: int , pub hash : :: mtproto :: int , } impl :: BoxedSerialize for GetTopPeers { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xd4982db5 ) , self ) } } impl :: Function for GetTopPeers { type Reply = :: mtproto :: contacts :: TopPeers ; } impl :: BareSerialize for GetTopPeers { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetTopPeers { correspondents , bots_pm , bots_inline , phone_calls , groups , channels , ref offset , ref limit , ref hash } = self ; let mut _flags = 0i32 ; if correspondents { _flags |= 1 << 0u32 ; } if bots_pm { _flags |= 1 << 1u32 ; } if bots_inline { _flags |= 1 << 2u32 ; } if phone_calls { _flags |= 1 << 3u32 ; } if groups { _flags |= 1 << 10u32 ; } if channels { _flags |= 1 << 15u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: int > ( offset ) ? ; _ser . write_bare :: < :: mtproto :: int > ( limit ) ? ; _ser . write_bare :: < :: mtproto :: int > ( hash ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `contacts.importCard`\n\n```text\ncontacts.importCard#4fe196fe export_card:Vector<int> = User;\n```\n" ] pub struct ImportCard { pub export_card : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > , } impl :: BoxedSerialize for ImportCard { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x4fe196fe ) , self ) } } impl :: Function for ImportCard { type Reply = :: mtproto :: User ; } impl :: BareSerialize for ImportCard { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ImportCard { ref export_card } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > > ( export_card ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `contacts.importContacts`\n\n```text\ncontacts.importContacts#2c800be5 contacts:Vector<InputContact> = contacts.ImportedContacts;\n```\n" ] pub struct ImportContacts { pub contacts : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputContact > , } impl :: BoxedSerialize for ImportContacts { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x2c800be5 ) , self ) } } impl :: Function for ImportContacts { type Reply = :: mtproto :: contacts :: ImportedContacts ; } impl :: BareSerialize for ImportContacts { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ImportContacts { ref contacts } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputContact > > ( contacts ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `contacts.resetSaved`\n\n```text\ncontacts.resetSaved#879537f1 = Bool;\n```\n" ] pub struct ResetSaved ; impl :: BoxedSerialize for ResetSaved { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x879537f1 ) , self ) } } impl :: Function for ResetSaved { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for ResetSaved { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `contacts.resetTopPeerRating`\n\n```text\ncontacts.resetTopPeerRating#1ae373ac category:TopPeerCategory peer:InputPeer = Bool;\n```\n" ] pub struct ResetTopPeerRating { pub category : :: mtproto :: TopPeerCategory , pub peer : :: mtproto :: InputPeer , } impl :: BoxedSerialize for ResetTopPeerRating { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x1ae373ac ) , self ) } } impl :: Function for ResetTopPeerRating { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for ResetTopPeerRating { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ResetTopPeerRating { ref category , ref peer } = self ; _ser . write_boxed :: < :: mtproto :: TopPeerCategory > ( category ) ? ; _ser . write_boxed :: < :: mtproto :: InputPeer > ( peer ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `contacts.resolveUsername`\n\n```text\ncontacts.resolveUsername#f93ccba3 username:string = contacts.ResolvedPeer;\n```\n" ] pub struct ResolveUsername { pub username : :: mtproto :: string , } impl :: BoxedSerialize for ResolveUsername { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xf93ccba3 ) , self ) } } impl :: Function for ResolveUsername { type Reply = :: mtproto :: contacts :: ResolvedPeer ; } impl :: BareSerialize for ResolveUsername { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ResolveUsername { ref username } = self ; _ser . write_bare :: < :: mtproto :: string > ( username ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `contacts.search`\n\n```text\ncontacts.search#11f812d8 q:string limit:int = contacts.Found;\n```\n" ] pub struct Search { pub q : :: mtproto :: string , pub limit : :: mtproto :: int , } impl :: BoxedSerialize for Search { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x11f812d8 ) , self ) } } impl :: Function for Search { type Reply = :: mtproto :: contacts :: Found ; } impl :: BareSerialize for Search { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Search { ref q , ref limit } = self ; _ser . write_bare :: < :: mtproto :: string > ( q ) ? ; _ser . write_bare :: < :: mtproto :: int > ( limit ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `contacts.unblock`\n\n```text\ncontacts.unblock#e54100bd id:InputUser = Bool;\n```\n" ] pub struct Unblock { pub id : :: mtproto :: InputUser , } impl :: BoxedSerialize for Unblock { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xe54100bd ) , self ) } } impl :: Function for Unblock { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for Unblock { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Unblock { ref id } = self ; _ser . write_boxed :: < :: mtproto :: InputUser > ( id ) ? ; Ok ( ( ) ) } } } pub mod contest { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `contest.saveDeveloperInfo`\n\n```text\ncontest.saveDeveloperInfo#9a5f6e95 vk_id:int name:string phone_number:string age:int city:string = Bool;\n```\n" ] pub struct SaveDeveloperInfo { pub vk_id : :: mtproto :: int , pub name : :: mtproto :: string , pub phone_number : :: mtproto :: string , pub age : :: mtproto :: int , pub city : :: mtproto :: string , } impl :: BoxedSerialize for SaveDeveloperInfo { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x9a5f6e95 ) , self ) } } impl :: Function for SaveDeveloperInfo { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for SaveDeveloperInfo { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & SaveDeveloperInfo { ref vk_id , ref name , ref phone_number , ref age , ref city } = self ; _ser . write_bare :: < :: mtproto :: int > ( vk_id ) ? ; _ser . write_bare :: < :: mtproto :: string > ( name ) ? ; _ser . write_bare :: < :: mtproto :: string > ( phone_number ) ? ; _ser . write_bare :: < :: mtproto :: int > ( age ) ? ; _ser . write_bare :: < :: mtproto :: string > ( city ) ? ; Ok ( ( ) ) } } } pub mod help { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `help.getAppChangelog`\n\n```text\nhelp.getAppChangelog#9010ef6f prev_app_version:string = Updates;\n```\n" ] pub struct GetAppChangelog { pub prev_app_version : :: mtproto :: string , } impl :: BoxedSerialize for GetAppChangelog { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x9010ef6f ) , self ) } } impl :: Function for GetAppChangelog { type Reply = :: mtproto :: Updates ; } impl :: BareSerialize for GetAppChangelog { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetAppChangelog { ref prev_app_version } = self ; _ser . write_bare :: < :: mtproto :: string > ( prev_app_version ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `help.getAppUpdate`\n\n```text\nhelp.getAppUpdate#ae2de196 = help.AppUpdate;\n```\n" ] pub struct GetAppUpdate ; impl :: BoxedSerialize for GetAppUpdate { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xae2de196 ) , self ) } } impl :: Function for GetAppUpdate { type Reply = :: mtproto :: help :: AppUpdate ; } impl :: BareSerialize for GetAppUpdate { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `help.getCdnConfig`\n\n```text\nhelp.getCdnConfig#52029342 = CdnConfig;\n```\n" ] pub struct GetCdnConfig ; impl :: BoxedSerialize for GetCdnConfig { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x52029342 ) , self ) } } impl :: Function for GetCdnConfig { type Reply = :: mtproto :: CdnConfig ; } impl :: BareSerialize for GetCdnConfig { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `help.getConfig`\n\n```text\nhelp.getConfig#c4f9186b = Config;\n```\n" ] pub struct GetConfig ; impl :: BoxedSerialize for GetConfig { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xc4f9186b ) , self ) } } impl :: Function for GetConfig { type Reply = :: mtproto :: Config ; } impl :: BareSerialize for GetConfig { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `help.getInviteText`\n\n```text\nhelp.getInviteText#4d392343 = help.InviteText;\n```\n" ] pub struct GetInviteText ; impl :: BoxedSerialize for GetInviteText { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x4d392343 ) , self ) } } impl :: Function for GetInviteText { type Reply = :: mtproto :: help :: InviteText ; } impl :: BareSerialize for GetInviteText { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `help.getNearestDc`\n\n```text\nhelp.getNearestDc#1fb33026 = NearestDc;\n```\n" ] pub struct GetNearestDc ; impl :: BoxedSerialize for GetNearestDc { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x1fb33026 ) , self ) } } impl :: Function for GetNearestDc { type Reply = :: mtproto :: NearestDc ; } impl :: BareSerialize for GetNearestDc { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `help.getRecentMeUrls`\n\n```text\nhelp.getRecentMeUrls#3dc0f114 referer:string = help.RecentMeUrls;\n```\n" ] pub struct GetRecentMeUrls { pub referer : :: mtproto :: string , } impl :: BoxedSerialize for GetRecentMeUrls { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x3dc0f114 ) , self ) } } impl :: Function for GetRecentMeUrls { type Reply = :: mtproto :: help :: RecentMeUrls ; } impl :: BareSerialize for GetRecentMeUrls { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetRecentMeUrls { ref referer } = self ; _ser . write_bare :: < :: mtproto :: string > ( referer ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `help.getSupport`\n\n```text\nhelp.getSupport#9cdf08cd = help.Support;\n```\n" ] pub struct GetSupport ; impl :: BoxedSerialize for GetSupport { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x9cdf08cd ) , self ) } } impl :: Function for GetSupport { type Reply = :: mtproto :: help :: Support ; } impl :: BareSerialize for GetSupport { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `help.getTermsOfService`\n\n```text\nhelp.getTermsOfService#350170f3 = help.TermsOfService;\n```\n" ] pub struct GetTermsOfService ; impl :: BoxedSerialize for GetTermsOfService { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x350170f3 ) , self ) } } impl :: Function for GetTermsOfService { type Reply = :: mtproto :: help :: TermsOfService ; } impl :: BareSerialize for GetTermsOfService { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `help.saveAppLog`\n\n```text\nhelp.saveAppLog#6f02f748 events:Vector<InputAppEvent> = Bool;\n```\n" ] pub struct SaveAppLog { pub events : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputAppEvent > , } impl :: BoxedSerialize for SaveAppLog { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x6f02f748 ) , self ) } } impl :: Function for SaveAppLog { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for SaveAppLog { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & SaveAppLog { ref events } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputAppEvent > > ( events ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `help.setBotUpdatesStatus`\n\n```text\nhelp.setBotUpdatesStatus#ec22cfcd pending_updates_count:int message:string = Bool;\n```\n" ] pub struct SetBotUpdatesStatus { pub pending_updates_count : :: mtproto :: int , pub message : :: mtproto :: string , } impl :: BoxedSerialize for SetBotUpdatesStatus { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xec22cfcd ) , self ) } } impl :: Function for SetBotUpdatesStatus { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for SetBotUpdatesStatus { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & SetBotUpdatesStatus { ref pending_updates_count , ref message } = self ; _ser . write_bare :: < :: mtproto :: int > ( pending_updates_count ) ? ; _ser . write_bare :: < :: mtproto :: string > ( message ) ? ; Ok ( ( ) ) } } } pub mod langpack { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `langpack.getDifference`\n\n```text\nlangpack.getDifference#b2e4d7d from_version:int = LangPackDifference;\n```\n" ] pub struct GetDifference { pub from_version : :: mtproto :: int , } impl :: BoxedSerialize for GetDifference { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x0b2e4d7d ) , self ) } } impl :: Function for GetDifference { type Reply = :: mtproto :: LangPackDifference ; } impl :: BareSerialize for GetDifference { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetDifference { ref from_version } = self ; _ser . write_bare :: < :: mtproto :: int > ( from_version ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `langpack.getLangPack`\n\n```text\nlangpack.getLangPack#9ab5c58e lang_code:string = LangPackDifference;\n```\n" ] pub struct GetLangPack { pub lang_code : :: mtproto :: string , } impl :: BoxedSerialize for GetLangPack { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x9ab5c58e ) , self ) } } impl :: Function for GetLangPack { type Reply = :: mtproto :: LangPackDifference ; } impl :: BareSerialize for GetLangPack { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetLangPack { ref lang_code } = self ; _ser . write_bare :: < :: mtproto :: string > ( lang_code ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `langpack.getLanguages`\n\n```text\nlangpack.getLanguages#800fd57d = Vector<LangPackLanguage>;\n```\n" ] pub struct GetLanguages ; impl :: BoxedSerialize for GetLanguages { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x800fd57d ) , self ) } } impl :: Function for GetLanguages { type Reply = :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: LangPackLanguage > ; } impl :: BareSerialize for GetLanguages { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `langpack.getStrings`\n\n```text\nlangpack.getStrings#2e1ee318 lang_code:string keys:Vector<string> = Vector<LangPackString>;\n```\n" ] pub struct GetStrings { pub lang_code : :: mtproto :: string , pub keys : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: string > , } impl :: BoxedSerialize for GetStrings { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x2e1ee318 ) , self ) } } impl :: Function for GetStrings { type Reply = :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: LangPackString > ; } impl :: BareSerialize for GetStrings { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetStrings { ref lang_code , ref keys } = self ; _ser . write_bare :: < :: mtproto :: string > ( lang_code ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: string > > ( keys ) ? ; Ok ( ( ) ) } } } pub mod messages { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.acceptEncryption`\n\n```text\nmessages.acceptEncryption#3dbc0415 peer:InputEncryptedChat g_b:bytes key_fingerprint:long = EncryptedChat;\n```\n" ] pub struct AcceptEncryption { pub peer : :: mtproto :: InputEncryptedChat , pub g_b : :: mtproto :: bytes , pub key_fingerprint : :: mtproto :: long , } impl :: BoxedSerialize for AcceptEncryption { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x3dbc0415 ) , self ) } } impl :: Function for AcceptEncryption { type Reply = :: mtproto :: EncryptedChat ; } impl :: BareSerialize for AcceptEncryption { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & AcceptEncryption { ref peer , ref g_b , ref key_fingerprint } = self ; _ser . write_boxed :: < :: mtproto :: InputEncryptedChat > ( peer ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( g_b ) ? ; _ser . write_bare :: < :: mtproto :: long > ( key_fingerprint ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.addChatUser`\n\n```text\nmessages.addChatUser#f9a0aa09 chat_id:int user_id:InputUser fwd_limit:int = Updates;\n```\n" ] pub struct AddChatUser { pub chat_id : :: mtproto :: int , pub user_id : :: mtproto :: InputUser , pub fwd_limit : :: mtproto :: int , } impl :: BoxedSerialize for AddChatUser { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xf9a0aa09 ) , self ) } } impl :: Function for AddChatUser { type Reply = :: mtproto :: Updates ; } impl :: BareSerialize for AddChatUser { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & AddChatUser { ref chat_id , ref user_id , ref fwd_limit } = self ; _ser . write_bare :: < :: mtproto :: int > ( chat_id ) ? ; _ser . write_boxed :: < :: mtproto :: InputUser > ( user_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( fwd_limit ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.checkChatInvite`\n\n```text\nmessages.checkChatInvite#3eadb1bb hash:string = ChatInvite;\n```\n" ] pub struct CheckChatInvite { pub hash : :: mtproto :: string , } impl :: BoxedSerialize for CheckChatInvite { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x3eadb1bb ) , self ) } } impl :: Function for CheckChatInvite { type Reply = :: mtproto :: ChatInvite ; } impl :: BareSerialize for CheckChatInvite { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & CheckChatInvite { ref hash } = self ; _ser . write_bare :: < :: mtproto :: string > ( hash ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.clearRecentStickers`\n\n```text\nmessages.clearRecentStickers#8999602d flags:# attached:flags.0?true = Bool;\n```\n" ] pub struct ClearRecentStickers { pub attached : bool , } impl :: BoxedSerialize for ClearRecentStickers { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x8999602d ) , self ) } } impl :: Function for ClearRecentStickers { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for ClearRecentStickers { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ClearRecentStickers { attached } = self ; let mut _flags = 0i32 ; if attached { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.createChat`\n\n```text\nmessages.createChat#9cb126e users:Vector<InputUser> title:string = Updates;\n```\n" ] pub struct CreateChat { pub users : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputUser > , pub title : :: mtproto :: string , } impl :: BoxedSerialize for CreateChat { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x09cb126e ) , self ) } } impl :: Function for CreateChat { type Reply = :: mtproto :: Updates ; } impl :: BareSerialize for CreateChat { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & CreateChat { ref users , ref title } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputUser > > ( users ) ? ; _ser . write_bare :: < :: mtproto :: string > ( title ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.deleteChatUser`\n\n```text\nmessages.deleteChatUser#e0611f16 chat_id:int user_id:InputUser = Updates;\n```\n" ] pub struct DeleteChatUser { pub chat_id : :: mtproto :: int , pub user_id : :: mtproto :: InputUser , } impl :: BoxedSerialize for DeleteChatUser { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xe0611f16 ) , self ) } } impl :: Function for DeleteChatUser { type Reply = :: mtproto :: Updates ; } impl :: BareSerialize for DeleteChatUser { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & DeleteChatUser { ref chat_id , ref user_id } = self ; _ser . write_bare :: < :: mtproto :: int > ( chat_id ) ? ; _ser . write_boxed :: < :: mtproto :: InputUser > ( user_id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.deleteHistory`\n\n```text\nmessages.deleteHistory#1c015b09 flags:# just_clear:flags.0?true peer:InputPeer max_id:int = messages.AffectedHistory;\n```\n" ] pub struct DeleteHistory { pub just_clear : bool , pub peer : :: mtproto :: InputPeer , pub max_id : :: mtproto :: int , } impl :: BoxedSerialize for DeleteHistory { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x1c015b09 ) , self ) } } impl :: Function for DeleteHistory { type Reply = :: mtproto :: messages :: AffectedHistory ; } impl :: BareSerialize for DeleteHistory { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & DeleteHistory { just_clear , ref peer , ref max_id } = self ; let mut _flags = 0i32 ; if just_clear { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_boxed :: < :: mtproto :: InputPeer > ( peer ) ? ; _ser . write_bare :: < :: mtproto :: int > ( max_id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.deleteMessages`\n\n```text\nmessages.deleteMessages#e58e95d2 flags:# revoke:flags.0?true id:Vector<int> = messages.AffectedMessages;\n```\n" ] pub struct DeleteMessages { pub revoke : bool , pub id : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > , } impl :: BoxedSerialize for DeleteMessages { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xe58e95d2 ) , self ) } } impl :: Function for DeleteMessages { type Reply = :: mtproto :: messages :: AffectedMessages ; } impl :: BareSerialize for DeleteMessages { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & DeleteMessages { revoke , ref id } = self ; let mut _flags = 0i32 ; if revoke { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > > ( id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.discardEncryption`\n\n```text\nmessages.discardEncryption#edd923c5 chat_id:int = Bool;\n```\n" ] pub struct DiscardEncryption { pub chat_id : :: mtproto :: int , } impl :: BoxedSerialize for DiscardEncryption { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xedd923c5 ) , self ) } } impl :: Function for DiscardEncryption { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for DiscardEncryption { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & DiscardEncryption { ref chat_id } = self ; _ser . write_bare :: < :: mtproto :: int > ( chat_id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.editChatAdmin`\n\n```text\nmessages.editChatAdmin#a9e69f2e chat_id:int user_id:InputUser is_admin:Bool = Bool;\n```\n" ] pub struct EditChatAdmin { pub chat_id : :: mtproto :: int , pub user_id : :: mtproto :: InputUser , pub is_admin : :: mtproto :: Bool , } impl :: BoxedSerialize for EditChatAdmin { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xa9e69f2e ) , self ) } } impl :: Function for EditChatAdmin { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for EditChatAdmin { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & EditChatAdmin { ref chat_id , ref user_id , ref is_admin } = self ; _ser . write_bare :: < :: mtproto :: int > ( chat_id ) ? ; _ser . write_boxed :: < :: mtproto :: InputUser > ( user_id ) ? ; _ser . write_boxed :: < :: mtproto :: Bool > ( is_admin ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.editChatPhoto`\n\n```text\nmessages.editChatPhoto#ca4c79d8 chat_id:int photo:InputChatPhoto = Updates;\n```\n" ] pub struct EditChatPhoto { pub chat_id : :: mtproto :: int , pub photo : :: mtproto :: InputChatPhoto , } impl :: BoxedSerialize for EditChatPhoto { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xca4c79d8 ) , self ) } } impl :: Function for EditChatPhoto { type Reply = :: mtproto :: Updates ; } impl :: BareSerialize for EditChatPhoto { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & EditChatPhoto { ref chat_id , ref photo } = self ; _ser . write_bare :: < :: mtproto :: int > ( chat_id ) ? ; _ser . write_boxed :: < :: mtproto :: InputChatPhoto > ( photo ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.editChatTitle`\n\n```text\nmessages.editChatTitle#dc452855 chat_id:int title:string = Updates;\n```\n" ] pub struct EditChatTitle { pub chat_id : :: mtproto :: int , pub title : :: mtproto :: string , } impl :: BoxedSerialize for EditChatTitle { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xdc452855 ) , self ) } } impl :: Function for EditChatTitle { type Reply = :: mtproto :: Updates ; } impl :: BareSerialize for EditChatTitle { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & EditChatTitle { ref chat_id , ref title } = self ; _ser . write_bare :: < :: mtproto :: int > ( chat_id ) ? ; _ser . write_bare :: < :: mtproto :: string > ( title ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.editInlineBotMessage`\n\n```text\nmessages.editInlineBotMessage#b0e08243 flags:# no_webpage:flags.1?true stop_geo_live:flags.12?true id:InputBotInlineMessageID message:flags.11?string reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> geo_point:flags.13?InputGeoPoint = Bool;\n```\n" ] pub struct EditInlineBotMessage { pub no_webpage : bool , pub stop_geo_live : bool , pub id : :: mtproto :: InputBotInlineMessageID , pub message : Option < :: mtproto :: string > , pub reply_markup : Option < :: mtproto :: ReplyMarkup > , pub entities : Option < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: MessageEntity > > , pub geo_point : Option < :: mtproto :: InputGeoPoint > , } impl :: BoxedSerialize for EditInlineBotMessage { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xb0e08243 ) , self ) } } impl :: Function for EditInlineBotMessage { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for EditInlineBotMessage { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & EditInlineBotMessage { no_webpage , stop_geo_live , ref id , ref message , ref reply_markup , ref entities , ref geo_point } = self ; let mut _flags = 0i32 ; if no_webpage { _flags |= 1 << 1u32 ; } if stop_geo_live { _flags |= 1 << 12u32 ; } if message . is_some ( ) { _flags |= 1 << 11u32 ; } if reply_markup . is_some ( ) { _flags |= 1 << 2u32 ; } if entities . is_some ( ) { _flags |= 1 << 3u32 ; } if geo_point . is_some ( ) { _flags |= 1 << 13u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_boxed :: < :: mtproto :: InputBotInlineMessageID > ( id ) ? ; if let & Some ( ref inner ) = message { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = reply_markup { _ser . write_boxed :: < :: mtproto :: ReplyMarkup > ( inner ) ? ; } if let & Some ( ref inner ) = entities { _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: MessageEntity > > ( inner ) ? ; } if let & Some ( ref inner ) = geo_point { _ser . write_boxed :: < :: mtproto :: InputGeoPoint > ( inner ) ? ; } Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.editMessage`\n\n```text\nmessages.editMessage#5d1b8dd flags:# no_webpage:flags.1?true stop_geo_live:flags.12?true peer:InputPeer id:int message:flags.11?string reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> geo_point:flags.13?InputGeoPoint = Updates;\n```\n" ] pub struct EditMessage { pub no_webpage : bool , pub stop_geo_live : bool , pub peer : :: mtproto :: InputPeer , pub id : :: mtproto :: int , pub message : Option < :: mtproto :: string > , pub reply_markup : Option < :: mtproto :: ReplyMarkup > , pub entities : Option < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: MessageEntity > > , pub geo_point : Option < :: mtproto :: InputGeoPoint > , } impl :: BoxedSerialize for EditMessage { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x05d1b8dd ) , self ) } } impl :: Function for EditMessage { type Reply = :: mtproto :: Updates ; } impl :: BareSerialize for EditMessage { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & EditMessage { no_webpage , stop_geo_live , ref peer , ref id , ref message , ref reply_markup , ref entities , ref geo_point } = self ; let mut _flags = 0i32 ; if no_webpage { _flags |= 1 << 1u32 ; } if stop_geo_live { _flags |= 1 << 12u32 ; } if message . is_some ( ) { _flags |= 1 << 11u32 ; } if reply_markup . is_some ( ) { _flags |= 1 << 2u32 ; } if entities . is_some ( ) { _flags |= 1 << 3u32 ; } if geo_point . is_some ( ) { _flags |= 1 << 13u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_boxed :: < :: mtproto :: InputPeer > ( peer ) ? ; _ser . write_bare :: < :: mtproto :: int > ( id ) ? ; if let & Some ( ref inner ) = message { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = reply_markup { _ser . write_boxed :: < :: mtproto :: ReplyMarkup > ( inner ) ? ; } if let & Some ( ref inner ) = entities { _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: MessageEntity > > ( inner ) ? ; } if let & Some ( ref inner ) = geo_point { _ser . write_boxed :: < :: mtproto :: InputGeoPoint > ( inner ) ? ; } Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.exportChatInvite`\n\n```text\nmessages.exportChatInvite#7d885289 chat_id:int = ExportedChatInvite;\n```\n" ] pub struct ExportChatInvite { pub chat_id : :: mtproto :: int , } impl :: BoxedSerialize for ExportChatInvite { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x7d885289 ) , self ) } } impl :: Function for ExportChatInvite { type Reply = :: mtproto :: ExportedChatInvite ; } impl :: BareSerialize for ExportChatInvite { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ExportChatInvite { ref chat_id } = self ; _ser . write_bare :: < :: mtproto :: int > ( chat_id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.faveSticker`\n\n```text\nmessages.faveSticker#b9ffc55b id:InputDocument unfave:Bool = Bool;\n```\n" ] pub struct FaveSticker { pub id : :: mtproto :: InputDocument , pub unfave : :: mtproto :: Bool , } impl :: BoxedSerialize for FaveSticker { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xb9ffc55b ) , self ) } } impl :: Function for FaveSticker { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for FaveSticker { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & FaveSticker { ref id , ref unfave } = self ; _ser . write_boxed :: < :: mtproto :: InputDocument > ( id ) ? ; _ser . write_boxed :: < :: mtproto :: Bool > ( unfave ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.forwardMessage`\n\n```text\nmessages.forwardMessage#33963bf9 peer:InputPeer id:int random_id:long = Updates;\n```\n" ] pub struct ForwardMessage { pub peer : :: mtproto :: InputPeer , pub id : :: mtproto :: int , pub random_id : :: mtproto :: long , } impl :: BoxedSerialize for ForwardMessage { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x33963bf9 ) , self ) } } impl :: Function for ForwardMessage { type Reply = :: mtproto :: Updates ; } impl :: BareSerialize for ForwardMessage { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ForwardMessage { ref peer , ref id , ref random_id } = self ; _ser . write_boxed :: < :: mtproto :: InputPeer > ( peer ) ? ; _ser . write_bare :: < :: mtproto :: int > ( id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( random_id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.forwardMessages`\n\n```text\nmessages.forwardMessages#708e0195 flags:# silent:flags.5?true background:flags.6?true with_my_score:flags.8?true grouped:flags.9?true from_peer:InputPeer id:Vector<int> random_id:Vector<long> to_peer:InputPeer = Updates;\n```\n" ] pub struct ForwardMessages { pub silent : bool , pub background : bool , pub with_my_score : bool , pub grouped : bool , pub from_peer : :: mtproto :: InputPeer , pub id : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > , pub random_id : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > , pub to_peer : :: mtproto :: InputPeer , } impl :: BoxedSerialize for ForwardMessages { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x708e0195 ) , self ) } } impl :: Function for ForwardMessages { type Reply = :: mtproto :: Updates ; } impl :: BareSerialize for ForwardMessages { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ForwardMessages { silent , background , with_my_score , grouped , ref from_peer , ref id , ref random_id , ref to_peer } = self ; let mut _flags = 0i32 ; if silent { _flags |= 1 << 5u32 ; } if background { _flags |= 1 << 6u32 ; } if with_my_score { _flags |= 1 << 8u32 ; } if grouped { _flags |= 1 << 9u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_boxed :: < :: mtproto :: InputPeer > ( from_peer ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > > ( id ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > > ( random_id ) ? ; _ser . write_boxed :: < :: mtproto :: InputPeer > ( to_peer ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.getAllChats`\n\n```text\nmessages.getAllChats#eba80ff0 except_ids:Vector<int> = messages.Chats;\n```\n" ] pub struct GetAllChats { pub except_ids : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > , } impl :: BoxedSerialize for GetAllChats { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xeba80ff0 ) , self ) } } impl :: Function for GetAllChats { type Reply = :: mtproto :: messages :: Chats ; } impl :: BareSerialize for GetAllChats { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetAllChats { ref except_ids } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > > ( except_ids ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.getAllDrafts`\n\n```text\nmessages.getAllDrafts#6a3f8d65 = Updates;\n```\n" ] pub struct GetAllDrafts ; impl :: BoxedSerialize for GetAllDrafts { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x6a3f8d65 ) , self ) } } impl :: Function for GetAllDrafts { type Reply = :: mtproto :: Updates ; } impl :: BareSerialize for GetAllDrafts { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.getAllStickers`\n\n```text\nmessages.getAllStickers#1c9618b1 hash:int = messages.AllStickers;\n```\n" ] pub struct GetAllStickers { pub hash : :: mtproto :: int , } impl :: BoxedSerialize for GetAllStickers { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x1c9618b1 ) , self ) } } impl :: Function for GetAllStickers { type Reply = :: mtproto :: messages :: AllStickers ; } impl :: BareSerialize for GetAllStickers { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetAllStickers { ref hash } = self ; _ser . write_bare :: < :: mtproto :: int > ( hash ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.getArchivedStickers`\n\n```text\nmessages.getArchivedStickers#57f17692 flags:# masks:flags.0?true offset_id:long limit:int = messages.ArchivedStickers;\n```\n" ] pub struct GetArchivedStickers { pub masks : bool , pub offset_id : :: mtproto :: long , pub limit : :: mtproto :: int , } impl :: BoxedSerialize for GetArchivedStickers { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x57f17692 ) , self ) } } impl :: Function for GetArchivedStickers { type Reply = :: mtproto :: messages :: ArchivedStickers ; } impl :: BareSerialize for GetArchivedStickers { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetArchivedStickers { masks , ref offset_id , ref limit } = self ; let mut _flags = 0i32 ; if masks { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: long > ( offset_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( limit ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.getAttachedStickers`\n\n```text\nmessages.getAttachedStickers#cc5b67cc media:InputStickeredMedia = Vector<StickerSetCovered>;\n```\n" ] pub struct GetAttachedStickers { pub media : :: mtproto :: InputStickeredMedia , } impl :: BoxedSerialize for GetAttachedStickers { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xcc5b67cc ) , self ) } } impl :: Function for GetAttachedStickers { type Reply = :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: StickerSetCovered > ; } impl :: BareSerialize for GetAttachedStickers { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetAttachedStickers { ref media } = self ; _ser . write_boxed :: < :: mtproto :: InputStickeredMedia > ( media ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.getBotCallbackAnswer`\n\n```text\nmessages.getBotCallbackAnswer#810a9fec flags:# game:flags.1?true peer:InputPeer msg_id:int data:flags.0?bytes = messages.BotCallbackAnswer;\n```\n" ] pub struct GetBotCallbackAnswer { pub game : bool , pub peer : :: mtproto :: InputPeer , pub msg_id : :: mtproto :: int , pub data : Option < :: mtproto :: bytes > , } impl :: BoxedSerialize for GetBotCallbackAnswer { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x810a9fec ) , self ) } } impl :: Function for GetBotCallbackAnswer { type Reply = :: mtproto :: messages :: BotCallbackAnswer ; } impl :: BareSerialize for GetBotCallbackAnswer { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetBotCallbackAnswer { game , ref peer , ref msg_id , ref data } = self ; let mut _flags = 0i32 ; if game { _flags |= 1 << 1u32 ; } if data . is_some ( ) { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_boxed :: < :: mtproto :: InputPeer > ( peer ) ? ; _ser . write_bare :: < :: mtproto :: int > ( msg_id ) ? ; if let & Some ( ref inner ) = data { _ser . write_bare :: < :: mtproto :: bytes > ( inner ) ? ; } Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.getChats`\n\n```text\nmessages.getChats#3c6aa187 id:Vector<int> = messages.Chats;\n```\n" ] pub struct GetChats { pub id : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > , } impl :: BoxedSerialize for GetChats { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x3c6aa187 ) , self ) } } impl :: Function for GetChats { type Reply = :: mtproto :: messages :: Chats ; } impl :: BareSerialize for GetChats { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetChats { ref id } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > > ( id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.getCommonChats`\n\n```text\nmessages.getCommonChats#d0a48c4 user_id:InputUser max_id:int limit:int = messages.Chats;\n```\n" ] pub struct GetCommonChats { pub user_id : :: mtproto :: InputUser , pub max_id : :: mtproto :: int , pub limit : :: mtproto :: int , } impl :: BoxedSerialize for GetCommonChats { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x0d0a48c4 ) , self ) } } impl :: Function for GetCommonChats { type Reply = :: mtproto :: messages :: Chats ; } impl :: BareSerialize for GetCommonChats { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetCommonChats { ref user_id , ref max_id , ref limit } = self ; _ser . write_boxed :: < :: mtproto :: InputUser > ( user_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( max_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( limit ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.getDhConfig`\n\n```text\nmessages.getDhConfig#26cf8950 version:int random_length:int = messages.DhConfig;\n```\n" ] pub struct GetDhConfig { pub version : :: mtproto :: int , pub random_length : :: mtproto :: int , } impl :: BoxedSerialize for GetDhConfig { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x26cf8950 ) , self ) } } impl :: Function for GetDhConfig { type Reply = :: mtproto :: messages :: DhConfig ; } impl :: BareSerialize for GetDhConfig { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetDhConfig { ref version , ref random_length } = self ; _ser . write_bare :: < :: mtproto :: int > ( version ) ? ; _ser . write_bare :: < :: mtproto :: int > ( random_length ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.getDialogs`\n\n```text\nmessages.getDialogs#191ba9c5 flags:# exclude_pinned:flags.0?true offset_date:int offset_id:int offset_peer:InputPeer limit:int = messages.Dialogs;\n```\n" ] pub struct GetDialogs { pub exclude_pinned : bool , pub offset_date : :: mtproto :: int , pub offset_id : :: mtproto :: int , pub offset_peer : :: mtproto :: InputPeer , pub limit : :: mtproto :: int , } impl :: BoxedSerialize for GetDialogs { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x191ba9c5 ) , self ) } } impl :: Function for GetDialogs { type Reply = :: mtproto :: messages :: Dialogs ; } impl :: BareSerialize for GetDialogs { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetDialogs { exclude_pinned , ref offset_date , ref offset_id , ref offset_peer , ref limit } = self ; let mut _flags = 0i32 ; if exclude_pinned { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: int > ( offset_date ) ? ; _ser . write_bare :: < :: mtproto :: int > ( offset_id ) ? ; _ser . write_boxed :: < :: mtproto :: InputPeer > ( offset_peer ) ? ; _ser . write_bare :: < :: mtproto :: int > ( limit ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.getDocumentByHash`\n\n```text\nmessages.getDocumentByHash#338e2464 sha256:bytes size:int mime_type:string = Document;\n```\n" ] pub struct GetDocumentByHash { pub sha256 : :: mtproto :: bytes , pub size : :: mtproto :: int , pub mime_type : :: mtproto :: string , } impl :: BoxedSerialize for GetDocumentByHash { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x338e2464 ) , self ) } } impl :: Function for GetDocumentByHash { type Reply = :: mtproto :: Document ; } impl :: BareSerialize for GetDocumentByHash { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetDocumentByHash { ref sha256 , ref size , ref mime_type } = self ; _ser . write_bare :: < :: mtproto :: bytes > ( sha256 ) ? ; _ser . write_bare :: < :: mtproto :: int > ( size ) ? ; _ser . write_bare :: < :: mtproto :: string > ( mime_type ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.getFavedStickers`\n\n```text\nmessages.getFavedStickers#21ce0b0e hash:int = messages.FavedStickers;\n```\n" ] pub struct GetFavedStickers { pub hash : :: mtproto :: int , } impl :: BoxedSerialize for GetFavedStickers { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x21ce0b0e ) , self ) } } impl :: Function for GetFavedStickers { type Reply = :: mtproto :: messages :: FavedStickers ; } impl :: BareSerialize for GetFavedStickers { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetFavedStickers { ref hash } = self ; _ser . write_bare :: < :: mtproto :: int > ( hash ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.getFeaturedStickers`\n\n```text\nmessages.getFeaturedStickers#2dacca4f hash:int = messages.FeaturedStickers;\n```\n" ] pub struct GetFeaturedStickers { pub hash : :: mtproto :: int , } impl :: BoxedSerialize for GetFeaturedStickers { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x2dacca4f ) , self ) } } impl :: Function for GetFeaturedStickers { type Reply = :: mtproto :: messages :: FeaturedStickers ; } impl :: BareSerialize for GetFeaturedStickers { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetFeaturedStickers { ref hash } = self ; _ser . write_bare :: < :: mtproto :: int > ( hash ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.getFullChat`\n\n```text\nmessages.getFullChat#3b831c66 chat_id:int = messages.ChatFull;\n```\n" ] pub struct GetFullChat { pub chat_id : :: mtproto :: int , } impl :: BoxedSerialize for GetFullChat { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x3b831c66 ) , self ) } } impl :: Function for GetFullChat { type Reply = :: mtproto :: messages :: ChatFull ; } impl :: BareSerialize for GetFullChat { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetFullChat { ref chat_id } = self ; _ser . write_bare :: < :: mtproto :: int > ( chat_id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.getGameHighScores`\n\n```text\nmessages.getGameHighScores#e822649d peer:InputPeer id:int user_id:InputUser = messages.HighScores;\n```\n" ] pub struct GetGameHighScores { pub peer : :: mtproto :: InputPeer , pub id : :: mtproto :: int , pub user_id : :: mtproto :: InputUser , } impl :: BoxedSerialize for GetGameHighScores { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xe822649d ) , self ) } } impl :: Function for GetGameHighScores { type Reply = :: mtproto :: messages :: HighScores ; } impl :: BareSerialize for GetGameHighScores { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetGameHighScores { ref peer , ref id , ref user_id } = self ; _ser . write_boxed :: < :: mtproto :: InputPeer > ( peer ) ? ; _ser . write_bare :: < :: mtproto :: int > ( id ) ? ; _ser . write_boxed :: < :: mtproto :: InputUser > ( user_id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.getHistory`\n\n```text\nmessages.getHistory#dcbb8260 peer:InputPeer offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:int = messages.Messages;\n```\n" ] pub struct GetHistory { pub peer : :: mtproto :: InputPeer , pub offset_id : :: mtproto :: int , pub offset_date : :: mtproto :: int , pub add_offset : :: mtproto :: int , pub limit : :: mtproto :: int , pub max_id : :: mtproto :: int , pub min_id : :: mtproto :: int , pub hash : :: mtproto :: int , } impl :: BoxedSerialize for GetHistory { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xdcbb8260 ) , self ) } } impl :: Function for GetHistory { type Reply = :: mtproto :: messages :: Messages ; } impl :: BareSerialize for GetHistory { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetHistory { ref peer , ref offset_id , ref offset_date , ref add_offset , ref limit , ref max_id , ref min_id , ref hash } = self ; _ser . write_boxed :: < :: mtproto :: InputPeer > ( peer ) ? ; _ser . write_bare :: < :: mtproto :: int > ( offset_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( offset_date ) ? ; _ser . write_bare :: < :: mtproto :: int > ( add_offset ) ? ; _ser . write_bare :: < :: mtproto :: int > ( limit ) ? ; _ser . write_bare :: < :: mtproto :: int > ( max_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( min_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( hash ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.getInlineBotResults`\n\n```text\nmessages.getInlineBotResults#514e999d flags:# bot:InputUser peer:InputPeer geo_point:flags.0?InputGeoPoint query:string offset:string = messages.BotResults;\n```\n" ] pub struct GetInlineBotResults { pub bot : :: mtproto :: InputUser , pub peer : :: mtproto :: InputPeer , pub geo_point : Option < :: mtproto :: InputGeoPoint > , pub query : :: mtproto :: string , pub offset : :: mtproto :: string , } impl :: BoxedSerialize for GetInlineBotResults { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x514e999d ) , self ) } } impl :: Function for GetInlineBotResults { type Reply = :: mtproto :: messages :: BotResults ; } impl :: BareSerialize for GetInlineBotResults { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetInlineBotResults { ref bot , ref peer , ref geo_point , ref query , ref offset } = self ; let mut _flags = 0i32 ; if geo_point . is_some ( ) { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_boxed :: < :: mtproto :: InputUser > ( bot ) ? ; _ser . write_boxed :: < :: mtproto :: InputPeer > ( peer ) ? ; if let & Some ( ref inner ) = geo_point { _ser . write_boxed :: < :: mtproto :: InputGeoPoint > ( inner ) ? ; } _ser . write_bare :: < :: mtproto :: string > ( query ) ? ; _ser . write_bare :: < :: mtproto :: string > ( offset ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.getInlineGameHighScores`\n\n```text\nmessages.getInlineGameHighScores#f635e1b id:InputBotInlineMessageID user_id:InputUser = messages.HighScores;\n```\n" ] pub struct GetInlineGameHighScores { pub id : :: mtproto :: InputBotInlineMessageID , pub user_id : :: mtproto :: InputUser , } impl :: BoxedSerialize for GetInlineGameHighScores { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x0f635e1b ) , self ) } } impl :: Function for GetInlineGameHighScores { type Reply = :: mtproto :: messages :: HighScores ; } impl :: BareSerialize for GetInlineGameHighScores { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetInlineGameHighScores { ref id , ref user_id } = self ; _ser . write_boxed :: < :: mtproto :: InputBotInlineMessageID > ( id ) ? ; _ser . write_boxed :: < :: mtproto :: InputUser > ( user_id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.getMaskStickers`\n\n```text\nmessages.getMaskStickers#65b8c79f hash:int = messages.AllStickers;\n```\n" ] pub struct GetMaskStickers { pub hash : :: mtproto :: int , } impl :: BoxedSerialize for GetMaskStickers { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x65b8c79f ) , self ) } } impl :: Function for GetMaskStickers { type Reply = :: mtproto :: messages :: AllStickers ; } impl :: BareSerialize for GetMaskStickers { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetMaskStickers { ref hash } = self ; _ser . write_bare :: < :: mtproto :: int > ( hash ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.getMessageEditData`\n\n```text\nmessages.getMessageEditData#fda68d36 peer:InputPeer id:int = messages.MessageEditData;\n```\n" ] pub struct GetMessageEditData { pub peer : :: mtproto :: InputPeer , pub id : :: mtproto :: int , } impl :: BoxedSerialize for GetMessageEditData { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xfda68d36 ) , self ) } } impl :: Function for GetMessageEditData { type Reply = :: mtproto :: messages :: MessageEditData ; } impl :: BareSerialize for GetMessageEditData { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetMessageEditData { ref peer , ref id } = self ; _ser . write_boxed :: < :: mtproto :: InputPeer > ( peer ) ? ; _ser . write_bare :: < :: mtproto :: int > ( id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.getMessages`\n\n```text\nmessages.getMessages#4222fa74 id:Vector<int> = messages.Messages;\n```\n" ] pub struct GetMessages { pub id : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > , } impl :: BoxedSerialize for GetMessages { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x4222fa74 ) , self ) } } impl :: Function for GetMessages { type Reply = :: mtproto :: messages :: Messages ; } impl :: BareSerialize for GetMessages { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetMessages { ref id } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > > ( id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.getMessagesViews`\n\n```text\nmessages.getMessagesViews#c4c8a55d peer:InputPeer id:Vector<int> increment:Bool = Vector<int>;\n```\n" ] pub struct GetMessagesViews { pub peer : :: mtproto :: InputPeer , pub id : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > , pub increment : :: mtproto :: Bool , } impl :: BoxedSerialize for GetMessagesViews { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xc4c8a55d ) , self ) } } impl :: Function for GetMessagesViews { type Reply = :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > ; } impl :: BareSerialize for GetMessagesViews { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetMessagesViews { ref peer , ref id , ref increment } = self ; _ser . write_boxed :: < :: mtproto :: InputPeer > ( peer ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > > ( id ) ? ; _ser . write_boxed :: < :: mtproto :: Bool > ( increment ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.getPeerDialogs`\n\n```text\nmessages.getPeerDialogs#2d9776b9 peers:Vector<InputPeer> = messages.PeerDialogs;\n```\n" ] pub struct GetPeerDialogs { pub peers : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputPeer > , } impl :: BoxedSerialize for GetPeerDialogs { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x2d9776b9 ) , self ) } } impl :: Function for GetPeerDialogs { type Reply = :: mtproto :: messages :: PeerDialogs ; } impl :: BareSerialize for GetPeerDialogs { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetPeerDialogs { ref peers } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputPeer > > ( peers ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.getPeerSettings`\n\n```text\nmessages.getPeerSettings#3672e09c peer:InputPeer = PeerSettings;\n```\n" ] pub struct GetPeerSettings { pub peer : :: mtproto :: InputPeer , } impl :: BoxedSerialize for GetPeerSettings { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x3672e09c ) , self ) } } impl :: Function for GetPeerSettings { type Reply = :: mtproto :: PeerSettings ; } impl :: BareSerialize for GetPeerSettings { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetPeerSettings { ref peer } = self ; _ser . write_boxed :: < :: mtproto :: InputPeer > ( peer ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.getPinnedDialogs`\n\n```text\nmessages.getPinnedDialogs#e254d64e = messages.PeerDialogs;\n```\n" ] pub struct GetPinnedDialogs ; impl :: BoxedSerialize for GetPinnedDialogs { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xe254d64e ) , self ) } } impl :: Function for GetPinnedDialogs { type Reply = :: mtproto :: messages :: PeerDialogs ; } impl :: BareSerialize for GetPinnedDialogs { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.getRecentLocations`\n\n```text\nmessages.getRecentLocations#249431e2 peer:InputPeer limit:int = messages.Messages;\n```\n" ] pub struct GetRecentLocations { pub peer : :: mtproto :: InputPeer , pub limit : :: mtproto :: int , } impl :: BoxedSerialize for GetRecentLocations { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x249431e2 ) , self ) } } impl :: Function for GetRecentLocations { type Reply = :: mtproto :: messages :: Messages ; } impl :: BareSerialize for GetRecentLocations { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetRecentLocations { ref peer , ref limit } = self ; _ser . write_boxed :: < :: mtproto :: InputPeer > ( peer ) ? ; _ser . write_bare :: < :: mtproto :: int > ( limit ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.getRecentStickers`\n\n```text\nmessages.getRecentStickers#5ea192c9 flags:# attached:flags.0?true hash:int = messages.RecentStickers;\n```\n" ] pub struct GetRecentStickers { pub attached : bool , pub hash : :: mtproto :: int , } impl :: BoxedSerialize for GetRecentStickers { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x5ea192c9 ) , self ) } } impl :: Function for GetRecentStickers { type Reply = :: mtproto :: messages :: RecentStickers ; } impl :: BareSerialize for GetRecentStickers { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetRecentStickers { attached , ref hash } = self ; let mut _flags = 0i32 ; if attached { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: int > ( hash ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.getSavedGifs`\n\n```text\nmessages.getSavedGifs#83bf3d52 hash:int = messages.SavedGifs;\n```\n" ] pub struct GetSavedGifs { pub hash : :: mtproto :: int , } impl :: BoxedSerialize for GetSavedGifs { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x83bf3d52 ) , self ) } } impl :: Function for GetSavedGifs { type Reply = :: mtproto :: messages :: SavedGifs ; } impl :: BareSerialize for GetSavedGifs { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetSavedGifs { ref hash } = self ; _ser . write_bare :: < :: mtproto :: int > ( hash ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.getStickerSet`\n\n```text\nmessages.getStickerSet#2619a90e stickerset:InputStickerSet = messages.StickerSet;\n```\n" ] pub struct GetStickerSet { pub stickerset : :: mtproto :: InputStickerSet , } impl :: BoxedSerialize for GetStickerSet { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x2619a90e ) , self ) } } impl :: Function for GetStickerSet { type Reply = :: mtproto :: messages :: StickerSet ; } impl :: BareSerialize for GetStickerSet { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetStickerSet { ref stickerset } = self ; _ser . write_boxed :: < :: mtproto :: InputStickerSet > ( stickerset ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.getUnreadMentions`\n\n```text\nmessages.getUnreadMentions#46578472 peer:InputPeer offset_id:int add_offset:int limit:int max_id:int min_id:int = messages.Messages;\n```\n" ] pub struct GetUnreadMentions { pub peer : :: mtproto :: InputPeer , pub offset_id : :: mtproto :: int , pub add_offset : :: mtproto :: int , pub limit : :: mtproto :: int , pub max_id : :: mtproto :: int , pub min_id : :: mtproto :: int , } impl :: BoxedSerialize for GetUnreadMentions { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x46578472 ) , self ) } } impl :: Function for GetUnreadMentions { type Reply = :: mtproto :: messages :: Messages ; } impl :: BareSerialize for GetUnreadMentions { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetUnreadMentions { ref peer , ref offset_id , ref add_offset , ref limit , ref max_id , ref min_id } = self ; _ser . write_boxed :: < :: mtproto :: InputPeer > ( peer ) ? ; _ser . write_bare :: < :: mtproto :: int > ( offset_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( add_offset ) ? ; _ser . write_bare :: < :: mtproto :: int > ( limit ) ? ; _ser . write_bare :: < :: mtproto :: int > ( max_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( min_id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.getWebPage`\n\n```text\nmessages.getWebPage#32ca8f91 url:string hash:int = WebPage;\n```\n" ] pub struct GetWebPage { pub url : :: mtproto :: string , pub hash : :: mtproto :: int , } impl :: BoxedSerialize for GetWebPage { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x32ca8f91 ) , self ) } } impl :: Function for GetWebPage { type Reply = :: mtproto :: WebPage ; } impl :: BareSerialize for GetWebPage { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetWebPage { ref url , ref hash } = self ; _ser . write_bare :: < :: mtproto :: string > ( url ) ? ; _ser . write_bare :: < :: mtproto :: int > ( hash ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.getWebPagePreview`\n\n```text\nmessages.getWebPagePreview#25223e24 message:string = MessageMedia;\n```\n" ] pub struct GetWebPagePreview { pub message : :: mtproto :: string , } impl :: BoxedSerialize for GetWebPagePreview { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x25223e24 ) , self ) } } impl :: Function for GetWebPagePreview { type Reply = :: mtproto :: MessageMedia ; } impl :: BareSerialize for GetWebPagePreview { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetWebPagePreview { ref message } = self ; _ser . write_bare :: < :: mtproto :: string > ( message ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.hideReportSpam`\n\n```text\nmessages.hideReportSpam#a8f1709b peer:InputPeer = Bool;\n```\n" ] pub struct HideReportSpam { pub peer : :: mtproto :: InputPeer , } impl :: BoxedSerialize for HideReportSpam { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xa8f1709b ) , self ) } } impl :: Function for HideReportSpam { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for HideReportSpam { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & HideReportSpam { ref peer } = self ; _ser . write_boxed :: < :: mtproto :: InputPeer > ( peer ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.importChatInvite`\n\n```text\nmessages.importChatInvite#6c50051c hash:string = Updates;\n```\n" ] pub struct ImportChatInvite { pub hash : :: mtproto :: string , } impl :: BoxedSerialize for ImportChatInvite { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x6c50051c ) , self ) } } impl :: Function for ImportChatInvite { type Reply = :: mtproto :: Updates ; } impl :: BareSerialize for ImportChatInvite { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ImportChatInvite { ref hash } = self ; _ser . write_bare :: < :: mtproto :: string > ( hash ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.installStickerSet`\n\n```text\nmessages.installStickerSet#c78fe460 stickerset:InputStickerSet archived:Bool = messages.StickerSetInstallResult;\n```\n" ] pub struct InstallStickerSet { pub stickerset : :: mtproto :: InputStickerSet , pub archived : :: mtproto :: Bool , } impl :: BoxedSerialize for InstallStickerSet { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xc78fe460 ) , self ) } } impl :: Function for InstallStickerSet { type Reply = :: mtproto :: messages :: StickerSetInstallResult ; } impl :: BareSerialize for InstallStickerSet { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & InstallStickerSet { ref stickerset , ref archived } = self ; _ser . write_boxed :: < :: mtproto :: InputStickerSet > ( stickerset ) ? ; _ser . write_boxed :: < :: mtproto :: Bool > ( archived ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.migrateChat`\n\n```text\nmessages.migrateChat#15a3b8e3 chat_id:int = Updates;\n```\n" ] pub struct MigrateChat { pub chat_id : :: mtproto :: int , } impl :: BoxedSerialize for MigrateChat { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x15a3b8e3 ) , self ) } } impl :: Function for MigrateChat { type Reply = :: mtproto :: Updates ; } impl :: BareSerialize for MigrateChat { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & MigrateChat { ref chat_id } = self ; _ser . write_bare :: < :: mtproto :: int > ( chat_id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.readEncryptedHistory`\n\n```text\nmessages.readEncryptedHistory#7f4b690a peer:InputEncryptedChat max_date:int = Bool;\n```\n" ] pub struct ReadEncryptedHistory { pub peer : :: mtproto :: InputEncryptedChat , pub max_date : :: mtproto :: int , } impl :: BoxedSerialize for ReadEncryptedHistory { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x7f4b690a ) , self ) } } impl :: Function for ReadEncryptedHistory { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for ReadEncryptedHistory { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ReadEncryptedHistory { ref peer , ref max_date } = self ; _ser . write_boxed :: < :: mtproto :: InputEncryptedChat > ( peer ) ? ; _ser . write_bare :: < :: mtproto :: int > ( max_date ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.readFeaturedStickers`\n\n```text\nmessages.readFeaturedStickers#5b118126 id:Vector<long> = Bool;\n```\n" ] pub struct ReadFeaturedStickers { pub id : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > , } impl :: BoxedSerialize for ReadFeaturedStickers { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x5b118126 ) , self ) } } impl :: Function for ReadFeaturedStickers { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for ReadFeaturedStickers { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ReadFeaturedStickers { ref id } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > > ( id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.readHistory`\n\n```text\nmessages.readHistory#e306d3a peer:InputPeer max_id:int = messages.AffectedMessages;\n```\n" ] pub struct ReadHistory { pub peer : :: mtproto :: InputPeer , pub max_id : :: mtproto :: int , } impl :: BoxedSerialize for ReadHistory { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x0e306d3a ) , self ) } } impl :: Function for ReadHistory { type Reply = :: mtproto :: messages :: AffectedMessages ; } impl :: BareSerialize for ReadHistory { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ReadHistory { ref peer , ref max_id } = self ; _ser . write_boxed :: < :: mtproto :: InputPeer > ( peer ) ? ; _ser . write_bare :: < :: mtproto :: int > ( max_id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.readMentions`\n\n```text\nmessages.readMentions#f0189d3 peer:InputPeer = messages.AffectedHistory;\n```\n" ] pub struct ReadMentions { pub peer : :: mtproto :: InputPeer , } impl :: BoxedSerialize for ReadMentions { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x0f0189d3 ) , self ) } } impl :: Function for ReadMentions { type Reply = :: mtproto :: messages :: AffectedHistory ; } impl :: BareSerialize for ReadMentions { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ReadMentions { ref peer } = self ; _ser . write_boxed :: < :: mtproto :: InputPeer > ( peer ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.readMessageContents`\n\n```text\nmessages.readMessageContents#36a73f77 id:Vector<int> = messages.AffectedMessages;\n```\n" ] pub struct ReadMessageContents { pub id : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > , } impl :: BoxedSerialize for ReadMessageContents { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x36a73f77 ) , self ) } } impl :: Function for ReadMessageContents { type Reply = :: mtproto :: messages :: AffectedMessages ; } impl :: BareSerialize for ReadMessageContents { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ReadMessageContents { ref id } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > > ( id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.receivedMessages`\n\n```text\nmessages.receivedMessages#5a954c0 max_id:int = Vector<ReceivedNotifyMessage>;\n```\n" ] pub struct ReceivedMessages { pub max_id : :: mtproto :: int , } impl :: BoxedSerialize for ReceivedMessages { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x05a954c0 ) , self ) } } impl :: Function for ReceivedMessages { type Reply = :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: ReceivedNotifyMessage > ; } impl :: BareSerialize for ReceivedMessages { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ReceivedMessages { ref max_id } = self ; _ser . write_bare :: < :: mtproto :: int > ( max_id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.receivedQueue`\n\n```text\nmessages.receivedQueue#55a5bb66 max_qts:int = Vector<long>;\n```\n" ] pub struct ReceivedQueue { pub max_qts : :: mtproto :: int , } impl :: BoxedSerialize for ReceivedQueue { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x55a5bb66 ) , self ) } } impl :: Function for ReceivedQueue { type Reply = :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > ; } impl :: BareSerialize for ReceivedQueue { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ReceivedQueue { ref max_qts } = self ; _ser . write_bare :: < :: mtproto :: int > ( max_qts ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.reorderPinnedDialogs`\n\n```text\nmessages.reorderPinnedDialogs#959ff644 flags:# force:flags.0?true order:Vector<InputPeer> = Bool;\n```\n" ] pub struct ReorderPinnedDialogs { pub force : bool , pub order : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputPeer > , } impl :: BoxedSerialize for ReorderPinnedDialogs { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x959ff644 ) , self ) } } impl :: Function for ReorderPinnedDialogs { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for ReorderPinnedDialogs { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ReorderPinnedDialogs { force , ref order } = self ; let mut _flags = 0i32 ; if force { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputPeer > > ( order ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.reorderStickerSets`\n\n```text\nmessages.reorderStickerSets#78337739 flags:# masks:flags.0?true order:Vector<long> = Bool;\n```\n" ] pub struct ReorderStickerSets { pub masks : bool , pub order : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > , } impl :: BoxedSerialize for ReorderStickerSets { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x78337739 ) , self ) } } impl :: Function for ReorderStickerSets { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for ReorderStickerSets { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ReorderStickerSets { masks , ref order } = self ; let mut _flags = 0i32 ; if masks { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > > ( order ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.reportEncryptedSpam`\n\n```text\nmessages.reportEncryptedSpam#4b0c8c0f peer:InputEncryptedChat = Bool;\n```\n" ] pub struct ReportEncryptedSpam { pub peer : :: mtproto :: InputEncryptedChat , } impl :: BoxedSerialize for ReportEncryptedSpam { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x4b0c8c0f ) , self ) } } impl :: Function for ReportEncryptedSpam { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for ReportEncryptedSpam { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ReportEncryptedSpam { ref peer } = self ; _ser . write_boxed :: < :: mtproto :: InputEncryptedChat > ( peer ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.reportSpam`\n\n```text\nmessages.reportSpam#cf1592db peer:InputPeer = Bool;\n```\n" ] pub struct ReportSpam { pub peer : :: mtproto :: InputPeer , } impl :: BoxedSerialize for ReportSpam { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xcf1592db ) , self ) } } impl :: Function for ReportSpam { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for ReportSpam { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ReportSpam { ref peer } = self ; _ser . write_boxed :: < :: mtproto :: InputPeer > ( peer ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.requestEncryption`\n\n```text\nmessages.requestEncryption#f64daf43 user_id:InputUser random_id:int g_a:bytes = EncryptedChat;\n```\n" ] pub struct RequestEncryption { pub user_id : :: mtproto :: InputUser , pub random_id : :: mtproto :: int , pub g_a : :: mtproto :: bytes , } impl :: BoxedSerialize for RequestEncryption { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xf64daf43 ) , self ) } } impl :: Function for RequestEncryption { type Reply = :: mtproto :: EncryptedChat ; } impl :: BareSerialize for RequestEncryption { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & RequestEncryption { ref user_id , ref random_id , ref g_a } = self ; _ser . write_boxed :: < :: mtproto :: InputUser > ( user_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( random_id ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( g_a ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.saveDraft`\n\n```text\nmessages.saveDraft#bc39e14b flags:# no_webpage:flags.1?true reply_to_msg_id:flags.0?int peer:InputPeer message:string entities:flags.3?Vector<MessageEntity> = Bool;\n```\n" ] pub struct SaveDraft { pub no_webpage : bool , pub reply_to_msg_id : Option < :: mtproto :: int > , pub peer : :: mtproto :: InputPeer , pub message : :: mtproto :: string , pub entities : Option < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: MessageEntity > > , } impl :: BoxedSerialize for SaveDraft { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xbc39e14b ) , self ) } } impl :: Function for SaveDraft { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for SaveDraft { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & SaveDraft { no_webpage , ref reply_to_msg_id , ref peer , ref message , ref entities } = self ; let mut _flags = 0i32 ; if no_webpage { _flags |= 1 << 1u32 ; } if reply_to_msg_id . is_some ( ) { _flags |= 1 << 0u32 ; } if entities . is_some ( ) { _flags |= 1 << 3u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; if let & Some ( ref inner ) = reply_to_msg_id { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } _ser . write_boxed :: < :: mtproto :: InputPeer > ( peer ) ? ; _ser . write_bare :: < :: mtproto :: string > ( message ) ? ; if let & Some ( ref inner ) = entities { _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: MessageEntity > > ( inner ) ? ; } Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.saveGif`\n\n```text\nmessages.saveGif#327a30cb id:InputDocument unsave:Bool = Bool;\n```\n" ] pub struct SaveGif { pub id : :: mtproto :: InputDocument , pub unsave : :: mtproto :: Bool , } impl :: BoxedSerialize for SaveGif { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x327a30cb ) , self ) } } impl :: Function for SaveGif { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for SaveGif { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & SaveGif { ref id , ref unsave } = self ; _ser . write_boxed :: < :: mtproto :: InputDocument > ( id ) ? ; _ser . write_boxed :: < :: mtproto :: Bool > ( unsave ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.saveRecentSticker`\n\n```text\nmessages.saveRecentSticker#392718f8 flags:# attached:flags.0?true id:InputDocument unsave:Bool = Bool;\n```\n" ] pub struct SaveRecentSticker { pub attached : bool , pub id : :: mtproto :: InputDocument , pub unsave : :: mtproto :: Bool , } impl :: BoxedSerialize for SaveRecentSticker { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x392718f8 ) , self ) } } impl :: Function for SaveRecentSticker { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for SaveRecentSticker { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & SaveRecentSticker { attached , ref id , ref unsave } = self ; let mut _flags = 0i32 ; if attached { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_boxed :: < :: mtproto :: InputDocument > ( id ) ? ; _ser . write_boxed :: < :: mtproto :: Bool > ( unsave ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.search`\n\n```text\nmessages.search#39e9ea0 flags:# peer:InputPeer q:string from_id:flags.0?InputUser filter:MessagesFilter min_date:int max_date:int offset_id:int add_offset:int limit:int max_id:int min_id:int = messages.Messages;\n```\n" ] pub struct Search { pub peer : :: mtproto :: InputPeer , pub q : :: mtproto :: string , pub from_id : Option < :: mtproto :: InputUser > , pub filter : :: mtproto :: MessagesFilter , pub min_date : :: mtproto :: int , pub max_date : :: mtproto :: int , pub offset_id : :: mtproto :: int , pub add_offset : :: mtproto :: int , pub limit : :: mtproto :: int , pub max_id : :: mtproto :: int , pub min_id : :: mtproto :: int , } impl :: BoxedSerialize for Search { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x039e9ea0 ) , self ) } } impl :: Function for Search { type Reply = :: mtproto :: messages :: Messages ; } impl :: BareSerialize for Search { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Search { ref peer , ref q , ref from_id , ref filter , ref min_date , ref max_date , ref offset_id , ref add_offset , ref limit , ref max_id , ref min_id } = self ; let mut _flags = 0i32 ; if from_id . is_some ( ) { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_boxed :: < :: mtproto :: InputPeer > ( peer ) ? ; _ser . write_bare :: < :: mtproto :: string > ( q ) ? ; if let & Some ( ref inner ) = from_id { _ser . write_boxed :: < :: mtproto :: InputUser > ( inner ) ? ; } _ser . write_boxed :: < :: mtproto :: MessagesFilter > ( filter ) ? ; _ser . write_bare :: < :: mtproto :: int > ( min_date ) ? ; _ser . write_bare :: < :: mtproto :: int > ( max_date ) ? ; _ser . write_bare :: < :: mtproto :: int > ( offset_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( add_offset ) ? ; _ser . write_bare :: < :: mtproto :: int > ( limit ) ? ; _ser . write_bare :: < :: mtproto :: int > ( max_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( min_id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.searchGifs`\n\n```text\nmessages.searchGifs#bf9a776b q:string offset:int = messages.FoundGifs;\n```\n" ] pub struct SearchGifs { pub q : :: mtproto :: string , pub offset : :: mtproto :: int , } impl :: BoxedSerialize for SearchGifs { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xbf9a776b ) , self ) } } impl :: Function for SearchGifs { type Reply = :: mtproto :: messages :: FoundGifs ; } impl :: BareSerialize for SearchGifs { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & SearchGifs { ref q , ref offset } = self ; _ser . write_bare :: < :: mtproto :: string > ( q ) ? ; _ser . write_bare :: < :: mtproto :: int > ( offset ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.searchGlobal`\n\n```text\nmessages.searchGlobal#9e3cacb0 q:string offset_date:int offset_peer:InputPeer offset_id:int limit:int = messages.Messages;\n```\n" ] pub struct SearchGlobal { pub q : :: mtproto :: string , pub offset_date : :: mtproto :: int , pub offset_peer : :: mtproto :: InputPeer , pub offset_id : :: mtproto :: int , pub limit : :: mtproto :: int , } impl :: BoxedSerialize for SearchGlobal { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x9e3cacb0 ) , self ) } } impl :: Function for SearchGlobal { type Reply = :: mtproto :: messages :: Messages ; } impl :: BareSerialize for SearchGlobal { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & SearchGlobal { ref q , ref offset_date , ref offset_peer , ref offset_id , ref limit } = self ; _ser . write_bare :: < :: mtproto :: string > ( q ) ? ; _ser . write_bare :: < :: mtproto :: int > ( offset_date ) ? ; _ser . write_boxed :: < :: mtproto :: InputPeer > ( offset_peer ) ? ; _ser . write_bare :: < :: mtproto :: int > ( offset_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( limit ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.sendEncrypted`\n\n```text\nmessages.sendEncrypted#a9776773 peer:InputEncryptedChat random_id:long data:bytes = messages.SentEncryptedMessage;\n```\n" ] pub struct SendEncrypted { pub peer : :: mtproto :: InputEncryptedChat , pub random_id : :: mtproto :: long , pub data : :: mtproto :: bytes , } impl :: BoxedSerialize for SendEncrypted { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xa9776773 ) , self ) } } impl :: Function for SendEncrypted { type Reply = :: mtproto :: messages :: SentEncryptedMessage ; } impl :: BareSerialize for SendEncrypted { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & SendEncrypted { ref peer , ref random_id , ref data } = self ; _ser . write_boxed :: < :: mtproto :: InputEncryptedChat > ( peer ) ? ; _ser . write_bare :: < :: mtproto :: long > ( random_id ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( data ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.sendEncryptedFile`\n\n```text\nmessages.sendEncryptedFile#9a901b66 peer:InputEncryptedChat random_id:long data:bytes file:InputEncryptedFile = messages.SentEncryptedMessage;\n```\n" ] pub struct SendEncryptedFile { pub peer : :: mtproto :: InputEncryptedChat , pub random_id : :: mtproto :: long , pub data : :: mtproto :: bytes , pub file : :: mtproto :: InputEncryptedFile , } impl :: BoxedSerialize for SendEncryptedFile { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x9a901b66 ) , self ) } } impl :: Function for SendEncryptedFile { type Reply = :: mtproto :: messages :: SentEncryptedMessage ; } impl :: BareSerialize for SendEncryptedFile { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & SendEncryptedFile { ref peer , ref random_id , ref data , ref file } = self ; _ser . write_boxed :: < :: mtproto :: InputEncryptedChat > ( peer ) ? ; _ser . write_bare :: < :: mtproto :: long > ( random_id ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( data ) ? ; _ser . write_boxed :: < :: mtproto :: InputEncryptedFile > ( file ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.sendEncryptedService`\n\n```text\nmessages.sendEncryptedService#32d439a4 peer:InputEncryptedChat random_id:long data:bytes = messages.SentEncryptedMessage;\n```\n" ] pub struct SendEncryptedService { pub peer : :: mtproto :: InputEncryptedChat , pub random_id : :: mtproto :: long , pub data : :: mtproto :: bytes , } impl :: BoxedSerialize for SendEncryptedService { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x32d439a4 ) , self ) } } impl :: Function for SendEncryptedService { type Reply = :: mtproto :: messages :: SentEncryptedMessage ; } impl :: BareSerialize for SendEncryptedService { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & SendEncryptedService { ref peer , ref random_id , ref data } = self ; _ser . write_boxed :: < :: mtproto :: InputEncryptedChat > ( peer ) ? ; _ser . write_bare :: < :: mtproto :: long > ( random_id ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( data ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.sendInlineBotResult`\n\n```text\nmessages.sendInlineBotResult#b16e06fe flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int random_id:long query_id:long id:string = Updates;\n```\n" ] pub struct SendInlineBotResult { pub silent : bool , pub background : bool , pub clear_draft : bool , pub peer : :: mtproto :: InputPeer , pub reply_to_msg_id : Option < :: mtproto :: int > , pub random_id : :: mtproto :: long , pub query_id : :: mtproto :: long , pub id : :: mtproto :: string , } impl :: BoxedSerialize for SendInlineBotResult { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xb16e06fe ) , self ) } } impl :: Function for SendInlineBotResult { type Reply = :: mtproto :: Updates ; } impl :: BareSerialize for SendInlineBotResult { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & SendInlineBotResult { silent , background , clear_draft , ref peer , ref reply_to_msg_id , ref random_id , ref query_id , ref id } = self ; let mut _flags = 0i32 ; if silent { _flags |= 1 << 5u32 ; } if background { _flags |= 1 << 6u32 ; } if clear_draft { _flags |= 1 << 7u32 ; } if reply_to_msg_id . is_some ( ) { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_boxed :: < :: mtproto :: InputPeer > ( peer ) ? ; if let & Some ( ref inner ) = reply_to_msg_id { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } _ser . write_bare :: < :: mtproto :: long > ( random_id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( query_id ) ? ; _ser . write_bare :: < :: mtproto :: string > ( id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.sendMedia`\n\n```text\nmessages.sendMedia#c8f16791 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int media:InputMedia random_id:long reply_markup:flags.2?ReplyMarkup = Updates;\n```\n" ] pub struct SendMedia { pub silent : bool , pub background : bool , pub clear_draft : bool , pub peer : :: mtproto :: InputPeer , pub reply_to_msg_id : Option < :: mtproto :: int > , pub media : :: mtproto :: InputMedia , pub random_id : :: mtproto :: long , pub reply_markup : Option < :: mtproto :: ReplyMarkup > , } impl :: BoxedSerialize for SendMedia { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xc8f16791 ) , self ) } } impl :: Function for SendMedia { type Reply = :: mtproto :: Updates ; } impl :: BareSerialize for SendMedia { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & SendMedia { silent , background , clear_draft , ref peer , ref reply_to_msg_id , ref media , ref random_id , ref reply_markup } = self ; let mut _flags = 0i32 ; if silent { _flags |= 1 << 5u32 ; } if background { _flags |= 1 << 6u32 ; } if clear_draft { _flags |= 1 << 7u32 ; } if reply_to_msg_id . is_some ( ) { _flags |= 1 << 0u32 ; } if reply_markup . is_some ( ) { _flags |= 1 << 2u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_boxed :: < :: mtproto :: InputPeer > ( peer ) ? ; if let & Some ( ref inner ) = reply_to_msg_id { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } _ser . write_boxed :: < :: mtproto :: InputMedia > ( media ) ? ; _ser . write_bare :: < :: mtproto :: long > ( random_id ) ? ; if let & Some ( ref inner ) = reply_markup { _ser . write_boxed :: < :: mtproto :: ReplyMarkup > ( inner ) ? ; } Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.sendMessage`\n\n```text\nmessages.sendMessage#fa88427a flags:# no_webpage:flags.1?true silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> = Updates;\n```\n" ] pub struct SendMessage { pub no_webpage : bool , pub silent : bool , pub background : bool , pub clear_draft : bool , pub peer : :: mtproto :: InputPeer , pub reply_to_msg_id : Option < :: mtproto :: int > , pub message : :: mtproto :: string , pub random_id : :: mtproto :: long , pub reply_markup : Option < :: mtproto :: ReplyMarkup > , pub entities : Option < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: MessageEntity > > , } impl :: BoxedSerialize for SendMessage { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xfa88427a ) , self ) } } impl :: Function for SendMessage { type Reply = :: mtproto :: Updates ; } impl :: BareSerialize for SendMessage { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & SendMessage { no_webpage , silent , background , clear_draft , ref peer , ref reply_to_msg_id , ref message , ref random_id , ref reply_markup , ref entities } = self ; let mut _flags = 0i32 ; if no_webpage { _flags |= 1 << 1u32 ; } if silent { _flags |= 1 << 5u32 ; } if background { _flags |= 1 << 6u32 ; } if clear_draft { _flags |= 1 << 7u32 ; } if reply_to_msg_id . is_some ( ) { _flags |= 1 << 0u32 ; } if reply_markup . is_some ( ) { _flags |= 1 << 2u32 ; } if entities . is_some ( ) { _flags |= 1 << 3u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_boxed :: < :: mtproto :: InputPeer > ( peer ) ? ; if let & Some ( ref inner ) = reply_to_msg_id { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } _ser . write_bare :: < :: mtproto :: string > ( message ) ? ; _ser . write_bare :: < :: mtproto :: long > ( random_id ) ? ; if let & Some ( ref inner ) = reply_markup { _ser . write_boxed :: < :: mtproto :: ReplyMarkup > ( inner ) ? ; } if let & Some ( ref inner ) = entities { _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: MessageEntity > > ( inner ) ? ; } Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.sendMultiMedia`\n\n```text\nmessages.sendMultiMedia#2095512f flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int multi_media:Vector<InputSingleMedia> = Updates;\n```\n" ] pub struct SendMultiMedia { pub silent : bool , pub background : bool , pub clear_draft : bool , pub peer : :: mtproto :: InputPeer , pub reply_to_msg_id : Option < :: mtproto :: int > , pub multi_media : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputSingleMedia > , } impl :: BoxedSerialize for SendMultiMedia { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x2095512f ) , self ) } } impl :: Function for SendMultiMedia { type Reply = :: mtproto :: Updates ; } impl :: BareSerialize for SendMultiMedia { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & SendMultiMedia { silent , background , clear_draft , ref peer , ref reply_to_msg_id , ref multi_media } = self ; let mut _flags = 0i32 ; if silent { _flags |= 1 << 5u32 ; } if background { _flags |= 1 << 6u32 ; } if clear_draft { _flags |= 1 << 7u32 ; } if reply_to_msg_id . is_some ( ) { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_boxed :: < :: mtproto :: InputPeer > ( peer ) ? ; if let & Some ( ref inner ) = reply_to_msg_id { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputSingleMedia > > ( multi_media ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.sendScreenshotNotification`\n\n```text\nmessages.sendScreenshotNotification#c97df020 peer:InputPeer reply_to_msg_id:int random_id:long = Updates;\n```\n" ] pub struct SendScreenshotNotification { pub peer : :: mtproto :: InputPeer , pub reply_to_msg_id : :: mtproto :: int , pub random_id : :: mtproto :: long , } impl :: BoxedSerialize for SendScreenshotNotification { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xc97df020 ) , self ) } } impl :: Function for SendScreenshotNotification { type Reply = :: mtproto :: Updates ; } impl :: BareSerialize for SendScreenshotNotification { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & SendScreenshotNotification { ref peer , ref reply_to_msg_id , ref random_id } = self ; _ser . write_boxed :: < :: mtproto :: InputPeer > ( peer ) ? ; _ser . write_bare :: < :: mtproto :: int > ( reply_to_msg_id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( random_id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.setBotCallbackAnswer`\n\n```text\nmessages.setBotCallbackAnswer#d58f130a flags:# alert:flags.1?true query_id:long message:flags.0?string url:flags.2?string cache_time:int = Bool;\n```\n" ] pub struct SetBotCallbackAnswer { pub alert : bool , pub query_id : :: mtproto :: long , pub message : Option < :: mtproto :: string > , pub url : Option < :: mtproto :: string > , pub cache_time : :: mtproto :: int , } impl :: BoxedSerialize for SetBotCallbackAnswer { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xd58f130a ) , self ) } } impl :: Function for SetBotCallbackAnswer { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for SetBotCallbackAnswer { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & SetBotCallbackAnswer { alert , ref query_id , ref message , ref url , ref cache_time } = self ; let mut _flags = 0i32 ; if alert { _flags |= 1 << 1u32 ; } if message . is_some ( ) { _flags |= 1 << 0u32 ; } if url . is_some ( ) { _flags |= 1 << 2u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: long > ( query_id ) ? ; if let & Some ( ref inner ) = message { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = url { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } _ser . write_bare :: < :: mtproto :: int > ( cache_time ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.setBotPrecheckoutResults`\n\n```text\nmessages.setBotPrecheckoutResults#9c2dd95 flags:# success:flags.1?true query_id:long error:flags.0?string = Bool;\n```\n" ] pub struct SetBotPrecheckoutResults { pub success : bool , pub query_id : :: mtproto :: long , pub error : Option < :: mtproto :: string > , } impl :: BoxedSerialize for SetBotPrecheckoutResults { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x09c2dd95 ) , self ) } } impl :: Function for SetBotPrecheckoutResults { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for SetBotPrecheckoutResults { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & SetBotPrecheckoutResults { success , ref query_id , ref error } = self ; let mut _flags = 0i32 ; if success { _flags |= 1 << 1u32 ; } if error . is_some ( ) { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: long > ( query_id ) ? ; if let & Some ( ref inner ) = error { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.setBotShippingResults`\n\n```text\nmessages.setBotShippingResults#e5f672fa flags:# query_id:long error:flags.0?string shipping_options:flags.1?Vector<ShippingOption> = Bool;\n```\n" ] pub struct SetBotShippingResults { pub query_id : :: mtproto :: long , pub error : Option < :: mtproto :: string > , pub shipping_options : Option < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: ShippingOption > > , } impl :: BoxedSerialize for SetBotShippingResults { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xe5f672fa ) , self ) } } impl :: Function for SetBotShippingResults { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for SetBotShippingResults { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & SetBotShippingResults { ref query_id , ref error , ref shipping_options } = self ; let mut _flags = 0i32 ; if error . is_some ( ) { _flags |= 1 << 0u32 ; } if shipping_options . is_some ( ) { _flags |= 1 << 1u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: long > ( query_id ) ? ; if let & Some ( ref inner ) = error { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = shipping_options { _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: ShippingOption > > ( inner ) ? ; } Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.setEncryptedTyping`\n\n```text\nmessages.setEncryptedTyping#791451ed peer:InputEncryptedChat typing:Bool = Bool;\n```\n" ] pub struct SetEncryptedTyping { pub peer : :: mtproto :: InputEncryptedChat , pub typing : :: mtproto :: Bool , } impl :: BoxedSerialize for SetEncryptedTyping { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x791451ed ) , self ) } } impl :: Function for SetEncryptedTyping { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for SetEncryptedTyping { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & SetEncryptedTyping { ref peer , ref typing } = self ; _ser . write_boxed :: < :: mtproto :: InputEncryptedChat > ( peer ) ? ; _ser . write_boxed :: < :: mtproto :: Bool > ( typing ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.setGameScore`\n\n```text\nmessages.setGameScore#8ef8ecc0 flags:# edit_message:flags.0?true force:flags.1?true peer:InputPeer id:int user_id:InputUser score:int = Updates;\n```\n" ] pub struct SetGameScore { pub edit_message : bool , pub force : bool , pub peer : :: mtproto :: InputPeer , pub id : :: mtproto :: int , pub user_id : :: mtproto :: InputUser , pub score : :: mtproto :: int , } impl :: BoxedSerialize for SetGameScore { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x8ef8ecc0 ) , self ) } } impl :: Function for SetGameScore { type Reply = :: mtproto :: Updates ; } impl :: BareSerialize for SetGameScore { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & SetGameScore { edit_message , force , ref peer , ref id , ref user_id , ref score } = self ; let mut _flags = 0i32 ; if edit_message { _flags |= 1 << 0u32 ; } if force { _flags |= 1 << 1u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_boxed :: < :: mtproto :: InputPeer > ( peer ) ? ; _ser . write_bare :: < :: mtproto :: int > ( id ) ? ; _ser . write_boxed :: < :: mtproto :: InputUser > ( user_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( score ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.setInlineBotResults`\n\n```text\nmessages.setInlineBotResults#eb5ea206 flags:# gallery:flags.0?true private:flags.1?true query_id:long results:Vector<InputBotInlineResult> cache_time:int next_offset:flags.2?string switch_pm:flags.3?InlineBotSwitchPM = Bool;\n```\n" ] pub struct SetInlineBotResults { pub gallery : bool , pub private : bool , pub query_id : :: mtproto :: long , pub results : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputBotInlineResult > , pub cache_time : :: mtproto :: int , pub next_offset : Option < :: mtproto :: string > , pub switch_pm : Option < :: mtproto :: InlineBotSwitchPM > , } impl :: BoxedSerialize for SetInlineBotResults { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xeb5ea206 ) , self ) } } impl :: Function for SetInlineBotResults { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for SetInlineBotResults { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & SetInlineBotResults { gallery , private , ref query_id , ref results , ref cache_time , ref next_offset , ref switch_pm } = self ; let mut _flags = 0i32 ; if gallery { _flags |= 1 << 0u32 ; } if private { _flags |= 1 << 1u32 ; } if next_offset . is_some ( ) { _flags |= 1 << 2u32 ; } if switch_pm . is_some ( ) { _flags |= 1 << 3u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: long > ( query_id ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputBotInlineResult > > ( results ) ? ; _ser . write_bare :: < :: mtproto :: int > ( cache_time ) ? ; if let & Some ( ref inner ) = next_offset { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = switch_pm { _ser . write_boxed :: < :: mtproto :: InlineBotSwitchPM > ( inner ) ? ; } Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.setInlineGameScore`\n\n```text\nmessages.setInlineGameScore#15ad9f64 flags:# edit_message:flags.0?true force:flags.1?true id:InputBotInlineMessageID user_id:InputUser score:int = Bool;\n```\n" ] pub struct SetInlineGameScore { pub edit_message : bool , pub force : bool , pub id : :: mtproto :: InputBotInlineMessageID , pub user_id : :: mtproto :: InputUser , pub score : :: mtproto :: int , } impl :: BoxedSerialize for SetInlineGameScore { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x15ad9f64 ) , self ) } } impl :: Function for SetInlineGameScore { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for SetInlineGameScore { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & SetInlineGameScore { edit_message , force , ref id , ref user_id , ref score } = self ; let mut _flags = 0i32 ; if edit_message { _flags |= 1 << 0u32 ; } if force { _flags |= 1 << 1u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_boxed :: < :: mtproto :: InputBotInlineMessageID > ( id ) ? ; _ser . write_boxed :: < :: mtproto :: InputUser > ( user_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( score ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.setTyping`\n\n```text\nmessages.setTyping#a3825e50 peer:InputPeer action:SendMessageAction = Bool;\n```\n" ] pub struct SetTyping { pub peer : :: mtproto :: InputPeer , pub action : :: mtproto :: SendMessageAction , } impl :: BoxedSerialize for SetTyping { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xa3825e50 ) , self ) } } impl :: Function for SetTyping { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for SetTyping { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & SetTyping { ref peer , ref action } = self ; _ser . write_boxed :: < :: mtproto :: InputPeer > ( peer ) ? ; _ser . write_boxed :: < :: mtproto :: SendMessageAction > ( action ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.startBot`\n\n```text\nmessages.startBot#e6df7378 bot:InputUser peer:InputPeer random_id:long start_param:string = Updates;\n```\n" ] pub struct StartBot { pub bot : :: mtproto :: InputUser , pub peer : :: mtproto :: InputPeer , pub random_id : :: mtproto :: long , pub start_param : :: mtproto :: string , } impl :: BoxedSerialize for StartBot { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xe6df7378 ) , self ) } } impl :: Function for StartBot { type Reply = :: mtproto :: Updates ; } impl :: BareSerialize for StartBot { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & StartBot { ref bot , ref peer , ref random_id , ref start_param } = self ; _ser . write_boxed :: < :: mtproto :: InputUser > ( bot ) ? ; _ser . write_boxed :: < :: mtproto :: InputPeer > ( peer ) ? ; _ser . write_bare :: < :: mtproto :: long > ( random_id ) ? ; _ser . write_bare :: < :: mtproto :: string > ( start_param ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.toggleChatAdmins`\n\n```text\nmessages.toggleChatAdmins#ec8bd9e1 chat_id:int enabled:Bool = Updates;\n```\n" ] pub struct ToggleChatAdmins { pub chat_id : :: mtproto :: int , pub enabled : :: mtproto :: Bool , } impl :: BoxedSerialize for ToggleChatAdmins { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xec8bd9e1 ) , self ) } } impl :: Function for ToggleChatAdmins { type Reply = :: mtproto :: Updates ; } impl :: BareSerialize for ToggleChatAdmins { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ToggleChatAdmins { ref chat_id , ref enabled } = self ; _ser . write_bare :: < :: mtproto :: int > ( chat_id ) ? ; _ser . write_boxed :: < :: mtproto :: Bool > ( enabled ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.toggleDialogPin`\n\n```text\nmessages.toggleDialogPin#3289be6a flags:# pinned:flags.0?true peer:InputPeer = Bool;\n```\n" ] pub struct ToggleDialogPin { pub pinned : bool , pub peer : :: mtproto :: InputPeer , } impl :: BoxedSerialize for ToggleDialogPin { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x3289be6a ) , self ) } } impl :: Function for ToggleDialogPin { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for ToggleDialogPin { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ToggleDialogPin { pinned , ref peer } = self ; let mut _flags = 0i32 ; if pinned { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_boxed :: < :: mtproto :: InputPeer > ( peer ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.uninstallStickerSet`\n\n```text\nmessages.uninstallStickerSet#f96e55de stickerset:InputStickerSet = Bool;\n```\n" ] pub struct UninstallStickerSet { pub stickerset : :: mtproto :: InputStickerSet , } impl :: BoxedSerialize for UninstallStickerSet { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xf96e55de ) , self ) } } impl :: Function for UninstallStickerSet { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for UninstallStickerSet { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & UninstallStickerSet { ref stickerset } = self ; _ser . write_boxed :: < :: mtproto :: InputStickerSet > ( stickerset ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.uploadEncryptedFile`\n\n```text\nmessages.uploadEncryptedFile#5057c497 peer:InputEncryptedChat file:InputEncryptedFile = EncryptedFile;\n```\n" ] pub struct UploadEncryptedFile { pub peer : :: mtproto :: InputEncryptedChat , pub file : :: mtproto :: InputEncryptedFile , } impl :: BoxedSerialize for UploadEncryptedFile { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x5057c497 ) , self ) } } impl :: Function for UploadEncryptedFile { type Reply = :: mtproto :: EncryptedFile ; } impl :: BareSerialize for UploadEncryptedFile { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & UploadEncryptedFile { ref peer , ref file } = self ; _ser . write_boxed :: < :: mtproto :: InputEncryptedChat > ( peer ) ? ; _ser . write_boxed :: < :: mtproto :: InputEncryptedFile > ( file ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `messages.uploadMedia`\n\n```text\nmessages.uploadMedia#519bc2b1 peer:InputPeer media:InputMedia = MessageMedia;\n```\n" ] pub struct UploadMedia { pub peer : :: mtproto :: InputPeer , pub media : :: mtproto :: InputMedia , } impl :: BoxedSerialize for UploadMedia { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x519bc2b1 ) , self ) } } impl :: Function for UploadMedia { type Reply = :: mtproto :: MessageMedia ; } impl :: BareSerialize for UploadMedia { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & UploadMedia { ref peer , ref media } = self ; _ser . write_boxed :: < :: mtproto :: InputPeer > ( peer ) ? ; _ser . write_boxed :: < :: mtproto :: InputMedia > ( media ) ? ; Ok ( ( ) ) } } } pub mod payments { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `payments.clearSavedInfo`\n\n```text\npayments.clearSavedInfo#d83d70c1 flags:# credentials:flags.0?true info:flags.1?true = Bool;\n```\n" ] pub struct ClearSavedInfo { pub credentials : bool , pub info : bool , } impl :: BoxedSerialize for ClearSavedInfo { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xd83d70c1 ) , self ) } } impl :: Function for ClearSavedInfo { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for ClearSavedInfo { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ClearSavedInfo { credentials , info } = self ; let mut _flags = 0i32 ; if credentials { _flags |= 1 << 0u32 ; } if info { _flags |= 1 << 1u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `payments.getPaymentForm`\n\n```text\npayments.getPaymentForm#99f09745 msg_id:int = payments.PaymentForm;\n```\n" ] pub struct GetPaymentForm { pub msg_id : :: mtproto :: int , } impl :: BoxedSerialize for GetPaymentForm { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x99f09745 ) , self ) } } impl :: Function for GetPaymentForm { type Reply = :: mtproto :: payments :: PaymentForm ; } impl :: BareSerialize for GetPaymentForm { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetPaymentForm { ref msg_id } = self ; _ser . write_bare :: < :: mtproto :: int > ( msg_id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `payments.getPaymentReceipt`\n\n```text\npayments.getPaymentReceipt#a092a980 msg_id:int = payments.PaymentReceipt;\n```\n" ] pub struct GetPaymentReceipt { pub msg_id : :: mtproto :: int , } impl :: BoxedSerialize for GetPaymentReceipt { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xa092a980 ) , self ) } } impl :: Function for GetPaymentReceipt { type Reply = :: mtproto :: payments :: PaymentReceipt ; } impl :: BareSerialize for GetPaymentReceipt { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetPaymentReceipt { ref msg_id } = self ; _ser . write_bare :: < :: mtproto :: int > ( msg_id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `payments.getSavedInfo`\n\n```text\npayments.getSavedInfo#227d824b = payments.SavedInfo;\n```\n" ] pub struct GetSavedInfo ; impl :: BoxedSerialize for GetSavedInfo { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x227d824b ) , self ) } } impl :: Function for GetSavedInfo { type Reply = :: mtproto :: payments :: SavedInfo ; } impl :: BareSerialize for GetSavedInfo { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `payments.sendPaymentForm`\n\n```text\npayments.sendPaymentForm#2b8879b3 flags:# msg_id:int requested_info_id:flags.0?string shipping_option_id:flags.1?string credentials:InputPaymentCredentials = payments.PaymentResult;\n```\n" ] pub struct SendPaymentForm { pub msg_id : :: mtproto :: int , pub requested_info_id : Option < :: mtproto :: string > , pub shipping_option_id : Option < :: mtproto :: string > , pub credentials : :: mtproto :: InputPaymentCredentials , } impl :: BoxedSerialize for SendPaymentForm { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x2b8879b3 ) , self ) } } impl :: Function for SendPaymentForm { type Reply = :: mtproto :: payments :: PaymentResult ; } impl :: BareSerialize for SendPaymentForm { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & SendPaymentForm { ref msg_id , ref requested_info_id , ref shipping_option_id , ref credentials } = self ; let mut _flags = 0i32 ; if requested_info_id . is_some ( ) { _flags |= 1 << 0u32 ; } if shipping_option_id . is_some ( ) { _flags |= 1 << 1u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: int > ( msg_id ) ? ; if let & Some ( ref inner ) = requested_info_id { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = shipping_option_id { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } _ser . write_boxed :: < :: mtproto :: InputPaymentCredentials > ( credentials ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `payments.validateRequestedInfo`\n\n```text\npayments.validateRequestedInfo#770a8e74 flags:# save:flags.0?true msg_id:int info:PaymentRequestedInfo = payments.ValidatedRequestedInfo;\n```\n" ] pub struct ValidateRequestedInfo { pub save : bool , pub msg_id : :: mtproto :: int , pub info : :: mtproto :: PaymentRequestedInfo , } impl :: BoxedSerialize for ValidateRequestedInfo { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x770a8e74 ) , self ) } } impl :: Function for ValidateRequestedInfo { type Reply = :: mtproto :: payments :: ValidatedRequestedInfo ; } impl :: BareSerialize for ValidateRequestedInfo { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ValidateRequestedInfo { save , ref msg_id , ref info } = self ; let mut _flags = 0i32 ; if save { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: int > ( msg_id ) ? ; _ser . write_boxed :: < :: mtproto :: PaymentRequestedInfo > ( info ) ? ; Ok ( ( ) ) } } } pub mod phone { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `phone.acceptCall`\n\n```text\nphone.acceptCall#3bd2b4a0 peer:InputPhoneCall g_b:bytes protocol:PhoneCallProtocol = phone.PhoneCall;\n```\n" ] pub struct AcceptCall { pub peer : :: mtproto :: InputPhoneCall , pub g_b : :: mtproto :: bytes , pub protocol : :: mtproto :: PhoneCallProtocol , } impl :: BoxedSerialize for AcceptCall { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x3bd2b4a0 ) , self ) } } impl :: Function for AcceptCall { type Reply = :: mtproto :: phone :: PhoneCall ; } impl :: BareSerialize for AcceptCall { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & AcceptCall { ref peer , ref g_b , ref protocol } = self ; _ser . write_boxed :: < :: mtproto :: InputPhoneCall > ( peer ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( g_b ) ? ; _ser . write_boxed :: < :: mtproto :: PhoneCallProtocol > ( protocol ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `phone.confirmCall`\n\n```text\nphone.confirmCall#2efe1722 peer:InputPhoneCall g_a:bytes key_fingerprint:long protocol:PhoneCallProtocol = phone.PhoneCall;\n```\n" ] pub struct ConfirmCall { pub peer : :: mtproto :: InputPhoneCall , pub g_a : :: mtproto :: bytes , pub key_fingerprint : :: mtproto :: long , pub protocol : :: mtproto :: PhoneCallProtocol , } impl :: BoxedSerialize for ConfirmCall { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x2efe1722 ) , self ) } } impl :: Function for ConfirmCall { type Reply = :: mtproto :: phone :: PhoneCall ; } impl :: BareSerialize for ConfirmCall { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ConfirmCall { ref peer , ref g_a , ref key_fingerprint , ref protocol } = self ; _ser . write_boxed :: < :: mtproto :: InputPhoneCall > ( peer ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( g_a ) ? ; _ser . write_bare :: < :: mtproto :: long > ( key_fingerprint ) ? ; _ser . write_boxed :: < :: mtproto :: PhoneCallProtocol > ( protocol ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `phone.discardCall`\n\n```text\nphone.discardCall#78d413a6 peer:InputPhoneCall duration:int reason:PhoneCallDiscardReason connection_id:long = Updates;\n```\n" ] pub struct DiscardCall { pub peer : :: mtproto :: InputPhoneCall , pub duration : :: mtproto :: int , pub reason : :: mtproto :: PhoneCallDiscardReason , pub connection_id : :: mtproto :: long , } impl :: BoxedSerialize for DiscardCall { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x78d413a6 ) , self ) } } impl :: Function for DiscardCall { type Reply = :: mtproto :: Updates ; } impl :: BareSerialize for DiscardCall { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & DiscardCall { ref peer , ref duration , ref reason , ref connection_id } = self ; _ser . write_boxed :: < :: mtproto :: InputPhoneCall > ( peer ) ? ; _ser . write_bare :: < :: mtproto :: int > ( duration ) ? ; _ser . write_boxed :: < :: mtproto :: PhoneCallDiscardReason > ( reason ) ? ; _ser . write_bare :: < :: mtproto :: long > ( connection_id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `phone.getCallConfig`\n\n```text\nphone.getCallConfig#55451fa9 = DataJSON;\n```\n" ] pub struct GetCallConfig ; impl :: BoxedSerialize for GetCallConfig { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x55451fa9 ) , self ) } } impl :: Function for GetCallConfig { type Reply = :: mtproto :: DataJSON ; } impl :: BareSerialize for GetCallConfig { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `phone.receivedCall`\n\n```text\nphone.receivedCall#17d54f61 peer:InputPhoneCall = Bool;\n```\n" ] pub struct ReceivedCall { pub peer : :: mtproto :: InputPhoneCall , } impl :: BoxedSerialize for ReceivedCall { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x17d54f61 ) , self ) } } impl :: Function for ReceivedCall { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for ReceivedCall { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ReceivedCall { ref peer } = self ; _ser . write_boxed :: < :: mtproto :: InputPhoneCall > ( peer ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `phone.requestCall`\n\n```text\nphone.requestCall#5b95b3d4 user_id:InputUser random_id:int g_a_hash:bytes protocol:PhoneCallProtocol = phone.PhoneCall;\n```\n" ] pub struct RequestCall { pub user_id : :: mtproto :: InputUser , pub random_id : :: mtproto :: int , pub g_a_hash : :: mtproto :: bytes , pub protocol : :: mtproto :: PhoneCallProtocol , } impl :: BoxedSerialize for RequestCall { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x5b95b3d4 ) , self ) } } impl :: Function for RequestCall { type Reply = :: mtproto :: phone :: PhoneCall ; } impl :: BareSerialize for RequestCall { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & RequestCall { ref user_id , ref random_id , ref g_a_hash , ref protocol } = self ; _ser . write_boxed :: < :: mtproto :: InputUser > ( user_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( random_id ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( g_a_hash ) ? ; _ser . write_boxed :: < :: mtproto :: PhoneCallProtocol > ( protocol ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `phone.saveCallDebug`\n\n```text\nphone.saveCallDebug#277add7e peer:InputPhoneCall debug:DataJSON = Bool;\n```\n" ] pub struct SaveCallDebug { pub peer : :: mtproto :: InputPhoneCall , pub debug : :: mtproto :: DataJSON , } impl :: BoxedSerialize for SaveCallDebug { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x277add7e ) , self ) } } impl :: Function for SaveCallDebug { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for SaveCallDebug { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & SaveCallDebug { ref peer , ref debug } = self ; _ser . write_boxed :: < :: mtproto :: InputPhoneCall > ( peer ) ? ; _ser . write_boxed :: < :: mtproto :: DataJSON > ( debug ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `phone.setCallRating`\n\n```text\nphone.setCallRating#1c536a34 peer:InputPhoneCall rating:int comment:string = Updates;\n```\n" ] pub struct SetCallRating { pub peer : :: mtproto :: InputPhoneCall , pub rating : :: mtproto :: int , pub comment : :: mtproto :: string , } impl :: BoxedSerialize for SetCallRating { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x1c536a34 ) , self ) } } impl :: Function for SetCallRating { type Reply = :: mtproto :: Updates ; } impl :: BareSerialize for SetCallRating { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & SetCallRating { ref peer , ref rating , ref comment } = self ; _ser . write_boxed :: < :: mtproto :: InputPhoneCall > ( peer ) ? ; _ser . write_bare :: < :: mtproto :: int > ( rating ) ? ; _ser . write_bare :: < :: mtproto :: string > ( comment ) ? ; Ok ( ( ) ) } } } pub mod photos { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `photos.deletePhotos`\n\n```text\nphotos.deletePhotos#87cf7f2f id:Vector<InputPhoto> = Vector<long>;\n```\n" ] pub struct DeletePhotos { pub id : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputPhoto > , } impl :: BoxedSerialize for DeletePhotos { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x87cf7f2f ) , self ) } } impl :: Function for DeletePhotos { type Reply = :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > ; } impl :: BareSerialize for DeletePhotos { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & DeletePhotos { ref id } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputPhoto > > ( id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `photos.getUserPhotos`\n\n```text\nphotos.getUserPhotos#91cd32a8 user_id:InputUser offset:int max_id:long limit:int = photos.Photos;\n```\n" ] pub struct GetUserPhotos { pub user_id : :: mtproto :: InputUser , pub offset : :: mtproto :: int , pub max_id : :: mtproto :: long , pub limit : :: mtproto :: int , } impl :: BoxedSerialize for GetUserPhotos { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x91cd32a8 ) , self ) } } impl :: Function for GetUserPhotos { type Reply = :: mtproto :: photos :: Photos ; } impl :: BareSerialize for GetUserPhotos { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetUserPhotos { ref user_id , ref offset , ref max_id , ref limit } = self ; _ser . write_boxed :: < :: mtproto :: InputUser > ( user_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( offset ) ? ; _ser . write_bare :: < :: mtproto :: long > ( max_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( limit ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `photos.updateProfilePhoto`\n\n```text\nphotos.updateProfilePhoto#f0bb5152 id:InputPhoto = UserProfilePhoto;\n```\n" ] pub struct UpdateProfilePhoto { pub id : :: mtproto :: InputPhoto , } impl :: BoxedSerialize for UpdateProfilePhoto { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xf0bb5152 ) , self ) } } impl :: Function for UpdateProfilePhoto { type Reply = :: mtproto :: UserProfilePhoto ; } impl :: BareSerialize for UpdateProfilePhoto { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & UpdateProfilePhoto { ref id } = self ; _ser . write_boxed :: < :: mtproto :: InputPhoto > ( id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `photos.uploadProfilePhoto`\n\n```text\nphotos.uploadProfilePhoto#4f32c098 file:InputFile = photos.Photo;\n```\n" ] pub struct UploadProfilePhoto { pub file : :: mtproto :: InputFile , } impl :: BoxedSerialize for UploadProfilePhoto { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x4f32c098 ) , self ) } } impl :: Function for UploadProfilePhoto { type Reply = :: mtproto :: photos :: Photo ; } impl :: BareSerialize for UploadProfilePhoto { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & UploadProfilePhoto { ref file } = self ; _ser . write_boxed :: < :: mtproto :: InputFile > ( file ) ? ; Ok ( ( ) ) } } } pub mod stickers { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `stickers.addStickerToSet`\n\n```text\nstickers.addStickerToSet#8653febe stickerset:InputStickerSet sticker:InputStickerSetItem = messages.StickerSet;\n```\n" ] pub struct AddStickerToSet { pub stickerset : :: mtproto :: InputStickerSet , pub sticker : :: mtproto :: InputStickerSetItem , } impl :: BoxedSerialize for AddStickerToSet { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x8653febe ) , self ) } } impl :: Function for AddStickerToSet { type Reply = :: mtproto :: messages :: StickerSet ; } impl :: BareSerialize for AddStickerToSet { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & AddStickerToSet { ref stickerset , ref sticker } = self ; _ser . write_boxed :: < :: mtproto :: InputStickerSet > ( stickerset ) ? ; _ser . write_boxed :: < :: mtproto :: InputStickerSetItem > ( sticker ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `stickers.changeStickerPosition`\n\n```text\nstickers.changeStickerPosition#ffb6d4ca sticker:InputDocument position:int = messages.StickerSet;\n```\n" ] pub struct ChangeStickerPosition { pub sticker : :: mtproto :: InputDocument , pub position : :: mtproto :: int , } impl :: BoxedSerialize for ChangeStickerPosition { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xffb6d4ca ) , self ) } } impl :: Function for ChangeStickerPosition { type Reply = :: mtproto :: messages :: StickerSet ; } impl :: BareSerialize for ChangeStickerPosition { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChangeStickerPosition { ref sticker , ref position } = self ; _ser . write_boxed :: < :: mtproto :: InputDocument > ( sticker ) ? ; _ser . write_bare :: < :: mtproto :: int > ( position ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `stickers.createStickerSet`\n\n```text\nstickers.createStickerSet#9bd86e6a flags:# masks:flags.0?true user_id:InputUser title:string short_name:string stickers:Vector<InputStickerSetItem> = messages.StickerSet;\n```\n" ] pub struct CreateStickerSet { pub masks : bool , pub user_id : :: mtproto :: InputUser , pub title : :: mtproto :: string , pub short_name : :: mtproto :: string , pub stickers : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputStickerSetItem > , } impl :: BoxedSerialize for CreateStickerSet { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x9bd86e6a ) , self ) } } impl :: Function for CreateStickerSet { type Reply = :: mtproto :: messages :: StickerSet ; } impl :: BareSerialize for CreateStickerSet { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & CreateStickerSet { masks , ref user_id , ref title , ref short_name , ref stickers } = self ; let mut _flags = 0i32 ; if masks { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_boxed :: < :: mtproto :: InputUser > ( user_id ) ? ; _ser . write_bare :: < :: mtproto :: string > ( title ) ? ; _ser . write_bare :: < :: mtproto :: string > ( short_name ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputStickerSetItem > > ( stickers ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `stickers.removeStickerFromSet`\n\n```text\nstickers.removeStickerFromSet#f7760f51 sticker:InputDocument = messages.StickerSet;\n```\n" ] pub struct RemoveStickerFromSet { pub sticker : :: mtproto :: InputDocument , } impl :: BoxedSerialize for RemoveStickerFromSet { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xf7760f51 ) , self ) } } impl :: Function for RemoveStickerFromSet { type Reply = :: mtproto :: messages :: StickerSet ; } impl :: BareSerialize for RemoveStickerFromSet { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & RemoveStickerFromSet { ref sticker } = self ; _ser . write_boxed :: < :: mtproto :: InputDocument > ( sticker ) ? ; Ok ( ( ) ) } } } pub mod updates { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updates.getChannelDifference`\n\n```text\nupdates.getChannelDifference#3173d78 flags:# force:flags.0?true channel:InputChannel filter:ChannelMessagesFilter pts:int limit:int = updates.ChannelDifference;\n```\n" ] pub struct GetChannelDifference { pub force : bool , pub channel : :: mtproto :: InputChannel , pub filter : :: mtproto :: ChannelMessagesFilter , pub pts : :: mtproto :: int , pub limit : :: mtproto :: int , } impl :: BoxedSerialize for GetChannelDifference { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x03173d78 ) , self ) } } impl :: Function for GetChannelDifference { type Reply = :: mtproto :: updates :: ChannelDifference ; } impl :: BareSerialize for GetChannelDifference { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetChannelDifference { force , ref channel , ref filter , ref pts , ref limit } = self ; let mut _flags = 0i32 ; if force { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_boxed :: < :: mtproto :: InputChannel > ( channel ) ? ; _ser . write_boxed :: < :: mtproto :: ChannelMessagesFilter > ( filter ) ? ; _ser . write_bare :: < :: mtproto :: int > ( pts ) ? ; _ser . write_bare :: < :: mtproto :: int > ( limit ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updates.getDifference`\n\n```text\nupdates.getDifference#25939651 flags:# pts:int pts_total_limit:flags.0?int date:int qts:int = updates.Difference;\n```\n" ] pub struct GetDifference { pub pts : :: mtproto :: int , pub pts_total_limit : Option < :: mtproto :: int > , pub date : :: mtproto :: int , pub qts : :: mtproto :: int , } impl :: BoxedSerialize for GetDifference { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x25939651 ) , self ) } } impl :: Function for GetDifference { type Reply = :: mtproto :: updates :: Difference ; } impl :: BareSerialize for GetDifference { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetDifference { ref pts , ref pts_total_limit , ref date , ref qts } = self ; let mut _flags = 0i32 ; if pts_total_limit . is_some ( ) { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: int > ( pts ) ? ; if let & Some ( ref inner ) = pts_total_limit { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; _ser . write_bare :: < :: mtproto :: int > ( qts ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updates.getState`\n\n```text\nupdates.getState#edd4882a = updates.State;\n```\n" ] pub struct GetState ; impl :: BoxedSerialize for GetState { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xedd4882a ) , self ) } } impl :: Function for GetState { type Reply = :: mtproto :: updates :: State ; } impl :: BareSerialize for GetState { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { Ok ( ( ) ) } } } pub mod upload { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `upload.getCdnFile`\n\n```text\nupload.getCdnFile#2000bcc3 file_token:bytes offset:int limit:int = upload.CdnFile;\n```\n" ] pub struct GetCdnFile { pub file_token : :: mtproto :: bytes , pub offset : :: mtproto :: int , pub limit : :: mtproto :: int , } impl :: BoxedSerialize for GetCdnFile { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x2000bcc3 ) , self ) } } impl :: Function for GetCdnFile { type Reply = :: mtproto :: upload :: CdnFile ; } impl :: BareSerialize for GetCdnFile { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetCdnFile { ref file_token , ref offset , ref limit } = self ; _ser . write_bare :: < :: mtproto :: bytes > ( file_token ) ? ; _ser . write_bare :: < :: mtproto :: int > ( offset ) ? ; _ser . write_bare :: < :: mtproto :: int > ( limit ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `upload.getCdnFileHashes`\n\n```text\nupload.getCdnFileHashes#f715c87b file_token:bytes offset:int = Vector<CdnFileHash>;\n```\n" ] pub struct GetCdnFileHashes { pub file_token : :: mtproto :: bytes , pub offset : :: mtproto :: int , } impl :: BoxedSerialize for GetCdnFileHashes { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xf715c87b ) , self ) } } impl :: Function for GetCdnFileHashes { type Reply = :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: CdnFileHash > ; } impl :: BareSerialize for GetCdnFileHashes { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetCdnFileHashes { ref file_token , ref offset } = self ; _ser . write_bare :: < :: mtproto :: bytes > ( file_token ) ? ; _ser . write_bare :: < :: mtproto :: int > ( offset ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `upload.getFile`\n\n```text\nupload.getFile#e3a6cfb5 location:InputFileLocation offset:int limit:int = upload.File;\n```\n" ] pub struct GetFile { pub location : :: mtproto :: InputFileLocation , pub offset : :: mtproto :: int , pub limit : :: mtproto :: int , } impl :: BoxedSerialize for GetFile { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xe3a6cfb5 ) , self ) } } impl :: Function for GetFile { type Reply = :: mtproto :: upload :: File ; } impl :: BareSerialize for GetFile { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetFile { ref location , ref offset , ref limit } = self ; _ser . write_boxed :: < :: mtproto :: InputFileLocation > ( location ) ? ; _ser . write_bare :: < :: mtproto :: int > ( offset ) ? ; _ser . write_bare :: < :: mtproto :: int > ( limit ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `upload.getWebFile`\n\n```text\nupload.getWebFile#24e6818d location:InputWebFileLocation offset:int limit:int = upload.WebFile;\n```\n" ] pub struct GetWebFile { pub location : :: mtproto :: InputWebFileLocation , pub offset : :: mtproto :: int , pub limit : :: mtproto :: int , } impl :: BoxedSerialize for GetWebFile { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x24e6818d ) , self ) } } impl :: Function for GetWebFile { type Reply = :: mtproto :: upload :: WebFile ; } impl :: BareSerialize for GetWebFile { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetWebFile { ref location , ref offset , ref limit } = self ; _ser . write_boxed :: < :: mtproto :: InputWebFileLocation > ( location ) ? ; _ser . write_bare :: < :: mtproto :: int > ( offset ) ? ; _ser . write_bare :: < :: mtproto :: int > ( limit ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `upload.reuploadCdnFile`\n\n```text\nupload.reuploadCdnFile#1af91c09 file_token:bytes request_token:bytes = Vector<CdnFileHash>;\n```\n" ] pub struct ReuploadCdnFile { pub file_token : :: mtproto :: bytes , pub request_token : :: mtproto :: bytes , } impl :: BoxedSerialize for ReuploadCdnFile { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x1af91c09 ) , self ) } } impl :: Function for ReuploadCdnFile { type Reply = :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: CdnFileHash > ; } impl :: BareSerialize for ReuploadCdnFile { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ReuploadCdnFile { ref file_token , ref request_token } = self ; _ser . write_bare :: < :: mtproto :: bytes > ( file_token ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( request_token ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `upload.saveBigFilePart`\n\n```text\nupload.saveBigFilePart#de7b673d file_id:long file_part:int file_total_parts:int bytes:bytes = Bool;\n```\n" ] pub struct SaveBigFilePart { pub file_id : :: mtproto :: long , pub file_part : :: mtproto :: int , pub file_total_parts : :: mtproto :: int , pub bytes : :: mtproto :: bytes , } impl :: BoxedSerialize for SaveBigFilePart { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xde7b673d ) , self ) } } impl :: Function for SaveBigFilePart { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for SaveBigFilePart { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & SaveBigFilePart { ref file_id , ref file_part , ref file_total_parts , bytes : ref bytes_ } = self ; _ser . write_bare :: < :: mtproto :: long > ( file_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( file_part ) ? ; _ser . write_bare :: < :: mtproto :: int > ( file_total_parts ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( bytes_ ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `upload.saveFilePart`\n\n```text\nupload.saveFilePart#b304a621 file_id:long file_part:int bytes:bytes = Bool;\n```\n" ] pub struct SaveFilePart { pub file_id : :: mtproto :: long , pub file_part : :: mtproto :: int , pub bytes : :: mtproto :: bytes , } impl :: BoxedSerialize for SaveFilePart { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xb304a621 ) , self ) } } impl :: Function for SaveFilePart { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for SaveFilePart { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & SaveFilePart { ref file_id , ref file_part , bytes : ref bytes_ } = self ; _ser . write_bare :: < :: mtproto :: long > ( file_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( file_part ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( bytes_ ) ? ; Ok ( ( ) ) } } } pub mod users { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `users.getFullUser`\n\n```text\nusers.getFullUser#ca30a5b1 id:InputUser = UserFull;\n```\n" ] pub struct GetFullUser { pub id : :: mtproto :: InputUser , } impl :: BoxedSerialize for GetFullUser { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0xca30a5b1 ) , self ) } } impl :: Function for GetFullUser { type Reply = :: mtproto :: UserFull ; } impl :: BareSerialize for GetFullUser { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetFullUser { ref id } = self ; _ser . write_boxed :: < :: mtproto :: InputUser > ( id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `users.getUsers`\n\n```text\nusers.getUsers#d91a548 id:Vector<InputUser> = Vector<User>;\n```\n" ] pub struct GetUsers { pub id : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputUser > , } impl :: BoxedSerialize for GetUsers { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { ( :: ConstructorNumber ( 0x0d91a548 ) , self ) } } impl :: Function for GetUsers { type Reply = :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > ; } impl :: BareSerialize for GetUsers { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & GetUsers { ref id } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputUser > > ( id ) ? ; Ok ( ( ) ) } } } } pub mod rpc_answer { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `rpc_answer_dropped`\n\n```text\nrpc_answer_dropped#a43ad8b7 msg_id:long seq_no:int bytes:int = RpcDropAnswer;\n```\n" ] pub struct Dropped { pub msg_id : :: mtproto :: long , pub seq_no : :: mtproto :: int , pub bytes : :: mtproto :: int , } impl :: BareSerialize for Dropped { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Dropped { ref msg_id , ref seq_no , bytes : ref bytes_ } = self ; _ser . write_bare :: < :: mtproto :: long > ( msg_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( seq_no ) ? ; _ser . write_bare :: < :: mtproto :: int > ( bytes_ ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Dropped { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Dropped { msg_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , seq_no : _de . read_bare :: < :: mtproto :: int > ( ) ? , bytes : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for Dropped { type Boxed = :: mtproto :: RpcDropAnswer ; fn into_boxed ( self ) -> :: mtproto :: RpcDropAnswer { :: mtproto :: RpcDropAnswer :: Dropped ( self ) } } } pub mod rpc_error { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `rpc_error`\n\n```text\nrpc_error#2144ca19 error_code:int error_message:string = RpcError;\n```\n" ] pub struct RpcError { pub error_code : :: mtproto :: int , pub error_message : :: mtproto :: string , } impl :: BareSerialize for RpcError { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & RpcError { ref error_code , ref error_message } = self ; _ser . write_bare :: < :: mtproto :: int > ( error_code ) ? ; _ser . write_bare :: < :: mtproto :: string > ( error_message ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for RpcError { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( RpcError { error_code : _de . read_bare :: < :: mtproto :: int > ( ) ? , error_message : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for RpcError { type Boxed = :: mtproto :: RpcError ; fn into_boxed ( self ) -> :: mtproto :: RpcError { :: mtproto :: RpcError :: RpcError ( self ) } } } pub mod send_message { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `sendMessageUploadAudioAction`\n\n```text\nsendMessageUploadAudioAction#f351d7ab progress:int = SendMessageAction;\n```\n" ] pub struct UploadAudioAction { pub progress : :: mtproto :: int , } impl :: BareSerialize for UploadAudioAction { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & UploadAudioAction { ref progress } = self ; _ser . write_bare :: < :: mtproto :: int > ( progress ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for UploadAudioAction { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( UploadAudioAction { progress : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for UploadAudioAction { type Boxed = :: mtproto :: SendMessageAction ; fn into_boxed ( self ) -> :: mtproto :: SendMessageAction { :: mtproto :: SendMessageAction :: UploadAudioAction ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `sendMessageUploadDocumentAction`\n\n```text\nsendMessageUploadDocumentAction#aa0cd9e4 progress:int = SendMessageAction;\n```\n" ] pub struct UploadDocumentAction { pub progress : :: mtproto :: int , } impl :: BareSerialize for UploadDocumentAction { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & UploadDocumentAction { ref progress } = self ; _ser . write_bare :: < :: mtproto :: int > ( progress ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for UploadDocumentAction { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( UploadDocumentAction { progress : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for UploadDocumentAction { type Boxed = :: mtproto :: SendMessageAction ; fn into_boxed ( self ) -> :: mtproto :: SendMessageAction { :: mtproto :: SendMessageAction :: UploadDocumentAction ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `sendMessageUploadPhotoAction`\n\n```text\nsendMessageUploadPhotoAction#d1d34a26 progress:int = SendMessageAction;\n```\n" ] pub struct UploadPhotoAction { pub progress : :: mtproto :: int , } impl :: BareSerialize for UploadPhotoAction { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & UploadPhotoAction { ref progress } = self ; _ser . write_bare :: < :: mtproto :: int > ( progress ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for UploadPhotoAction { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( UploadPhotoAction { progress : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for UploadPhotoAction { type Boxed = :: mtproto :: SendMessageAction ; fn into_boxed ( self ) -> :: mtproto :: SendMessageAction { :: mtproto :: SendMessageAction :: UploadPhotoAction ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `sendMessageUploadRoundAction`\n\n```text\nsendMessageUploadRoundAction#243e1c66 progress:int = SendMessageAction;\n```\n" ] pub struct UploadRoundAction { pub progress : :: mtproto :: int , } impl :: BareSerialize for UploadRoundAction { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & UploadRoundAction { ref progress } = self ; _ser . write_bare :: < :: mtproto :: int > ( progress ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for UploadRoundAction { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( UploadRoundAction { progress : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for UploadRoundAction { type Boxed = :: mtproto :: SendMessageAction ; fn into_boxed ( self ) -> :: mtproto :: SendMessageAction { :: mtproto :: SendMessageAction :: UploadRoundAction ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `sendMessageUploadVideoAction`\n\n```text\nsendMessageUploadVideoAction#e9763aec progress:int = SendMessageAction;\n```\n" ] pub struct UploadVideoAction { pub progress : :: mtproto :: int , } impl :: BareSerialize for UploadVideoAction { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & UploadVideoAction { ref progress } = self ; _ser . write_bare :: < :: mtproto :: int > ( progress ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for UploadVideoAction { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( UploadVideoAction { progress : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for UploadVideoAction { type Boxed = :: mtproto :: SendMessageAction ; fn into_boxed ( self ) -> :: mtproto :: SendMessageAction { :: mtproto :: SendMessageAction :: UploadVideoAction ( self ) } } } pub mod server_dh_inner_data { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `server_DH_inner_data`\n\n```text\nserver_DH_inner_data#b5890dba nonce:int128 server_nonce:int128 g:int dh_prime:string g_a:string server_time:int = Server_DH_inner_data;\n```\n" ] pub struct ServerDHInnerData { pub nonce : :: mtproto :: int128 , pub server_nonce : :: mtproto :: int128 , pub g : :: mtproto :: int , pub dh_prime : :: mtproto :: bytes , pub g_a : :: mtproto :: bytes , pub server_time : :: mtproto :: int , } impl :: BareSerialize for ServerDHInnerData { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ServerDHInnerData { ref nonce , ref server_nonce , ref g , ref dh_prime , ref g_a , ref server_time } = self ; _ser . write_bare :: < :: mtproto :: int128 > ( nonce ) ? ; _ser . write_bare :: < :: mtproto :: int128 > ( server_nonce ) ? ; _ser . write_bare :: < :: mtproto :: int > ( g ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( dh_prime ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( g_a ) ? ; _ser . write_bare :: < :: mtproto :: int > ( server_time ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ServerDHInnerData { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ServerDHInnerData { nonce : _de . read_bare :: < :: mtproto :: int128 > ( ) ? , server_nonce : _de . read_bare :: < :: mtproto :: int128 > ( ) ? , g : _de . read_bare :: < :: mtproto :: int > ( ) ? , dh_prime : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , g_a : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , server_time : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for ServerDHInnerData { type Boxed = :: mtproto :: ServerDHInnerData ; fn into_boxed ( self ) -> :: mtproto :: ServerDHInnerData { :: mtproto :: ServerDHInnerData :: ServerDHInnerData ( self ) } } } pub mod server_dh_params { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `server_DH_params_fail`\n\n```text\nserver_DH_params_fail#79cb045d nonce:int128 server_nonce:int128 new_nonce_hash:int128 = Server_DH_Params;\n```\n" ] pub struct Fail { pub nonce : :: mtproto :: int128 , pub server_nonce : :: mtproto :: int128 , pub new_nonce_hash : :: mtproto :: int128 , } impl :: BareSerialize for Fail { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Fail { ref nonce , ref server_nonce , ref new_nonce_hash } = self ; _ser . write_bare :: < :: mtproto :: int128 > ( nonce ) ? ; _ser . write_bare :: < :: mtproto :: int128 > ( server_nonce ) ? ; _ser . write_bare :: < :: mtproto :: int128 > ( new_nonce_hash ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Fail { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Fail { nonce : _de . read_bare :: < :: mtproto :: int128 > ( ) ? , server_nonce : _de . read_bare :: < :: mtproto :: int128 > ( ) ? , new_nonce_hash : _de . read_bare :: < :: mtproto :: int128 > ( ) ? , } ) } } impl :: IntoBoxed for Fail { type Boxed = :: mtproto :: ServerDHParams ; fn into_boxed ( self ) -> :: mtproto :: ServerDHParams { :: mtproto :: ServerDHParams :: Fail ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `server_DH_params_ok`\n\n```text\nserver_DH_params_ok#d0e8075c nonce:int128 server_nonce:int128 encrypted_answer:string = Server_DH_Params;\n```\n" ] pub struct Ok { pub nonce : :: mtproto :: int128 , pub server_nonce : :: mtproto :: int128 , pub encrypted_answer : :: mtproto :: bytes , } impl :: BareSerialize for Ok { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Ok { ref nonce , ref server_nonce , ref encrypted_answer } = self ; _ser . write_bare :: < :: mtproto :: int128 > ( nonce ) ? ; _ser . write_bare :: < :: mtproto :: int128 > ( server_nonce ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( encrypted_answer ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Ok { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Ok { nonce : _de . read_bare :: < :: mtproto :: int128 > ( ) ? , server_nonce : _de . read_bare :: < :: mtproto :: int128 > ( ) ? , encrypted_answer : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , } ) } } impl :: IntoBoxed for Ok { type Boxed = :: mtproto :: ServerDHParams ; fn into_boxed ( self ) -> :: mtproto :: ServerDHParams { :: mtproto :: ServerDHParams :: Ok ( self ) } } } pub mod shipping_option { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `shippingOption`\n\n```text\nshippingOption#b6213cdf id:string title:string prices:Vector<LabeledPrice> = ShippingOption;\n```\n" ] pub struct ShippingOption { pub id : :: mtproto :: string , pub title : :: mtproto :: string , pub prices : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: LabeledPrice > , } impl :: BareSerialize for ShippingOption { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ShippingOption { ref id , ref title , ref prices } = self ; _ser . write_bare :: < :: mtproto :: string > ( id ) ? ; _ser . write_bare :: < :: mtproto :: string > ( title ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: LabeledPrice > > ( prices ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ShippingOption { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ShippingOption { id : _de . read_bare :: < :: mtproto :: string > ( ) ? , title : _de . read_bare :: < :: mtproto :: string > ( ) ? , prices : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: LabeledPrice > > ( ) ? , } ) } } impl :: IntoBoxed for ShippingOption { type Boxed = :: mtproto :: ShippingOption ; fn into_boxed ( self ) -> :: mtproto :: ShippingOption { :: mtproto :: ShippingOption :: ShippingOption ( self ) } } } pub mod sticker_pack { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `stickerPack`\n\n```text\nstickerPack#12b299d4 emoticon:string documents:Vector<long> = StickerPack;\n```\n" ] pub struct StickerPack { pub emoticon : :: mtproto :: string , pub documents : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > , } impl :: BareSerialize for StickerPack { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & StickerPack { ref emoticon , ref documents } = self ; _ser . write_bare :: < :: mtproto :: string > ( emoticon ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > > ( documents ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for StickerPack { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( StickerPack { emoticon : _de . read_bare :: < :: mtproto :: string > ( ) ? , documents : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > > ( ) ? , } ) } } impl :: IntoBoxed for StickerPack { type Boxed = :: mtproto :: StickerPack ; fn into_boxed ( self ) -> :: mtproto :: StickerPack { :: mtproto :: StickerPack :: StickerPack ( self ) } } } pub mod sticker_set { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `stickerSetCovered`\n\n```text\nstickerSetCovered#6410a5d2 set:StickerSet cover:Document = StickerSetCovered;\n```\n" ] pub struct Covered { pub set : :: mtproto :: StickerSet , pub cover : :: mtproto :: Document , } impl :: BareSerialize for Covered { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Covered { ref set , ref cover } = self ; _ser . write_boxed :: < :: mtproto :: StickerSet > ( set ) ? ; _ser . write_boxed :: < :: mtproto :: Document > ( cover ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Covered { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Covered { set : _de . read_boxed :: < :: mtproto :: StickerSet > ( ) ? , cover : _de . read_boxed :: < :: mtproto :: Document > ( ) ? , } ) } } impl :: IntoBoxed for Covered { type Boxed = :: mtproto :: StickerSetCovered ; fn into_boxed ( self ) -> :: mtproto :: StickerSetCovered { :: mtproto :: StickerSetCovered :: Covered ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `stickerSetMultiCovered`\n\n```text\nstickerSetMultiCovered#3407e51b set:StickerSet covers:Vector<Document> = StickerSetCovered;\n```\n" ] pub struct MultiCovered { pub set : :: mtproto :: StickerSet , pub covers : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Document > , } impl :: BareSerialize for MultiCovered { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & MultiCovered { ref set , ref covers } = self ; _ser . write_boxed :: < :: mtproto :: StickerSet > ( set ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Document > > ( covers ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for MultiCovered { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( MultiCovered { set : _de . read_boxed :: < :: mtproto :: StickerSet > ( ) ? , covers : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Document > > ( ) ? , } ) } } impl :: IntoBoxed for MultiCovered { type Boxed = :: mtproto :: StickerSetCovered ; fn into_boxed ( self ) -> :: mtproto :: StickerSetCovered { :: mtproto :: StickerSetCovered :: MultiCovered ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `stickerSet`\n\n```text\nstickerSet#cd303b41 flags:# installed:flags.0?true archived:flags.1?true official:flags.2?true masks:flags.3?true id:long access_hash:long title:string short_name:string count:int hash:int = StickerSet;\n```\n" ] pub struct StickerSet { pub installed : bool , pub archived : bool , pub official : bool , pub masks : bool , pub id : :: mtproto :: long , pub access_hash : :: mtproto :: long , pub title : :: mtproto :: string , pub short_name : :: mtproto :: string , pub count : :: mtproto :: int , pub hash : :: mtproto :: int , } impl :: BareSerialize for StickerSet { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & StickerSet { installed , archived , official , masks , ref id , ref access_hash , ref title , ref short_name , ref count , ref hash } = self ; let mut _flags = 0i32 ; if installed { _flags |= 1 << 0u32 ; } if archived { _flags |= 1 << 1u32 ; } if official { _flags |= 1 << 2u32 ; } if masks { _flags |= 1 << 3u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: long > ( id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( access_hash ) ? ; _ser . write_bare :: < :: mtproto :: string > ( title ) ? ; _ser . write_bare :: < :: mtproto :: string > ( short_name ) ? ; _ser . write_bare :: < :: mtproto :: int > ( count ) ? ; _ser . write_bare :: < :: mtproto :: int > ( hash ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for StickerSet { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( StickerSet { installed : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 0u32 ) != 0 } , archived : _flags & ( 1 << 1u32 ) != 0 , official : _flags & ( 1 << 2u32 ) != 0 , masks : _flags & ( 1 << 3u32 ) != 0 , id : _de . read_bare :: < :: mtproto :: long > ( ) ? , access_hash : _de . read_bare :: < :: mtproto :: long > ( ) ? , title : _de . read_bare :: < :: mtproto :: string > ( ) ? , short_name : _de . read_bare :: < :: mtproto :: string > ( ) ? , count : _de . read_bare :: < :: mtproto :: int > ( ) ? , hash : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for StickerSet { type Boxed = :: mtproto :: StickerSet ; fn into_boxed ( self ) -> :: mtproto :: StickerSet { :: mtproto :: StickerSet :: StickerSet ( self ) } } } pub mod storage { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `storage.FileType`\n\n```text\nstorage.fileUnknown#aa963b05 = storage.FileType;\n\nstorage.filePartial#40bc6f52 = storage.FileType;\n\nstorage.fileJpeg#7efe0e = storage.FileType;\n\nstorage.fileGif#cae1aadf = storage.FileType;\n\nstorage.filePng#a4f63c0 = storage.FileType;\n\nstorage.filePdf#ae1e508d = storage.FileType;\n\nstorage.fileMp3#528a0677 = storage.FileType;\n\nstorage.fileMov#4b09ebbc = storage.FileType;\n\nstorage.fileMp4#b3cea0e4 = storage.FileType;\n\nstorage.fileWebp#1081464c = storage.FileType;\n```\n" ] pub enum FileType { Unknown , Partial , Jpeg , Gif , Png , Pdf , Mp3 , Mov , Mp4 , Webp , } impl :: BoxedSerialize for FileType { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & FileType :: Unknown => ( :: ConstructorNumber ( 0xaa963b05 ) , & ( ) ) , & FileType :: Partial => ( :: ConstructorNumber ( 0x40bc6f52 ) , & ( ) ) , & FileType :: Jpeg => ( :: ConstructorNumber ( 0x007efe0e ) , & ( ) ) , & FileType :: Gif => ( :: ConstructorNumber ( 0xcae1aadf ) , & ( ) ) , & FileType :: Png => ( :: ConstructorNumber ( 0x0a4f63c0 ) , & ( ) ) , & FileType :: Pdf => ( :: ConstructorNumber ( 0xae1e508d ) , & ( ) ) , & FileType :: Mp3 => ( :: ConstructorNumber ( 0x528a0677 ) , & ( ) ) , & FileType :: Mov => ( :: ConstructorNumber ( 0x4b09ebbc ) , & ( ) ) , & FileType :: Mp4 => ( :: ConstructorNumber ( 0xb3cea0e4 ) , & ( ) ) , & FileType :: Webp => ( :: ConstructorNumber ( 0x1081464c ) , & ( ) ) , } } } impl :: BoxedDeserialize for FileType { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xaa963b05 ) , :: ConstructorNumber ( 0x40bc6f52 ) , :: ConstructorNumber ( 0x007efe0e ) , :: ConstructorNumber ( 0xcae1aadf ) , :: ConstructorNumber ( 0x0a4f63c0 ) , :: ConstructorNumber ( 0xae1e508d ) , :: ConstructorNumber ( 0x528a0677 ) , :: ConstructorNumber ( 0x4b09ebbc ) , :: ConstructorNumber ( 0xb3cea0e4 ) , :: ConstructorNumber ( 0x1081464c ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xaa963b05 ) => Ok ( FileType :: Unknown ) , :: ConstructorNumber ( 0x40bc6f52 ) => Ok ( FileType :: Partial ) , :: ConstructorNumber ( 0x007efe0e ) => Ok ( FileType :: Jpeg ) , :: ConstructorNumber ( 0xcae1aadf ) => Ok ( FileType :: Gif ) , :: ConstructorNumber ( 0x0a4f63c0 ) => Ok ( FileType :: Png ) , :: ConstructorNumber ( 0xae1e508d ) => Ok ( FileType :: Pdf ) , :: ConstructorNumber ( 0x528a0677 ) => Ok ( FileType :: Mp3 ) , :: ConstructorNumber ( 0x4b09ebbc ) => Ok ( FileType :: Mov ) , :: ConstructorNumber ( 0xb3cea0e4 ) => Ok ( FileType :: Mp4 ) , :: ConstructorNumber ( 0x1081464c ) => Ok ( FileType :: Webp ) , id => _invalid_id ! ( id ) , } } } pub mod file { } } pub mod text { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `textBold`\n\n```text\ntextBold#6724abc4 text:RichText = RichText;\n```\n" ] pub struct Bold { pub text : Box < :: mtproto :: RichText > , } impl :: BareSerialize for Bold { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Bold { ref text } = self ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( text ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Bold { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Bold { text : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , } ) } } impl :: IntoBoxed for Bold { type Boxed = :: mtproto :: RichText ; fn into_boxed ( self ) -> :: mtproto :: RichText { :: mtproto :: RichText :: Bold ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `textConcat`\n\n```text\ntextConcat#7e6260d7 texts:Vector<RichText> = RichText;\n```\n" ] pub struct Concat { pub texts : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: RichText > , } impl :: BareSerialize for Concat { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Concat { ref texts } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: RichText > > ( texts ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Concat { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Concat { texts : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: RichText > > ( ) ? , } ) } } impl :: IntoBoxed for Concat { type Boxed = :: mtproto :: RichText ; fn into_boxed ( self ) -> :: mtproto :: RichText { :: mtproto :: RichText :: Concat ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `textEmail`\n\n```text\ntextEmail#de5a0dd6 text:RichText email:string = RichText;\n```\n" ] pub struct Email { pub text : Box < :: mtproto :: RichText > , pub email : :: mtproto :: string , } impl :: BareSerialize for Email { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Email { ref text , ref email } = self ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( text ) ? ; _ser . write_bare :: < :: mtproto :: string > ( email ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Email { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Email { text : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , email : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for Email { type Boxed = :: mtproto :: RichText ; fn into_boxed ( self ) -> :: mtproto :: RichText { :: mtproto :: RichText :: Email ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `textFixed`\n\n```text\ntextFixed#6c3f19b9 text:RichText = RichText;\n```\n" ] pub struct Fixed { pub text : Box < :: mtproto :: RichText > , } impl :: BareSerialize for Fixed { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Fixed { ref text } = self ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( text ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Fixed { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Fixed { text : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , } ) } } impl :: IntoBoxed for Fixed { type Boxed = :: mtproto :: RichText ; fn into_boxed ( self ) -> :: mtproto :: RichText { :: mtproto :: RichText :: Fixed ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `textItalic`\n\n```text\ntextItalic#d912a59c text:RichText = RichText;\n```\n" ] pub struct Italic { pub text : Box < :: mtproto :: RichText > , } impl :: BareSerialize for Italic { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Italic { ref text } = self ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( text ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Italic { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Italic { text : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , } ) } } impl :: IntoBoxed for Italic { type Boxed = :: mtproto :: RichText ; fn into_boxed ( self ) -> :: mtproto :: RichText { :: mtproto :: RichText :: Italic ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `textPlain`\n\n```text\ntextPlain#744694e0 text:string = RichText;\n```\n" ] pub struct Plain { pub text : :: mtproto :: string , } impl :: BareSerialize for Plain { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Plain { ref text } = self ; _ser . write_bare :: < :: mtproto :: string > ( text ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Plain { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Plain { text : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for Plain { type Boxed = :: mtproto :: RichText ; fn into_boxed ( self ) -> :: mtproto :: RichText { :: mtproto :: RichText :: Plain ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `textStrike`\n\n```text\ntextStrike#9bf8bb95 text:RichText = RichText;\n```\n" ] pub struct Strike { pub text : Box < :: mtproto :: RichText > , } impl :: BareSerialize for Strike { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Strike { ref text } = self ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( text ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Strike { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Strike { text : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , } ) } } impl :: IntoBoxed for Strike { type Boxed = :: mtproto :: RichText ; fn into_boxed ( self ) -> :: mtproto :: RichText { :: mtproto :: RichText :: Strike ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `textUnderline`\n\n```text\ntextUnderline#c12622c4 text:RichText = RichText;\n```\n" ] pub struct Underline { pub text : Box < :: mtproto :: RichText > , } impl :: BareSerialize for Underline { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Underline { ref text } = self ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( text ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Underline { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Underline { text : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , } ) } } impl :: IntoBoxed for Underline { type Boxed = :: mtproto :: RichText ; fn into_boxed ( self ) -> :: mtproto :: RichText { :: mtproto :: RichText :: Underline ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `textUrl`\n\n```text\ntextUrl#3c2884c1 text:RichText url:string webpage_id:long = RichText;\n```\n" ] pub struct Url { pub text : Box < :: mtproto :: RichText > , pub url : :: mtproto :: string , pub webpage_id : :: mtproto :: long , } impl :: BareSerialize for Url { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Url { ref text , ref url , ref webpage_id } = self ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( text ) ? ; _ser . write_bare :: < :: mtproto :: string > ( url ) ? ; _ser . write_bare :: < :: mtproto :: long > ( webpage_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Url { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Url { text : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , url : _de . read_bare :: < :: mtproto :: string > ( ) ? , webpage_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for Url { type Boxed = :: mtproto :: RichText ; fn into_boxed ( self ) -> :: mtproto :: RichText { :: mtproto :: RichText :: Url ( self ) } } } pub mod top_peer { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `topPeer`\n\n```text\ntopPeer#edcdc05b peer:Peer rating:double = TopPeer;\n```\n" ] pub struct TopPeer { pub peer : :: mtproto :: Peer , pub rating : :: mtproto :: double , } impl :: BareSerialize for TopPeer { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & TopPeer { ref peer , ref rating } = self ; _ser . write_boxed :: < :: mtproto :: Peer > ( peer ) ? ; _ser . write_bare :: < :: mtproto :: double > ( rating ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for TopPeer { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( TopPeer { peer : _de . read_boxed :: < :: mtproto :: Peer > ( ) ? , rating : _de . read_bare :: < :: mtproto :: double > ( ) ? , } ) } } impl :: IntoBoxed for TopPeer { type Boxed = :: mtproto :: TopPeer ; fn into_boxed ( self ) -> :: mtproto :: TopPeer { :: mtproto :: TopPeer :: TopPeer ( self ) } } } pub mod top_peer_category { } pub mod top_peer_category_peers { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `topPeerCategoryPeers`\n\n```text\ntopPeerCategoryPeers#fb834291 category:TopPeerCategory count:int peers:Vector<TopPeer> = TopPeerCategoryPeers;\n```\n" ] pub struct TopPeerCategoryPeers { pub category : :: mtproto :: TopPeerCategory , pub count : :: mtproto :: int , pub peers : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: TopPeer > , } impl :: BareSerialize for TopPeerCategoryPeers { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & TopPeerCategoryPeers { ref category , ref count , ref peers } = self ; _ser . write_boxed :: < :: mtproto :: TopPeerCategory > ( category ) ? ; _ser . write_bare :: < :: mtproto :: int > ( count ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: TopPeer > > ( peers ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for TopPeerCategoryPeers { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( TopPeerCategoryPeers { category : _de . read_boxed :: < :: mtproto :: TopPeerCategory > ( ) ? , count : _de . read_bare :: < :: mtproto :: int > ( ) ? , peers : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: TopPeer > > ( ) ? , } ) } } impl :: IntoBoxed for TopPeerCategoryPeers { type Boxed = :: mtproto :: TopPeerCategoryPeers ; fn into_boxed ( self ) -> :: mtproto :: TopPeerCategoryPeers { :: mtproto :: TopPeerCategoryPeers :: TopPeerCategoryPeers ( self ) } } } pub mod update { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateBotCallbackQuery`\n\n```text\nupdateBotCallbackQuery#e73547e1 flags:# query_id:long user_id:int peer:Peer msg_id:int chat_instance:long data:flags.0?bytes game_short_name:flags.1?string = Update;\n```\n" ] pub struct BotCallbackQuery { pub query_id : :: mtproto :: long , pub user_id : :: mtproto :: int , pub peer : :: mtproto :: Peer , pub msg_id : :: mtproto :: int , pub chat_instance : :: mtproto :: long , pub data : Option < :: mtproto :: bytes > , pub game_short_name : Option < :: mtproto :: string > , } impl :: BareSerialize for BotCallbackQuery { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & BotCallbackQuery { ref query_id , ref user_id , ref peer , ref msg_id , ref chat_instance , ref data , ref game_short_name } = self ; let mut _flags = 0i32 ; if data . is_some ( ) { _flags |= 1 << 0u32 ; } if game_short_name . is_some ( ) { _flags |= 1 << 1u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: long > ( query_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; _ser . write_boxed :: < :: mtproto :: Peer > ( peer ) ? ; _ser . write_bare :: < :: mtproto :: int > ( msg_id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( chat_instance ) ? ; if let & Some ( ref inner ) = data { _ser . write_bare :: < :: mtproto :: bytes > ( inner ) ? ; } if let & Some ( ref inner ) = game_short_name { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for BotCallbackQuery { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( BotCallbackQuery { query_id : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _de . read_bare :: < :: mtproto :: long > ( ) ? } , user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , peer : _de . read_boxed :: < :: mtproto :: Peer > ( ) ? , msg_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , chat_instance : _de . read_bare :: < :: mtproto :: long > ( ) ? , data : if _flags & ( 1 << 0u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: bytes > ( ) ? ) } else { None } , game_short_name : if _flags & ( 1 << 1u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for BotCallbackQuery { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: BotCallbackQuery ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateBotInlineQuery`\n\n```text\nupdateBotInlineQuery#54826690 flags:# query_id:long user_id:int query:string geo:flags.0?GeoPoint offset:string = Update;\n```\n" ] pub struct BotInlineQuery { pub query_id : :: mtproto :: long , pub user_id : :: mtproto :: int , pub query : :: mtproto :: string , pub geo : Option < :: mtproto :: GeoPoint > , pub offset : :: mtproto :: string , } impl :: BareSerialize for BotInlineQuery { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & BotInlineQuery { ref query_id , ref user_id , ref query , ref geo , ref offset } = self ; let mut _flags = 0i32 ; if geo . is_some ( ) { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: long > ( query_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; _ser . write_bare :: < :: mtproto :: string > ( query ) ? ; if let & Some ( ref inner ) = geo { _ser . write_boxed :: < :: mtproto :: GeoPoint > ( inner ) ? ; } _ser . write_bare :: < :: mtproto :: string > ( offset ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for BotInlineQuery { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( BotInlineQuery { query_id : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _de . read_bare :: < :: mtproto :: long > ( ) ? } , user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , query : _de . read_bare :: < :: mtproto :: string > ( ) ? , geo : if _flags & ( 1 << 0u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: GeoPoint > ( ) ? ) } else { None } , offset : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for BotInlineQuery { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: BotInlineQuery ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateBotInlineSend`\n\n```text\nupdateBotInlineSend#e48f964 flags:# user_id:int query:string geo:flags.0?GeoPoint id:string msg_id:flags.1?InputBotInlineMessageID = Update;\n```\n" ] pub struct BotInlineSend { pub user_id : :: mtproto :: int , pub query : :: mtproto :: string , pub geo : Option < :: mtproto :: GeoPoint > , pub id : :: mtproto :: string , pub msg_id : Option < :: mtproto :: InputBotInlineMessageID > , } impl :: BareSerialize for BotInlineSend { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & BotInlineSend { ref user_id , ref query , ref geo , ref id , ref msg_id } = self ; let mut _flags = 0i32 ; if geo . is_some ( ) { _flags |= 1 << 0u32 ; } if msg_id . is_some ( ) { _flags |= 1 << 1u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; _ser . write_bare :: < :: mtproto :: string > ( query ) ? ; if let & Some ( ref inner ) = geo { _ser . write_boxed :: < :: mtproto :: GeoPoint > ( inner ) ? ; } _ser . write_bare :: < :: mtproto :: string > ( id ) ? ; if let & Some ( ref inner ) = msg_id { _ser . write_boxed :: < :: mtproto :: InputBotInlineMessageID > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for BotInlineSend { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( BotInlineSend { user_id : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _de . read_bare :: < :: mtproto :: int > ( ) ? } , query : _de . read_bare :: < :: mtproto :: string > ( ) ? , geo : if _flags & ( 1 << 0u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: GeoPoint > ( ) ? ) } else { None } , id : _de . read_bare :: < :: mtproto :: string > ( ) ? , msg_id : if _flags & ( 1 << 1u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: InputBotInlineMessageID > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for BotInlineSend { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: BotInlineSend ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateBotPrecheckoutQuery`\n\n```text\nupdateBotPrecheckoutQuery#5d2f3aa9 flags:# query_id:long user_id:int payload:bytes info:flags.0?PaymentRequestedInfo shipping_option_id:flags.1?string currency:string total_amount:long = Update;\n```\n" ] pub struct BotPrecheckoutQuery { pub query_id : :: mtproto :: long , pub user_id : :: mtproto :: int , pub payload : :: mtproto :: bytes , pub info : Option < :: mtproto :: PaymentRequestedInfo > , pub shipping_option_id : Option < :: mtproto :: string > , pub currency : :: mtproto :: string , pub total_amount : :: mtproto :: long , } impl :: BareSerialize for BotPrecheckoutQuery { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & BotPrecheckoutQuery { ref query_id , ref user_id , ref payload , ref info , ref shipping_option_id , ref currency , ref total_amount } = self ; let mut _flags = 0i32 ; if info . is_some ( ) { _flags |= 1 << 0u32 ; } if shipping_option_id . is_some ( ) { _flags |= 1 << 1u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: long > ( query_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( payload ) ? ; if let & Some ( ref inner ) = info { _ser . write_boxed :: < :: mtproto :: PaymentRequestedInfo > ( inner ) ? ; } if let & Some ( ref inner ) = shipping_option_id { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } _ser . write_bare :: < :: mtproto :: string > ( currency ) ? ; _ser . write_bare :: < :: mtproto :: long > ( total_amount ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for BotPrecheckoutQuery { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( BotPrecheckoutQuery { query_id : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _de . read_bare :: < :: mtproto :: long > ( ) ? } , user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , payload : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , info : if _flags & ( 1 << 0u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: PaymentRequestedInfo > ( ) ? ) } else { None } , shipping_option_id : if _flags & ( 1 << 1u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , currency : _de . read_bare :: < :: mtproto :: string > ( ) ? , total_amount : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for BotPrecheckoutQuery { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: BotPrecheckoutQuery ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateBotShippingQuery`\n\n```text\nupdateBotShippingQuery#e0cdc940 query_id:long user_id:int payload:bytes shipping_address:PostAddress = Update;\n```\n" ] pub struct BotShippingQuery { pub query_id : :: mtproto :: long , pub user_id : :: mtproto :: int , pub payload : :: mtproto :: bytes , pub shipping_address : :: mtproto :: PostAddress , } impl :: BareSerialize for BotShippingQuery { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & BotShippingQuery { ref query_id , ref user_id , ref payload , ref shipping_address } = self ; _ser . write_bare :: < :: mtproto :: long > ( query_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( payload ) ? ; _ser . write_boxed :: < :: mtproto :: PostAddress > ( shipping_address ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for BotShippingQuery { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( BotShippingQuery { query_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , payload : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , shipping_address : _de . read_boxed :: < :: mtproto :: PostAddress > ( ) ? , } ) } } impl :: IntoBoxed for BotShippingQuery { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: BotShippingQuery ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateBotWebhookJSON`\n\n```text\nupdateBotWebhookJSON#8317c0c3 data:DataJSON = Update;\n```\n" ] pub struct BotWebhookJSON { pub data : :: mtproto :: DataJSON , } impl :: BareSerialize for BotWebhookJSON { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & BotWebhookJSON { ref data } = self ; _ser . write_boxed :: < :: mtproto :: DataJSON > ( data ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for BotWebhookJSON { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( BotWebhookJSON { data : _de . read_boxed :: < :: mtproto :: DataJSON > ( ) ? , } ) } } impl :: IntoBoxed for BotWebhookJSON { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: BotWebhookJSON ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateBotWebhookJSONQuery`\n\n```text\nupdateBotWebhookJSONQuery#9b9240a6 query_id:long data:DataJSON timeout:int = Update;\n```\n" ] pub struct BotWebhookJSONQuery { pub query_id : :: mtproto :: long , pub data : :: mtproto :: DataJSON , pub timeout : :: mtproto :: int , } impl :: BareSerialize for BotWebhookJSONQuery { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & BotWebhookJSONQuery { ref query_id , ref data , ref timeout } = self ; _ser . write_bare :: < :: mtproto :: long > ( query_id ) ? ; _ser . write_boxed :: < :: mtproto :: DataJSON > ( data ) ? ; _ser . write_bare :: < :: mtproto :: int > ( timeout ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for BotWebhookJSONQuery { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( BotWebhookJSONQuery { query_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , data : _de . read_boxed :: < :: mtproto :: DataJSON > ( ) ? , timeout : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for BotWebhookJSONQuery { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: BotWebhookJSONQuery ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateChannel`\n\n```text\nupdateChannel#b6d45656 channel_id:int = Update;\n```\n" ] pub struct Channel { pub channel_id : :: mtproto :: int , } impl :: BareSerialize for Channel { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Channel { ref channel_id } = self ; _ser . write_bare :: < :: mtproto :: int > ( channel_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Channel { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Channel { channel_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for Channel { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: Channel ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateChannelAvailableMessages`\n\n```text\nupdateChannelAvailableMessages#70db6837 channel_id:int available_min_id:int = Update;\n```\n" ] pub struct ChannelAvailableMessages { pub channel_id : :: mtproto :: int , pub available_min_id : :: mtproto :: int , } impl :: BareSerialize for ChannelAvailableMessages { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChannelAvailableMessages { ref channel_id , ref available_min_id } = self ; _ser . write_bare :: < :: mtproto :: int > ( channel_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( available_min_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ChannelAvailableMessages { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ChannelAvailableMessages { channel_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , available_min_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for ChannelAvailableMessages { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: ChannelAvailableMessages ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateChannelMessageViews`\n\n```text\nupdateChannelMessageViews#98a12b4b channel_id:int id:int views:int = Update;\n```\n" ] pub struct ChannelMessageViews { pub channel_id : :: mtproto :: int , pub id : :: mtproto :: int , pub views : :: mtproto :: int , } impl :: BareSerialize for ChannelMessageViews { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChannelMessageViews { ref channel_id , ref id , ref views } = self ; _ser . write_bare :: < :: mtproto :: int > ( channel_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( views ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ChannelMessageViews { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ChannelMessageViews { channel_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , id : _de . read_bare :: < :: mtproto :: int > ( ) ? , views : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for ChannelMessageViews { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: ChannelMessageViews ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateChannelPinnedMessage`\n\n```text\nupdateChannelPinnedMessage#98592475 channel_id:int id:int = Update;\n```\n" ] pub struct ChannelPinnedMessage { pub channel_id : :: mtproto :: int , pub id : :: mtproto :: int , } impl :: BareSerialize for ChannelPinnedMessage { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChannelPinnedMessage { ref channel_id , ref id } = self ; _ser . write_bare :: < :: mtproto :: int > ( channel_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ChannelPinnedMessage { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ChannelPinnedMessage { channel_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for ChannelPinnedMessage { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: ChannelPinnedMessage ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateChannelReadMessagesContents`\n\n```text\nupdateChannelReadMessagesContents#89893b45 channel_id:int messages:Vector<int> = Update;\n```\n" ] pub struct ChannelReadMessagesContents { pub channel_id : :: mtproto :: int , pub messages : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > , } impl :: BareSerialize for ChannelReadMessagesContents { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChannelReadMessagesContents { ref channel_id , ref messages } = self ; _ser . write_bare :: < :: mtproto :: int > ( channel_id ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > > ( messages ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ChannelReadMessagesContents { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ChannelReadMessagesContents { channel_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , messages : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > > ( ) ? , } ) } } impl :: IntoBoxed for ChannelReadMessagesContents { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: ChannelReadMessagesContents ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateChannelTooLong`\n\n```text\nupdateChannelTooLong#eb0467fb flags:# channel_id:int pts:flags.0?int = Update;\n```\n" ] pub struct ChannelTooLong { pub channel_id : :: mtproto :: int , pub pts : Option < :: mtproto :: int > , } impl :: BareSerialize for ChannelTooLong { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChannelTooLong { ref channel_id , ref pts } = self ; let mut _flags = 0i32 ; if pts . is_some ( ) { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: int > ( channel_id ) ? ; if let & Some ( ref inner ) = pts { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for ChannelTooLong { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( ChannelTooLong { channel_id : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _de . read_bare :: < :: mtproto :: int > ( ) ? } , pts : if _flags & ( 1 << 0u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for ChannelTooLong { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: ChannelTooLong ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateChannelWebPage`\n\n```text\nupdateChannelWebPage#40771900 channel_id:int webpage:WebPage pts:int pts_count:int = Update;\n```\n" ] pub struct ChannelWebPage { pub channel_id : :: mtproto :: int , pub webpage : :: mtproto :: WebPage , pub pts : :: mtproto :: int , pub pts_count : :: mtproto :: int , } impl :: BareSerialize for ChannelWebPage { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChannelWebPage { ref channel_id , ref webpage , ref pts , ref pts_count } = self ; _ser . write_bare :: < :: mtproto :: int > ( channel_id ) ? ; _ser . write_boxed :: < :: mtproto :: WebPage > ( webpage ) ? ; _ser . write_bare :: < :: mtproto :: int > ( pts ) ? ; _ser . write_bare :: < :: mtproto :: int > ( pts_count ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ChannelWebPage { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ChannelWebPage { channel_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , webpage : _de . read_boxed :: < :: mtproto :: WebPage > ( ) ? , pts : _de . read_bare :: < :: mtproto :: int > ( ) ? , pts_count : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for ChannelWebPage { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: ChannelWebPage ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateChatAdmins`\n\n```text\nupdateChatAdmins#6e947941 chat_id:int enabled:Bool version:int = Update;\n```\n" ] pub struct ChatAdmins { pub chat_id : :: mtproto :: int , pub enabled : :: mtproto :: Bool , pub version : :: mtproto :: int , } impl :: BareSerialize for ChatAdmins { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChatAdmins { ref chat_id , ref enabled , ref version } = self ; _ser . write_bare :: < :: mtproto :: int > ( chat_id ) ? ; _ser . write_boxed :: < :: mtproto :: Bool > ( enabled ) ? ; _ser . write_bare :: < :: mtproto :: int > ( version ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ChatAdmins { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ChatAdmins { chat_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , enabled : _de . read_boxed :: < :: mtproto :: Bool > ( ) ? , version : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for ChatAdmins { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: ChatAdmins ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateChatParticipantAdd`\n\n```text\nupdateChatParticipantAdd#ea4b0e5c chat_id:int user_id:int inviter_id:int date:int version:int = Update;\n```\n" ] pub struct ChatParticipantAdd { pub chat_id : :: mtproto :: int , pub user_id : :: mtproto :: int , pub inviter_id : :: mtproto :: int , pub date : :: mtproto :: int , pub version : :: mtproto :: int , } impl :: BareSerialize for ChatParticipantAdd { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChatParticipantAdd { ref chat_id , ref user_id , ref inviter_id , ref date , ref version } = self ; _ser . write_bare :: < :: mtproto :: int > ( chat_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( inviter_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; _ser . write_bare :: < :: mtproto :: int > ( version ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ChatParticipantAdd { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ChatParticipantAdd { chat_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , inviter_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , version : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for ChatParticipantAdd { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: ChatParticipantAdd ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateChatParticipantAdmin`\n\n```text\nupdateChatParticipantAdmin#b6901959 chat_id:int user_id:int is_admin:Bool version:int = Update;\n```\n" ] pub struct ChatParticipantAdmin { pub chat_id : :: mtproto :: int , pub user_id : :: mtproto :: int , pub is_admin : :: mtproto :: Bool , pub version : :: mtproto :: int , } impl :: BareSerialize for ChatParticipantAdmin { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChatParticipantAdmin { ref chat_id , ref user_id , ref is_admin , ref version } = self ; _ser . write_bare :: < :: mtproto :: int > ( chat_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; _ser . write_boxed :: < :: mtproto :: Bool > ( is_admin ) ? ; _ser . write_bare :: < :: mtproto :: int > ( version ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ChatParticipantAdmin { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ChatParticipantAdmin { chat_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , is_admin : _de . read_boxed :: < :: mtproto :: Bool > ( ) ? , version : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for ChatParticipantAdmin { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: ChatParticipantAdmin ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateChatParticipantDelete`\n\n```text\nupdateChatParticipantDelete#6e5f8c22 chat_id:int user_id:int version:int = Update;\n```\n" ] pub struct ChatParticipantDelete { pub chat_id : :: mtproto :: int , pub user_id : :: mtproto :: int , pub version : :: mtproto :: int , } impl :: BareSerialize for ChatParticipantDelete { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChatParticipantDelete { ref chat_id , ref user_id , ref version } = self ; _ser . write_bare :: < :: mtproto :: int > ( chat_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( version ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ChatParticipantDelete { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ChatParticipantDelete { chat_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , version : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for ChatParticipantDelete { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: ChatParticipantDelete ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateChatParticipants`\n\n```text\nupdateChatParticipants#7761198 participants:ChatParticipants = Update;\n```\n" ] pub struct ChatParticipants { pub participants : :: mtproto :: ChatParticipants , } impl :: BareSerialize for ChatParticipants { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChatParticipants { ref participants } = self ; _ser . write_boxed :: < :: mtproto :: ChatParticipants > ( participants ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ChatParticipants { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ChatParticipants { participants : _de . read_boxed :: < :: mtproto :: ChatParticipants > ( ) ? , } ) } } impl :: IntoBoxed for ChatParticipants { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: ChatParticipants ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateChatUserTyping`\n\n```text\nupdateChatUserTyping#9a65ea1f chat_id:int user_id:int action:SendMessageAction = Update;\n```\n" ] pub struct ChatUserTyping { pub chat_id : :: mtproto :: int , pub user_id : :: mtproto :: int , pub action : :: mtproto :: SendMessageAction , } impl :: BareSerialize for ChatUserTyping { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChatUserTyping { ref chat_id , ref user_id , ref action } = self ; _ser . write_bare :: < :: mtproto :: int > ( chat_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; _ser . write_boxed :: < :: mtproto :: SendMessageAction > ( action ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ChatUserTyping { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ChatUserTyping { chat_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , action : _de . read_boxed :: < :: mtproto :: SendMessageAction > ( ) ? , } ) } } impl :: IntoBoxed for ChatUserTyping { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: ChatUserTyping ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateContactLink`\n\n```text\nupdateContactLink#9d2e67c5 user_id:int my_link:ContactLink foreign_link:ContactLink = Update;\n```\n" ] pub struct ContactLink { pub user_id : :: mtproto :: int , pub my_link : :: mtproto :: ContactLink , pub foreign_link : :: mtproto :: ContactLink , } impl :: BareSerialize for ContactLink { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ContactLink { ref user_id , ref my_link , ref foreign_link } = self ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; _ser . write_boxed :: < :: mtproto :: ContactLink > ( my_link ) ? ; _ser . write_boxed :: < :: mtproto :: ContactLink > ( foreign_link ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ContactLink { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ContactLink { user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , my_link : _de . read_boxed :: < :: mtproto :: ContactLink > ( ) ? , foreign_link : _de . read_boxed :: < :: mtproto :: ContactLink > ( ) ? , } ) } } impl :: IntoBoxed for ContactLink { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: ContactLink ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateContactRegistered`\n\n```text\nupdateContactRegistered#2575bbb9 user_id:int date:int = Update;\n```\n" ] pub struct ContactRegistered { pub user_id : :: mtproto :: int , pub date : :: mtproto :: int , } impl :: BareSerialize for ContactRegistered { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ContactRegistered { ref user_id , ref date } = self ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ContactRegistered { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ContactRegistered { user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for ContactRegistered { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: ContactRegistered ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateDcOptions`\n\n```text\nupdateDcOptions#8e5e9873 dc_options:Vector<DcOption> = Update;\n```\n" ] pub struct DcOptions { pub dc_options : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: DcOption > , } impl :: BareSerialize for DcOptions { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & DcOptions { ref dc_options } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: DcOption > > ( dc_options ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for DcOptions { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( DcOptions { dc_options : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: DcOption > > ( ) ? , } ) } } impl :: IntoBoxed for DcOptions { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: DcOptions ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateDeleteChannelMessages`\n\n```text\nupdateDeleteChannelMessages#c37521c9 channel_id:int messages:Vector<int> pts:int pts_count:int = Update;\n```\n" ] pub struct DeleteChannelMessages { pub channel_id : :: mtproto :: int , pub messages : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > , pub pts : :: mtproto :: int , pub pts_count : :: mtproto :: int , } impl :: BareSerialize for DeleteChannelMessages { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & DeleteChannelMessages { ref channel_id , ref messages , ref pts , ref pts_count } = self ; _ser . write_bare :: < :: mtproto :: int > ( channel_id ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > > ( messages ) ? ; _ser . write_bare :: < :: mtproto :: int > ( pts ) ? ; _ser . write_bare :: < :: mtproto :: int > ( pts_count ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for DeleteChannelMessages { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( DeleteChannelMessages { channel_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , messages : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > > ( ) ? , pts : _de . read_bare :: < :: mtproto :: int > ( ) ? , pts_count : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for DeleteChannelMessages { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: DeleteChannelMessages ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateDeleteMessages`\n\n```text\nupdateDeleteMessages#a20db0e5 messages:Vector<int> pts:int pts_count:int = Update;\n```\n" ] pub struct DeleteMessages { pub messages : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > , pub pts : :: mtproto :: int , pub pts_count : :: mtproto :: int , } impl :: BareSerialize for DeleteMessages { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & DeleteMessages { ref messages , ref pts , ref pts_count } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > > ( messages ) ? ; _ser . write_bare :: < :: mtproto :: int > ( pts ) ? ; _ser . write_bare :: < :: mtproto :: int > ( pts_count ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for DeleteMessages { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( DeleteMessages { messages : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > > ( ) ? , pts : _de . read_bare :: < :: mtproto :: int > ( ) ? , pts_count : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for DeleteMessages { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: DeleteMessages ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateDialogPinned`\n\n```text\nupdateDialogPinned#d711a2cc flags:# pinned:flags.0?true peer:Peer = Update;\n```\n" ] pub struct DialogPinned { pub pinned : bool , pub peer : :: mtproto :: Peer , } impl :: BareSerialize for DialogPinned { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & DialogPinned { pinned , ref peer } = self ; let mut _flags = 0i32 ; if pinned { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_boxed :: < :: mtproto :: Peer > ( peer ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for DialogPinned { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( DialogPinned { pinned : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 0u32 ) != 0 } , peer : _de . read_boxed :: < :: mtproto :: Peer > ( ) ? , } ) } } impl :: IntoBoxed for DialogPinned { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: DialogPinned ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateDraftMessage`\n\n```text\nupdateDraftMessage#ee2bb969 peer:Peer draft:DraftMessage = Update;\n```\n" ] pub struct DraftMessage { pub peer : :: mtproto :: Peer , pub draft : :: mtproto :: DraftMessage , } impl :: BareSerialize for DraftMessage { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & DraftMessage { ref peer , ref draft } = self ; _ser . write_boxed :: < :: mtproto :: Peer > ( peer ) ? ; _ser . write_boxed :: < :: mtproto :: DraftMessage > ( draft ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for DraftMessage { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( DraftMessage { peer : _de . read_boxed :: < :: mtproto :: Peer > ( ) ? , draft : _de . read_boxed :: < :: mtproto :: DraftMessage > ( ) ? , } ) } } impl :: IntoBoxed for DraftMessage { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: DraftMessage ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateEditChannelMessage`\n\n```text\nupdateEditChannelMessage#1b3f4df7 message:Message pts:int pts_count:int = Update;\n```\n" ] pub struct EditChannelMessage { pub message : :: mtproto :: Message , pub pts : :: mtproto :: int , pub pts_count : :: mtproto :: int , } impl :: BareSerialize for EditChannelMessage { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & EditChannelMessage { ref message , ref pts , ref pts_count } = self ; _ser . write_boxed :: < :: mtproto :: Message > ( message ) ? ; _ser . write_bare :: < :: mtproto :: int > ( pts ) ? ; _ser . write_bare :: < :: mtproto :: int > ( pts_count ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for EditChannelMessage { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( EditChannelMessage { message : _de . read_boxed :: < :: mtproto :: Message > ( ) ? , pts : _de . read_bare :: < :: mtproto :: int > ( ) ? , pts_count : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for EditChannelMessage { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: EditChannelMessage ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateEditMessage`\n\n```text\nupdateEditMessage#e40370a3 message:Message pts:int pts_count:int = Update;\n```\n" ] pub struct EditMessage { pub message : :: mtproto :: Message , pub pts : :: mtproto :: int , pub pts_count : :: mtproto :: int , } impl :: BareSerialize for EditMessage { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & EditMessage { ref message , ref pts , ref pts_count } = self ; _ser . write_boxed :: < :: mtproto :: Message > ( message ) ? ; _ser . write_bare :: < :: mtproto :: int > ( pts ) ? ; _ser . write_bare :: < :: mtproto :: int > ( pts_count ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for EditMessage { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( EditMessage { message : _de . read_boxed :: < :: mtproto :: Message > ( ) ? , pts : _de . read_bare :: < :: mtproto :: int > ( ) ? , pts_count : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for EditMessage { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: EditMessage ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateEncryptedChatTyping`\n\n```text\nupdateEncryptedChatTyping#1710f156 chat_id:int = Update;\n```\n" ] pub struct EncryptedChatTyping { pub chat_id : :: mtproto :: int , } impl :: BareSerialize for EncryptedChatTyping { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & EncryptedChatTyping { ref chat_id } = self ; _ser . write_bare :: < :: mtproto :: int > ( chat_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for EncryptedChatTyping { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( EncryptedChatTyping { chat_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for EncryptedChatTyping { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: EncryptedChatTyping ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateEncryptedMessagesRead`\n\n```text\nupdateEncryptedMessagesRead#38fe25b7 chat_id:int max_date:int date:int = Update;\n```\n" ] pub struct EncryptedMessagesRead { pub chat_id : :: mtproto :: int , pub max_date : :: mtproto :: int , pub date : :: mtproto :: int , } impl :: BareSerialize for EncryptedMessagesRead { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & EncryptedMessagesRead { ref chat_id , ref max_date , ref date } = self ; _ser . write_bare :: < :: mtproto :: int > ( chat_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( max_date ) ? ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for EncryptedMessagesRead { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( EncryptedMessagesRead { chat_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , max_date : _de . read_bare :: < :: mtproto :: int > ( ) ? , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for EncryptedMessagesRead { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: EncryptedMessagesRead ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateEncryption`\n\n```text\nupdateEncryption#b4a2e88d chat:EncryptedChat date:int = Update;\n```\n" ] pub struct Encryption { pub chat : :: mtproto :: EncryptedChat , pub date : :: mtproto :: int , } impl :: BareSerialize for Encryption { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Encryption { ref chat , ref date } = self ; _ser . write_boxed :: < :: mtproto :: EncryptedChat > ( chat ) ? ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Encryption { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Encryption { chat : _de . read_boxed :: < :: mtproto :: EncryptedChat > ( ) ? , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for Encryption { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: Encryption ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateInlineBotCallbackQuery`\n\n```text\nupdateInlineBotCallbackQuery#f9d27a5a flags:# query_id:long user_id:int msg_id:InputBotInlineMessageID chat_instance:long data:flags.0?bytes game_short_name:flags.1?string = Update;\n```\n" ] pub struct InlineBotCallbackQuery { pub query_id : :: mtproto :: long , pub user_id : :: mtproto :: int , pub msg_id : :: mtproto :: InputBotInlineMessageID , pub chat_instance : :: mtproto :: long , pub data : Option < :: mtproto :: bytes > , pub game_short_name : Option < :: mtproto :: string > , } impl :: BareSerialize for InlineBotCallbackQuery { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & InlineBotCallbackQuery { ref query_id , ref user_id , ref msg_id , ref chat_instance , ref data , ref game_short_name } = self ; let mut _flags = 0i32 ; if data . is_some ( ) { _flags |= 1 << 0u32 ; } if game_short_name . is_some ( ) { _flags |= 1 << 1u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: long > ( query_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; _ser . write_boxed :: < :: mtproto :: InputBotInlineMessageID > ( msg_id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( chat_instance ) ? ; if let & Some ( ref inner ) = data { _ser . write_bare :: < :: mtproto :: bytes > ( inner ) ? ; } if let & Some ( ref inner ) = game_short_name { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for InlineBotCallbackQuery { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( InlineBotCallbackQuery { query_id : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _de . read_bare :: < :: mtproto :: long > ( ) ? } , user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , msg_id : _de . read_boxed :: < :: mtproto :: InputBotInlineMessageID > ( ) ? , chat_instance : _de . read_bare :: < :: mtproto :: long > ( ) ? , data : if _flags & ( 1 << 0u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: bytes > ( ) ? ) } else { None } , game_short_name : if _flags & ( 1 << 1u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for InlineBotCallbackQuery { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: InlineBotCallbackQuery ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateLangPack`\n\n```text\nupdateLangPack#56022f4d difference:LangPackDifference = Update;\n```\n" ] pub struct LangPack { pub difference : :: mtproto :: LangPackDifference , } impl :: BareSerialize for LangPack { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & LangPack { ref difference } = self ; _ser . write_boxed :: < :: mtproto :: LangPackDifference > ( difference ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for LangPack { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( LangPack { difference : _de . read_boxed :: < :: mtproto :: LangPackDifference > ( ) ? , } ) } } impl :: IntoBoxed for LangPack { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: LangPack ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateMessageID`\n\n```text\nupdateMessageID#4e90bfd6 id:int random_id:long = Update;\n```\n" ] pub struct MessageID { pub id : :: mtproto :: int , pub random_id : :: mtproto :: long , } impl :: BareSerialize for MessageID { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & MessageID { ref id , ref random_id } = self ; _ser . write_bare :: < :: mtproto :: int > ( id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( random_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for MessageID { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( MessageID { id : _de . read_bare :: < :: mtproto :: int > ( ) ? , random_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for MessageID { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: MessageID ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateNewChannelMessage`\n\n```text\nupdateNewChannelMessage#62ba04d9 message:Message pts:int pts_count:int = Update;\n```\n" ] pub struct NewChannelMessage { pub message : :: mtproto :: Message , pub pts : :: mtproto :: int , pub pts_count : :: mtproto :: int , } impl :: BareSerialize for NewChannelMessage { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & NewChannelMessage { ref message , ref pts , ref pts_count } = self ; _ser . write_boxed :: < :: mtproto :: Message > ( message ) ? ; _ser . write_bare :: < :: mtproto :: int > ( pts ) ? ; _ser . write_bare :: < :: mtproto :: int > ( pts_count ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for NewChannelMessage { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( NewChannelMessage { message : _de . read_boxed :: < :: mtproto :: Message > ( ) ? , pts : _de . read_bare :: < :: mtproto :: int > ( ) ? , pts_count : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for NewChannelMessage { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: NewChannelMessage ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateNewEncryptedMessage`\n\n```text\nupdateNewEncryptedMessage#12bcbd9a message:EncryptedMessage qts:int = Update;\n```\n" ] pub struct NewEncryptedMessage { pub message : :: mtproto :: EncryptedMessage , pub qts : :: mtproto :: int , } impl :: BareSerialize for NewEncryptedMessage { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & NewEncryptedMessage { ref message , ref qts } = self ; _ser . write_boxed :: < :: mtproto :: EncryptedMessage > ( message ) ? ; _ser . write_bare :: < :: mtproto :: int > ( qts ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for NewEncryptedMessage { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( NewEncryptedMessage { message : _de . read_boxed :: < :: mtproto :: EncryptedMessage > ( ) ? , qts : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for NewEncryptedMessage { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: NewEncryptedMessage ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateNewMessage`\n\n```text\nupdateNewMessage#1f2b0afd message:Message pts:int pts_count:int = Update;\n```\n" ] pub struct NewMessage { pub message : :: mtproto :: Message , pub pts : :: mtproto :: int , pub pts_count : :: mtproto :: int , } impl :: BareSerialize for NewMessage { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & NewMessage { ref message , ref pts , ref pts_count } = self ; _ser . write_boxed :: < :: mtproto :: Message > ( message ) ? ; _ser . write_bare :: < :: mtproto :: int > ( pts ) ? ; _ser . write_bare :: < :: mtproto :: int > ( pts_count ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for NewMessage { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( NewMessage { message : _de . read_boxed :: < :: mtproto :: Message > ( ) ? , pts : _de . read_bare :: < :: mtproto :: int > ( ) ? , pts_count : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for NewMessage { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: NewMessage ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateNewStickerSet`\n\n```text\nupdateNewStickerSet#688a30aa stickerset:messages.StickerSet = Update;\n```\n" ] pub struct NewStickerSet { pub stickerset : :: mtproto :: messages :: StickerSet , } impl :: BareSerialize for NewStickerSet { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & NewStickerSet { ref stickerset } = self ; _ser . write_boxed :: < :: mtproto :: messages :: StickerSet > ( stickerset ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for NewStickerSet { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( NewStickerSet { stickerset : _de . read_boxed :: < :: mtproto :: messages :: StickerSet > ( ) ? , } ) } } impl :: IntoBoxed for NewStickerSet { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: NewStickerSet ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateNotifySettings`\n\n```text\nupdateNotifySettings#bec268ef peer:NotifyPeer notify_settings:PeerNotifySettings = Update;\n```\n" ] pub struct NotifySettings { pub peer : :: mtproto :: NotifyPeer , pub notify_settings : :: mtproto :: PeerNotifySettings , } impl :: BareSerialize for NotifySettings { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & NotifySettings { ref peer , ref notify_settings } = self ; _ser . write_boxed :: < :: mtproto :: NotifyPeer > ( peer ) ? ; _ser . write_boxed :: < :: mtproto :: PeerNotifySettings > ( notify_settings ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for NotifySettings { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( NotifySettings { peer : _de . read_boxed :: < :: mtproto :: NotifyPeer > ( ) ? , notify_settings : _de . read_boxed :: < :: mtproto :: PeerNotifySettings > ( ) ? , } ) } } impl :: IntoBoxed for NotifySettings { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: NotifySettings ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updatePhoneCall`\n\n```text\nupdatePhoneCall#ab0f6b1e phone_call:PhoneCall = Update;\n```\n" ] pub struct PhoneCall { pub phone_call : :: mtproto :: PhoneCall , } impl :: BareSerialize for PhoneCall { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & PhoneCall { ref phone_call } = self ; _ser . write_boxed :: < :: mtproto :: PhoneCall > ( phone_call ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for PhoneCall { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( PhoneCall { phone_call : _de . read_boxed :: < :: mtproto :: PhoneCall > ( ) ? , } ) } } impl :: IntoBoxed for PhoneCall { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: PhoneCall ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updatePinnedDialogs`\n\n```text\nupdatePinnedDialogs#d8caf68d flags:# order:flags.0?Vector<Peer> = Update;\n```\n" ] pub struct PinnedDialogs { pub order : Option < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Peer > > , } impl :: BareSerialize for PinnedDialogs { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & PinnedDialogs { ref order } = self ; let mut _flags = 0i32 ; if order . is_some ( ) { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; if let & Some ( ref inner ) = order { _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Peer > > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for PinnedDialogs { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( PinnedDialogs { order : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; if _flags & ( 1 << 0u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Peer > > ( ) ? ) } else { None } } , } ) } } impl :: IntoBoxed for PinnedDialogs { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: PinnedDialogs ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updatePrivacy`\n\n```text\nupdatePrivacy#ee3b272a key:PrivacyKey rules:Vector<PrivacyRule> = Update;\n```\n" ] pub struct Privacy { pub key : :: mtproto :: PrivacyKey , pub rules : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PrivacyRule > , } impl :: BareSerialize for Privacy { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Privacy { ref key , ref rules } = self ; _ser . write_boxed :: < :: mtproto :: PrivacyKey > ( key ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PrivacyRule > > ( rules ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Privacy { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Privacy { key : _de . read_boxed :: < :: mtproto :: PrivacyKey > ( ) ? , rules : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PrivacyRule > > ( ) ? , } ) } } impl :: IntoBoxed for Privacy { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: Privacy ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateReadChannelInbox`\n\n```text\nupdateReadChannelInbox#4214f37f channel_id:int max_id:int = Update;\n```\n" ] pub struct ReadChannelInbox { pub channel_id : :: mtproto :: int , pub max_id : :: mtproto :: int , } impl :: BareSerialize for ReadChannelInbox { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ReadChannelInbox { ref channel_id , ref max_id } = self ; _ser . write_bare :: < :: mtproto :: int > ( channel_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( max_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ReadChannelInbox { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ReadChannelInbox { channel_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , max_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for ReadChannelInbox { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: ReadChannelInbox ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateReadChannelOutbox`\n\n```text\nupdateReadChannelOutbox#25d6c9c7 channel_id:int max_id:int = Update;\n```\n" ] pub struct ReadChannelOutbox { pub channel_id : :: mtproto :: int , pub max_id : :: mtproto :: int , } impl :: BareSerialize for ReadChannelOutbox { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ReadChannelOutbox { ref channel_id , ref max_id } = self ; _ser . write_bare :: < :: mtproto :: int > ( channel_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( max_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ReadChannelOutbox { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ReadChannelOutbox { channel_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , max_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for ReadChannelOutbox { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: ReadChannelOutbox ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateReadHistoryInbox`\n\n```text\nupdateReadHistoryInbox#9961fd5c peer:Peer max_id:int pts:int pts_count:int = Update;\n```\n" ] pub struct ReadHistoryInbox { pub peer : :: mtproto :: Peer , pub max_id : :: mtproto :: int , pub pts : :: mtproto :: int , pub pts_count : :: mtproto :: int , } impl :: BareSerialize for ReadHistoryInbox { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ReadHistoryInbox { ref peer , ref max_id , ref pts , ref pts_count } = self ; _ser . write_boxed :: < :: mtproto :: Peer > ( peer ) ? ; _ser . write_bare :: < :: mtproto :: int > ( max_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( pts ) ? ; _ser . write_bare :: < :: mtproto :: int > ( pts_count ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ReadHistoryInbox { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ReadHistoryInbox { peer : _de . read_boxed :: < :: mtproto :: Peer > ( ) ? , max_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , pts : _de . read_bare :: < :: mtproto :: int > ( ) ? , pts_count : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for ReadHistoryInbox { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: ReadHistoryInbox ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateReadHistoryOutbox`\n\n```text\nupdateReadHistoryOutbox#2f2f21bf peer:Peer max_id:int pts:int pts_count:int = Update;\n```\n" ] pub struct ReadHistoryOutbox { pub peer : :: mtproto :: Peer , pub max_id : :: mtproto :: int , pub pts : :: mtproto :: int , pub pts_count : :: mtproto :: int , } impl :: BareSerialize for ReadHistoryOutbox { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ReadHistoryOutbox { ref peer , ref max_id , ref pts , ref pts_count } = self ; _ser . write_boxed :: < :: mtproto :: Peer > ( peer ) ? ; _ser . write_bare :: < :: mtproto :: int > ( max_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( pts ) ? ; _ser . write_bare :: < :: mtproto :: int > ( pts_count ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ReadHistoryOutbox { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ReadHistoryOutbox { peer : _de . read_boxed :: < :: mtproto :: Peer > ( ) ? , max_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , pts : _de . read_bare :: < :: mtproto :: int > ( ) ? , pts_count : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for ReadHistoryOutbox { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: ReadHistoryOutbox ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateReadMessagesContents`\n\n```text\nupdateReadMessagesContents#68c13933 messages:Vector<int> pts:int pts_count:int = Update;\n```\n" ] pub struct ReadMessagesContents { pub messages : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > , pub pts : :: mtproto :: int , pub pts_count : :: mtproto :: int , } impl :: BareSerialize for ReadMessagesContents { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ReadMessagesContents { ref messages , ref pts , ref pts_count } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > > ( messages ) ? ; _ser . write_bare :: < :: mtproto :: int > ( pts ) ? ; _ser . write_bare :: < :: mtproto :: int > ( pts_count ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ReadMessagesContents { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ReadMessagesContents { messages : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > > ( ) ? , pts : _de . read_bare :: < :: mtproto :: int > ( ) ? , pts_count : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for ReadMessagesContents { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: ReadMessagesContents ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateServiceNotification`\n\n```text\nupdateServiceNotification#ebe46819 flags:# popup:flags.0?true inbox_date:flags.1?int type:string message:string media:MessageMedia entities:Vector<MessageEntity> = Update;\n```\n" ] pub struct ServiceNotification { pub popup : bool , pub inbox_date : Option < :: mtproto :: int > , pub type_ : :: mtproto :: string , pub message : :: mtproto :: string , pub media : :: mtproto :: MessageMedia , pub entities : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: MessageEntity > , } impl :: BareSerialize for ServiceNotification { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ServiceNotification { popup , ref inbox_date , ref type_ , ref message , ref media , ref entities } = self ; let mut _flags = 0i32 ; if popup { _flags |= 1 << 0u32 ; } if inbox_date . is_some ( ) { _flags |= 1 << 1u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; if let & Some ( ref inner ) = inbox_date { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } _ser . write_bare :: < :: mtproto :: string > ( type_ ) ? ; _ser . write_bare :: < :: mtproto :: string > ( message ) ? ; _ser . write_boxed :: < :: mtproto :: MessageMedia > ( media ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: MessageEntity > > ( entities ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ServiceNotification { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( ServiceNotification { popup : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 0u32 ) != 0 } , inbox_date : if _flags & ( 1 << 1u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , type_ : _de . read_bare :: < :: mtproto :: string > ( ) ? , message : _de . read_bare :: < :: mtproto :: string > ( ) ? , media : _de . read_boxed :: < :: mtproto :: MessageMedia > ( ) ? , entities : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: MessageEntity > > ( ) ? , } ) } } impl :: IntoBoxed for ServiceNotification { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: ServiceNotification ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateStickerSetsOrder`\n\n```text\nupdateStickerSetsOrder#bb2d201 flags:# masks:flags.0?true order:Vector<long> = Update;\n```\n" ] pub struct StickerSetsOrder { pub masks : bool , pub order : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > , } impl :: BareSerialize for StickerSetsOrder { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & StickerSetsOrder { masks , ref order } = self ; let mut _flags = 0i32 ; if masks { _flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > > ( order ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for StickerSetsOrder { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( StickerSetsOrder { masks : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 0u32 ) != 0 } , order : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > > ( ) ? , } ) } } impl :: IntoBoxed for StickerSetsOrder { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: StickerSetsOrder ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateUserBlocked`\n\n```text\nupdateUserBlocked#80ece81a user_id:int blocked:Bool = Update;\n```\n" ] pub struct UserBlocked { pub user_id : :: mtproto :: int , pub blocked : :: mtproto :: Bool , } impl :: BareSerialize for UserBlocked { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & UserBlocked { ref user_id , ref blocked } = self ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; _ser . write_boxed :: < :: mtproto :: Bool > ( blocked ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for UserBlocked { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( UserBlocked { user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , blocked : _de . read_boxed :: < :: mtproto :: Bool > ( ) ? , } ) } } impl :: IntoBoxed for UserBlocked { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: UserBlocked ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateUserName`\n\n```text\nupdateUserName#a7332b73 user_id:int first_name:string last_name:string username:string = Update;\n```\n" ] pub struct UserName { pub user_id : :: mtproto :: int , pub first_name : :: mtproto :: string , pub last_name : :: mtproto :: string , pub username : :: mtproto :: string , } impl :: BareSerialize for UserName { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & UserName { ref user_id , ref first_name , ref last_name , ref username } = self ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; _ser . write_bare :: < :: mtproto :: string > ( first_name ) ? ; _ser . write_bare :: < :: mtproto :: string > ( last_name ) ? ; _ser . write_bare :: < :: mtproto :: string > ( username ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for UserName { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( UserName { user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , first_name : _de . read_bare :: < :: mtproto :: string > ( ) ? , last_name : _de . read_bare :: < :: mtproto :: string > ( ) ? , username : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for UserName { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: UserName ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateUserPhone`\n\n```text\nupdateUserPhone#12b9417b user_id:int phone:string = Update;\n```\n" ] pub struct UserPhone { pub user_id : :: mtproto :: int , pub phone : :: mtproto :: string , } impl :: BareSerialize for UserPhone { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & UserPhone { ref user_id , ref phone } = self ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; _ser . write_bare :: < :: mtproto :: string > ( phone ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for UserPhone { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( UserPhone { user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , phone : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for UserPhone { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: UserPhone ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateUserPhoto`\n\n```text\nupdateUserPhoto#95313b0c user_id:int date:int photo:UserProfilePhoto previous:Bool = Update;\n```\n" ] pub struct UserPhoto { pub user_id : :: mtproto :: int , pub date : :: mtproto :: int , pub photo : :: mtproto :: UserProfilePhoto , pub previous : :: mtproto :: Bool , } impl :: BareSerialize for UserPhoto { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & UserPhoto { ref user_id , ref date , ref photo , ref previous } = self ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; _ser . write_boxed :: < :: mtproto :: UserProfilePhoto > ( photo ) ? ; _ser . write_boxed :: < :: mtproto :: Bool > ( previous ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for UserPhoto { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( UserPhoto { user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , photo : _de . read_boxed :: < :: mtproto :: UserProfilePhoto > ( ) ? , previous : _de . read_boxed :: < :: mtproto :: Bool > ( ) ? , } ) } } impl :: IntoBoxed for UserPhoto { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: UserPhoto ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateUserStatus`\n\n```text\nupdateUserStatus#1bfbd823 user_id:int status:UserStatus = Update;\n```\n" ] pub struct UserStatus { pub user_id : :: mtproto :: int , pub status : :: mtproto :: UserStatus , } impl :: BareSerialize for UserStatus { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & UserStatus { ref user_id , ref status } = self ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; _ser . write_boxed :: < :: mtproto :: UserStatus > ( status ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for UserStatus { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( UserStatus { user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , status : _de . read_boxed :: < :: mtproto :: UserStatus > ( ) ? , } ) } } impl :: IntoBoxed for UserStatus { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: UserStatus ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateUserTyping`\n\n```text\nupdateUserTyping#5c486927 user_id:int action:SendMessageAction = Update;\n```\n" ] pub struct UserTyping { pub user_id : :: mtproto :: int , pub action : :: mtproto :: SendMessageAction , } impl :: BareSerialize for UserTyping { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & UserTyping { ref user_id , ref action } = self ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; _ser . write_boxed :: < :: mtproto :: SendMessageAction > ( action ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for UserTyping { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( UserTyping { user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , action : _de . read_boxed :: < :: mtproto :: SendMessageAction > ( ) ? , } ) } } impl :: IntoBoxed for UserTyping { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: UserTyping ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateWebPage`\n\n```text\nupdateWebPage#7f891213 webpage:WebPage pts:int pts_count:int = Update;\n```\n" ] pub struct WebPage { pub webpage : :: mtproto :: WebPage , pub pts : :: mtproto :: int , pub pts_count : :: mtproto :: int , } impl :: BareSerialize for WebPage { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & WebPage { ref webpage , ref pts , ref pts_count } = self ; _ser . write_boxed :: < :: mtproto :: WebPage > ( webpage ) ? ; _ser . write_bare :: < :: mtproto :: int > ( pts ) ? ; _ser . write_bare :: < :: mtproto :: int > ( pts_count ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for WebPage { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( WebPage { webpage : _de . read_boxed :: < :: mtproto :: WebPage > ( ) ? , pts : _de . read_bare :: < :: mtproto :: int > ( ) ? , pts_count : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for WebPage { type Boxed = :: mtproto :: Update ; fn into_boxed ( self ) -> :: mtproto :: Update { :: mtproto :: Update :: WebPage ( self ) } } } pub mod updates { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updates.ChannelDifference`\n\n```text\nupdates.channelDifferenceEmpty#3e11affb flags:# final:flags.0?true pts:int timeout:flags.1?int = updates.ChannelDifference;\n\nupdates.channelDifferenceTooLong#6a9d7b35 flags:# final:flags.0?true pts:int timeout:flags.1?int top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = updates.ChannelDifference;\n\nupdates.channelDifference#2064674e flags:# final:flags.0?true pts:int timeout:flags.1?int new_messages:Vector<Message> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> = updates.ChannelDifference;\n```\n" ] pub enum ChannelDifference { Empty ( :: mtproto :: updates :: channel_difference :: Empty ) , TooLong ( :: mtproto :: updates :: channel_difference :: TooLong ) , ChannelDifference ( :: mtproto :: updates :: channel_difference :: ChannelDifference ) , } impl ChannelDifference { pub fn chats ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > { match self { & ChannelDifference :: ChannelDifference ( ref x ) => Some ( & x . chats ) , & ChannelDifference :: TooLong ( ref x ) => Some ( & x . chats ) , _ => None } } pub fn final_ ( & self ) -> bool { match self { & ChannelDifference :: ChannelDifference ( ref x ) => x . final_ , & ChannelDifference :: Empty ( ref x ) => x . final_ , & ChannelDifference :: TooLong ( ref x ) => x . final_ , } } pub fn messages ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Message > > { match self { & ChannelDifference :: TooLong ( ref x ) => Some ( & x . messages ) , _ => None } } pub fn new_messages ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Message > > { match self { & ChannelDifference :: ChannelDifference ( ref x ) => Some ( & x . new_messages ) , _ => None } } pub fn other_updates ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Update > > { match self { & ChannelDifference :: ChannelDifference ( ref x ) => Some ( & x . other_updates ) , _ => None } } pub fn pts ( & self ) -> & :: mtproto :: int { match self { & ChannelDifference :: TooLong ( ref x ) => & x . pts , & ChannelDifference :: Empty ( ref x ) => & x . pts , & ChannelDifference :: ChannelDifference ( ref x ) => & x . pts , } } pub fn read_inbox_max_id ( & self ) -> Option < & :: mtproto :: int > { match self { & ChannelDifference :: TooLong ( ref x ) => Some ( & x . read_inbox_max_id ) , _ => None } } pub fn read_outbox_max_id ( & self ) -> Option < & :: mtproto :: int > { match self { & ChannelDifference :: TooLong ( ref x ) => Some ( & x . read_outbox_max_id ) , _ => None } } pub fn timeout ( & self ) -> Option < & :: mtproto :: int > { match self { & ChannelDifference :: Empty ( ref x ) => x . timeout . as_ref ( ) , & ChannelDifference :: TooLong ( ref x ) => x . timeout . as_ref ( ) , & ChannelDifference :: ChannelDifference ( ref x ) => x . timeout . as_ref ( ) , } } pub fn top_message ( & self ) -> Option < & :: mtproto :: int > { match self { & ChannelDifference :: TooLong ( ref x ) => Some ( & x . top_message ) , _ => None } } pub fn unread_count ( & self ) -> Option < & :: mtproto :: int > { match self { & ChannelDifference :: TooLong ( ref x ) => Some ( & x . unread_count ) , _ => None } } pub fn unread_mentions_count ( & self ) -> Option < & :: mtproto :: int > { match self { & ChannelDifference :: TooLong ( ref x ) => Some ( & x . unread_mentions_count ) , _ => None } } pub fn users ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > { match self { & ChannelDifference :: ChannelDifference ( ref x ) => Some ( & x . users ) , & ChannelDifference :: TooLong ( ref x ) => Some ( & x . users ) , _ => None } } } impl :: BoxedSerialize for ChannelDifference { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ChannelDifference :: Empty ( ref x ) => ( :: ConstructorNumber ( 0x3e11affb ) , x ) , & ChannelDifference :: TooLong ( ref x ) => ( :: ConstructorNumber ( 0x6a9d7b35 ) , x ) , & ChannelDifference :: ChannelDifference ( ref x ) => ( :: ConstructorNumber ( 0x2064674e ) , x ) , } } } impl :: BoxedDeserialize for ChannelDifference { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x3e11affb ) , :: ConstructorNumber ( 0x6a9d7b35 ) , :: ConstructorNumber ( 0x2064674e ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x3e11affb ) => Ok ( ChannelDifference :: Empty ( _de . read_bare :: < :: mtproto :: updates :: channel_difference :: Empty > ( ) ? ) ) , :: ConstructorNumber ( 0x6a9d7b35 ) => Ok ( ChannelDifference :: TooLong ( _de . read_bare :: < :: mtproto :: updates :: channel_difference :: TooLong > ( ) ? ) ) , :: ConstructorNumber ( 0x2064674e ) => Ok ( ChannelDifference :: ChannelDifference ( _de . read_bare :: < :: mtproto :: updates :: channel_difference :: ChannelDifference > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updates.Difference`\n\n```text\nupdates.differenceEmpty#5d75a138 date:int seq:int = updates.Difference;\n\nupdates.difference#f49ca0 new_messages:Vector<Message> new_encrypted_messages:Vector<EncryptedMessage> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> state:updates.State = updates.Difference;\n\nupdates.differenceSlice#a8fb1981 new_messages:Vector<Message> new_encrypted_messages:Vector<EncryptedMessage> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> intermediate_state:updates.State = updates.Difference;\n\nupdates.differenceTooLong#4afe8f6d pts:int = updates.Difference;\n```\n" ] pub enum Difference { Empty ( :: mtproto :: updates :: difference :: Empty ) , Difference ( :: mtproto :: updates :: difference :: Difference ) , Slice ( :: mtproto :: updates :: difference :: Slice ) , TooLong ( :: mtproto :: updates :: difference :: TooLong ) , } impl Difference { pub fn chats ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > { match self { & Difference :: Difference ( ref x ) => Some ( & x . chats ) , & Difference :: Slice ( ref x ) => Some ( & x . chats ) , _ => None } } pub fn date ( & self ) -> Option < & :: mtproto :: int > { match self { & Difference :: Empty ( ref x ) => Some ( & x . date ) , _ => None } } pub fn intermediate_state ( & self ) -> Option < & :: mtproto :: updates :: State > { match self { & Difference :: Slice ( ref x ) => Some ( & x . intermediate_state ) , _ => None } } pub fn new_encrypted_messages ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: EncryptedMessage > > { match self { & Difference :: Slice ( ref x ) => Some ( & x . new_encrypted_messages ) , & Difference :: Difference ( ref x ) => Some ( & x . new_encrypted_messages ) , _ => None } } pub fn new_messages ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Message > > { match self { & Difference :: Difference ( ref x ) => Some ( & x . new_messages ) , & Difference :: Slice ( ref x ) => Some ( & x . new_messages ) , _ => None } } pub fn other_updates ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Update > > { match self { & Difference :: Slice ( ref x ) => Some ( & x . other_updates ) , & Difference :: Difference ( ref x ) => Some ( & x . other_updates ) , _ => None } } pub fn pts ( & self ) -> Option < & :: mtproto :: int > { match self { & Difference :: TooLong ( ref x ) => Some ( & x . pts ) , _ => None } } pub fn seq ( & self ) -> Option < & :: mtproto :: int > { match self { & Difference :: Empty ( ref x ) => Some ( & x . seq ) , _ => None } } pub fn state ( & self ) -> Option < & :: mtproto :: updates :: State > { match self { & Difference :: Difference ( ref x ) => Some ( & x . state ) , _ => None } } pub fn users ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > { match self { & Difference :: Difference ( ref x ) => Some ( & x . users ) , & Difference :: Slice ( ref x ) => Some ( & x . users ) , _ => None } } } impl :: BoxedSerialize for Difference { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Difference :: Empty ( ref x ) => ( :: ConstructorNumber ( 0x5d75a138 ) , x ) , & Difference :: Difference ( ref x ) => ( :: ConstructorNumber ( 0x00f49ca0 ) , x ) , & Difference :: Slice ( ref x ) => ( :: ConstructorNumber ( 0xa8fb1981 ) , x ) , & Difference :: TooLong ( ref x ) => ( :: ConstructorNumber ( 0x4afe8f6d ) , x ) , } } } impl :: BoxedDeserialize for Difference { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x5d75a138 ) , :: ConstructorNumber ( 0x00f49ca0 ) , :: ConstructorNumber ( 0xa8fb1981 ) , :: ConstructorNumber ( 0x4afe8f6d ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x5d75a138 ) => Ok ( Difference :: Empty ( _de . read_bare :: < :: mtproto :: updates :: difference :: Empty > ( ) ? ) ) , :: ConstructorNumber ( 0x00f49ca0 ) => Ok ( Difference :: Difference ( _de . read_bare :: < :: mtproto :: updates :: difference :: Difference > ( ) ? ) ) , :: ConstructorNumber ( 0xa8fb1981 ) => Ok ( Difference :: Slice ( _de . read_bare :: < :: mtproto :: updates :: difference :: Slice > ( ) ? ) ) , :: ConstructorNumber ( 0x4afe8f6d ) => Ok ( Difference :: TooLong ( _de . read_bare :: < :: mtproto :: updates :: difference :: TooLong > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updates.State`\n\n```text\nupdates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State;\n```\n" ] pub enum State { State ( :: mtproto :: updates :: state :: State ) , } impl State { pub fn date ( & self ) -> & :: mtproto :: int { match self { & State :: State ( ref x ) => & x . date , } } pub fn pts ( & self ) -> & :: mtproto :: int { match self { & State :: State ( ref x ) => & x . pts , } } pub fn qts ( & self ) -> & :: mtproto :: int { match self { & State :: State ( ref x ) => & x . qts , } } pub fn seq ( & self ) -> & :: mtproto :: int { match self { & State :: State ( ref x ) => & x . seq , } } pub fn unread_count ( & self ) -> & :: mtproto :: int { match self { & State :: State ( ref x ) => & x . unread_count , } } } impl :: BoxedSerialize for State { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & State :: State ( ref x ) => ( :: ConstructorNumber ( 0xa56c2a3e ) , x ) , } } } impl :: BoxedDeserialize for State { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xa56c2a3e ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xa56c2a3e ) => Ok ( State :: State ( _de . read_bare :: < :: mtproto :: updates :: state :: State > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateShort`\n\n```text\nupdateShort#78d4dec1 update:Update date:int = Updates;\n```\n" ] pub struct UpdateShort { pub update : :: mtproto :: Update , pub date : :: mtproto :: int , } impl :: BareSerialize for UpdateShort { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & UpdateShort { ref update , ref date } = self ; _ser . write_boxed :: < :: mtproto :: Update > ( update ) ? ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for UpdateShort { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( UpdateShort { update : _de . read_boxed :: < :: mtproto :: Update > ( ) ? , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for UpdateShort { type Boxed = :: mtproto :: Updates ; fn into_boxed ( self ) -> :: mtproto :: Updates { :: mtproto :: Updates :: UpdateShort ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateShortChatMessage`\n\n```text\nupdateShortChatMessage#16812688 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int from_id:int chat_id:int message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to_msg_id:flags.3?int entities:flags.7?Vector<MessageEntity> = Updates;\n```\n" ] pub struct UpdateShortChatMessage { pub out : bool , pub mentioned : bool , pub media_unread : bool , pub silent : bool , pub id : :: mtproto :: int , pub from_id : :: mtproto :: int , pub chat_id : :: mtproto :: int , pub message : :: mtproto :: string , pub pts : :: mtproto :: int , pub pts_count : :: mtproto :: int , pub date : :: mtproto :: int , pub fwd_from : Option < :: mtproto :: MessageFwdHeader > , pub via_bot_id : Option < :: mtproto :: int > , pub reply_to_msg_id : Option < :: mtproto :: int > , pub entities : Option < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: MessageEntity > > , } impl :: BareSerialize for UpdateShortChatMessage { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & UpdateShortChatMessage { out , mentioned , media_unread , silent , ref id , ref from_id , ref chat_id , ref message , ref pts , ref pts_count , ref date , ref fwd_from , ref via_bot_id , ref reply_to_msg_id , ref entities } = self ; let mut _flags = 0i32 ; if out { _flags |= 1 << 1u32 ; } if mentioned { _flags |= 1 << 4u32 ; } if media_unread { _flags |= 1 << 5u32 ; } if silent { _flags |= 1 << 13u32 ; } if fwd_from . is_some ( ) { _flags |= 1 << 2u32 ; } if via_bot_id . is_some ( ) { _flags |= 1 << 11u32 ; } if reply_to_msg_id . is_some ( ) { _flags |= 1 << 3u32 ; } if entities . is_some ( ) { _flags |= 1 << 7u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: int > ( id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( from_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( chat_id ) ? ; _ser . write_bare :: < :: mtproto :: string > ( message ) ? ; _ser . write_bare :: < :: mtproto :: int > ( pts ) ? ; _ser . write_bare :: < :: mtproto :: int > ( pts_count ) ? ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; if let & Some ( ref inner ) = fwd_from { _ser . write_boxed :: < :: mtproto :: MessageFwdHeader > ( inner ) ? ; } if let & Some ( ref inner ) = via_bot_id { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } if let & Some ( ref inner ) = reply_to_msg_id { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } if let & Some ( ref inner ) = entities { _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: MessageEntity > > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for UpdateShortChatMessage { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( UpdateShortChatMessage { out : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 1u32 ) != 0 } , mentioned : _flags & ( 1 << 4u32 ) != 0 , media_unread : _flags & ( 1 << 5u32 ) != 0 , silent : _flags & ( 1 << 13u32 ) != 0 , id : _de . read_bare :: < :: mtproto :: int > ( ) ? , from_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , chat_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , message : _de . read_bare :: < :: mtproto :: string > ( ) ? , pts : _de . read_bare :: < :: mtproto :: int > ( ) ? , pts_count : _de . read_bare :: < :: mtproto :: int > ( ) ? , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , fwd_from : if _flags & ( 1 << 2u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: MessageFwdHeader > ( ) ? ) } else { None } , via_bot_id : if _flags & ( 1 << 11u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , reply_to_msg_id : if _flags & ( 1 << 3u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , entities : if _flags & ( 1 << 7u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: MessageEntity > > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for UpdateShortChatMessage { type Boxed = :: mtproto :: Updates ; fn into_boxed ( self ) -> :: mtproto :: Updates { :: mtproto :: Updates :: UpdateShortChatMessage ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateShortMessage`\n\n```text\nupdateShortMessage#914fbf11 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int user_id:int message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to_msg_id:flags.3?int entities:flags.7?Vector<MessageEntity> = Updates;\n```\n" ] pub struct UpdateShortMessage { pub out : bool , pub mentioned : bool , pub media_unread : bool , pub silent : bool , pub id : :: mtproto :: int , pub user_id : :: mtproto :: int , pub message : :: mtproto :: string , pub pts : :: mtproto :: int , pub pts_count : :: mtproto :: int , pub date : :: mtproto :: int , pub fwd_from : Option < :: mtproto :: MessageFwdHeader > , pub via_bot_id : Option < :: mtproto :: int > , pub reply_to_msg_id : Option < :: mtproto :: int > , pub entities : Option < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: MessageEntity > > , } impl :: BareSerialize for UpdateShortMessage { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & UpdateShortMessage { out , mentioned , media_unread , silent , ref id , ref user_id , ref message , ref pts , ref pts_count , ref date , ref fwd_from , ref via_bot_id , ref reply_to_msg_id , ref entities } = self ; let mut _flags = 0i32 ; if out { _flags |= 1 << 1u32 ; } if mentioned { _flags |= 1 << 4u32 ; } if media_unread { _flags |= 1 << 5u32 ; } if silent { _flags |= 1 << 13u32 ; } if fwd_from . is_some ( ) { _flags |= 1 << 2u32 ; } if via_bot_id . is_some ( ) { _flags |= 1 << 11u32 ; } if reply_to_msg_id . is_some ( ) { _flags |= 1 << 3u32 ; } if entities . is_some ( ) { _flags |= 1 << 7u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: int > ( id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; _ser . write_bare :: < :: mtproto :: string > ( message ) ? ; _ser . write_bare :: < :: mtproto :: int > ( pts ) ? ; _ser . write_bare :: < :: mtproto :: int > ( pts_count ) ? ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; if let & Some ( ref inner ) = fwd_from { _ser . write_boxed :: < :: mtproto :: MessageFwdHeader > ( inner ) ? ; } if let & Some ( ref inner ) = via_bot_id { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } if let & Some ( ref inner ) = reply_to_msg_id { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } if let & Some ( ref inner ) = entities { _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: MessageEntity > > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for UpdateShortMessage { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( UpdateShortMessage { out : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 1u32 ) != 0 } , mentioned : _flags & ( 1 << 4u32 ) != 0 , media_unread : _flags & ( 1 << 5u32 ) != 0 , silent : _flags & ( 1 << 13u32 ) != 0 , id : _de . read_bare :: < :: mtproto :: int > ( ) ? , user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , message : _de . read_bare :: < :: mtproto :: string > ( ) ? , pts : _de . read_bare :: < :: mtproto :: int > ( ) ? , pts_count : _de . read_bare :: < :: mtproto :: int > ( ) ? , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , fwd_from : if _flags & ( 1 << 2u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: MessageFwdHeader > ( ) ? ) } else { None } , via_bot_id : if _flags & ( 1 << 11u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , reply_to_msg_id : if _flags & ( 1 << 3u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , entities : if _flags & ( 1 << 7u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: MessageEntity > > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for UpdateShortMessage { type Boxed = :: mtproto :: Updates ; fn into_boxed ( self ) -> :: mtproto :: Updates { :: mtproto :: Updates :: UpdateShortMessage ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updateShortSentMessage`\n\n```text\nupdateShortSentMessage#11f1331c flags:# out:flags.1?true id:int pts:int pts_count:int date:int media:flags.9?MessageMedia entities:flags.7?Vector<MessageEntity> = Updates;\n```\n" ] pub struct UpdateShortSentMessage { pub out : bool , pub id : :: mtproto :: int , pub pts : :: mtproto :: int , pub pts_count : :: mtproto :: int , pub date : :: mtproto :: int , pub media : Option < :: mtproto :: MessageMedia > , pub entities : Option < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: MessageEntity > > , } impl :: BareSerialize for UpdateShortSentMessage { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & UpdateShortSentMessage { out , ref id , ref pts , ref pts_count , ref date , ref media , ref entities } = self ; let mut _flags = 0i32 ; if out { _flags |= 1 << 1u32 ; } if media . is_some ( ) { _flags |= 1 << 9u32 ; } if entities . is_some ( ) { _flags |= 1 << 7u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: int > ( id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( pts ) ? ; _ser . write_bare :: < :: mtproto :: int > ( pts_count ) ? ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; if let & Some ( ref inner ) = media { _ser . write_boxed :: < :: mtproto :: MessageMedia > ( inner ) ? ; } if let & Some ( ref inner ) = entities { _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: MessageEntity > > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for UpdateShortSentMessage { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( UpdateShortSentMessage { out : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 1u32 ) != 0 } , id : _de . read_bare :: < :: mtproto :: int > ( ) ? , pts : _de . read_bare :: < :: mtproto :: int > ( ) ? , pts_count : _de . read_bare :: < :: mtproto :: int > ( ) ? , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , media : if _flags & ( 1 << 9u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: MessageMedia > ( ) ? ) } else { None } , entities : if _flags & ( 1 << 7u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: MessageEntity > > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for UpdateShortSentMessage { type Boxed = :: mtproto :: Updates ; fn into_boxed ( self ) -> :: mtproto :: Updates { :: mtproto :: Updates :: UpdateShortSentMessage ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updates`\n\n```text\nupdates#74ae4240 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq:int = Updates;\n```\n" ] pub struct Updates { pub updates : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Update > , pub users : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > , pub chats : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > , pub date : :: mtproto :: int , pub seq : :: mtproto :: int , } impl :: BareSerialize for Updates { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Updates { ref updates , ref users , ref chats , ref date , ref seq } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Update > > ( updates ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( users ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > ( chats ) ? ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; _ser . write_bare :: < :: mtproto :: int > ( seq ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Updates { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Updates { updates : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Update > > ( ) ? , users : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( ) ? , chats : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > ( ) ? , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , seq : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for Updates { type Boxed = :: mtproto :: Updates ; fn into_boxed ( self ) -> :: mtproto :: Updates { :: mtproto :: Updates :: Updates ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updatesCombined`\n\n```text\nupdatesCombined#725b04c3 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq_start:int seq:int = Updates;\n```\n" ] pub struct UpdatesCombined { pub updates : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Update > , pub users : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > , pub chats : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > , pub date : :: mtproto :: int , pub seq_start : :: mtproto :: int , pub seq : :: mtproto :: int , } impl :: BareSerialize for UpdatesCombined { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & UpdatesCombined { ref updates , ref users , ref chats , ref date , ref seq_start , ref seq } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Update > > ( updates ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( users ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > ( chats ) ? ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; _ser . write_bare :: < :: mtproto :: int > ( seq_start ) ? ; _ser . write_bare :: < :: mtproto :: int > ( seq ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for UpdatesCombined { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( UpdatesCombined { updates : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Update > > ( ) ? , users : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( ) ? , chats : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > ( ) ? , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , seq_start : _de . read_bare :: < :: mtproto :: int > ( ) ? , seq : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for UpdatesCombined { type Boxed = :: mtproto :: Updates ; fn into_boxed ( self ) -> :: mtproto :: Updates { :: mtproto :: Updates :: UpdatesCombined ( self ) } } pub mod channel_difference { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updates.channelDifference`\n\n```text\nupdates.channelDifference#2064674e flags:# final:flags.0?true pts:int timeout:flags.1?int new_messages:Vector<Message> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> = updates.ChannelDifference;\n```\n" ] pub struct ChannelDifference { pub final_ : bool , pub pts : :: mtproto :: int , pub timeout : Option < :: mtproto :: int > , pub new_messages : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Message > , pub other_updates : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Update > , pub chats : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > , pub users : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > , } impl :: BareSerialize for ChannelDifference { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ChannelDifference { final_ , ref pts , ref timeout , ref new_messages , ref other_updates , ref chats , ref users } = self ; let mut _flags = 0i32 ; if final_ { _flags |= 1 << 0u32 ; } if timeout . is_some ( ) { _flags |= 1 << 1u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: int > ( pts ) ? ; if let & Some ( ref inner ) = timeout { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Message > > ( new_messages ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Update > > ( other_updates ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > ( chats ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( users ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ChannelDifference { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( ChannelDifference { final_ : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 0u32 ) != 0 } , pts : _de . read_bare :: < :: mtproto :: int > ( ) ? , timeout : if _flags & ( 1 << 1u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , new_messages : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Message > > ( ) ? , other_updates : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Update > > ( ) ? , chats : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > ( ) ? , users : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( ) ? , } ) } } impl :: IntoBoxed for ChannelDifference { type Boxed = :: mtproto :: updates :: ChannelDifference ; fn into_boxed ( self ) -> :: mtproto :: updates :: ChannelDifference { :: mtproto :: updates :: ChannelDifference :: ChannelDifference ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updates.channelDifferenceEmpty`\n\n```text\nupdates.channelDifferenceEmpty#3e11affb flags:# final:flags.0?true pts:int timeout:flags.1?int = updates.ChannelDifference;\n```\n" ] pub struct Empty { pub final_ : bool , pub pts : :: mtproto :: int , pub timeout : Option < :: mtproto :: int > , } impl :: BareSerialize for Empty { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Empty { final_ , ref pts , ref timeout } = self ; let mut _flags = 0i32 ; if final_ { _flags |= 1 << 0u32 ; } if timeout . is_some ( ) { _flags |= 1 << 1u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: int > ( pts ) ? ; if let & Some ( ref inner ) = timeout { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for Empty { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( Empty { final_ : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 0u32 ) != 0 } , pts : _de . read_bare :: < :: mtproto :: int > ( ) ? , timeout : if _flags & ( 1 << 1u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for Empty { type Boxed = :: mtproto :: updates :: ChannelDifference ; fn into_boxed ( self ) -> :: mtproto :: updates :: ChannelDifference { :: mtproto :: updates :: ChannelDifference :: Empty ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updates.channelDifferenceTooLong`\n\n```text\nupdates.channelDifferenceTooLong#6a9d7b35 flags:# final:flags.0?true pts:int timeout:flags.1?int top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = updates.ChannelDifference;\n```\n" ] pub struct TooLong { pub final_ : bool , pub pts : :: mtproto :: int , pub timeout : Option < :: mtproto :: int > , pub top_message : :: mtproto :: int , pub read_inbox_max_id : :: mtproto :: int , pub read_outbox_max_id : :: mtproto :: int , pub unread_count : :: mtproto :: int , pub unread_mentions_count : :: mtproto :: int , pub messages : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Message > , pub chats : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > , pub users : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > , } impl :: BareSerialize for TooLong { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & TooLong { final_ , ref pts , ref timeout , ref top_message , ref read_inbox_max_id , ref read_outbox_max_id , ref unread_count , ref unread_mentions_count , ref messages , ref chats , ref users } = self ; let mut _flags = 0i32 ; if final_ { _flags |= 1 << 0u32 ; } if timeout . is_some ( ) { _flags |= 1 << 1u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: int > ( pts ) ? ; if let & Some ( ref inner ) = timeout { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } _ser . write_bare :: < :: mtproto :: int > ( top_message ) ? ; _ser . write_bare :: < :: mtproto :: int > ( read_inbox_max_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( read_outbox_max_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( unread_count ) ? ; _ser . write_bare :: < :: mtproto :: int > ( unread_mentions_count ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Message > > ( messages ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > ( chats ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( users ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for TooLong { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( TooLong { final_ : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 0u32 ) != 0 } , pts : _de . read_bare :: < :: mtproto :: int > ( ) ? , timeout : if _flags & ( 1 << 1u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , top_message : _de . read_bare :: < :: mtproto :: int > ( ) ? , read_inbox_max_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , read_outbox_max_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , unread_count : _de . read_bare :: < :: mtproto :: int > ( ) ? , unread_mentions_count : _de . read_bare :: < :: mtproto :: int > ( ) ? , messages : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Message > > ( ) ? , chats : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > ( ) ? , users : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( ) ? , } ) } } impl :: IntoBoxed for TooLong { type Boxed = :: mtproto :: updates :: ChannelDifference ; fn into_boxed ( self ) -> :: mtproto :: updates :: ChannelDifference { :: mtproto :: updates :: ChannelDifference :: TooLong ( self ) } } } pub mod difference { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updates.difference`\n\n```text\nupdates.difference#f49ca0 new_messages:Vector<Message> new_encrypted_messages:Vector<EncryptedMessage> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> state:updates.State = updates.Difference;\n```\n" ] pub struct Difference { pub new_messages : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Message > , pub new_encrypted_messages : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: EncryptedMessage > , pub other_updates : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Update > , pub chats : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > , pub users : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > , pub state : :: mtproto :: updates :: State , } impl :: BareSerialize for Difference { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Difference { ref new_messages , ref new_encrypted_messages , ref other_updates , ref chats , ref users , ref state } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Message > > ( new_messages ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: EncryptedMessage > > ( new_encrypted_messages ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Update > > ( other_updates ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > ( chats ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( users ) ? ; _ser . write_boxed :: < :: mtproto :: updates :: State > ( state ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Difference { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Difference { new_messages : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Message > > ( ) ? , new_encrypted_messages : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: EncryptedMessage > > ( ) ? , other_updates : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Update > > ( ) ? , chats : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > ( ) ? , users : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( ) ? , state : _de . read_boxed :: < :: mtproto :: updates :: State > ( ) ? , } ) } } impl :: IntoBoxed for Difference { type Boxed = :: mtproto :: updates :: Difference ; fn into_boxed ( self ) -> :: mtproto :: updates :: Difference { :: mtproto :: updates :: Difference :: Difference ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updates.differenceEmpty`\n\n```text\nupdates.differenceEmpty#5d75a138 date:int seq:int = updates.Difference;\n```\n" ] pub struct Empty { pub date : :: mtproto :: int , pub seq : :: mtproto :: int , } impl :: BareSerialize for Empty { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Empty { ref date , ref seq } = self ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; _ser . write_bare :: < :: mtproto :: int > ( seq ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Empty { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Empty { date : _de . read_bare :: < :: mtproto :: int > ( ) ? , seq : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for Empty { type Boxed = :: mtproto :: updates :: Difference ; fn into_boxed ( self ) -> :: mtproto :: updates :: Difference { :: mtproto :: updates :: Difference :: Empty ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updates.differenceSlice`\n\n```text\nupdates.differenceSlice#a8fb1981 new_messages:Vector<Message> new_encrypted_messages:Vector<EncryptedMessage> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> intermediate_state:updates.State = updates.Difference;\n```\n" ] pub struct Slice { pub new_messages : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Message > , pub new_encrypted_messages : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: EncryptedMessage > , pub other_updates : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Update > , pub chats : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > , pub users : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > , pub intermediate_state : :: mtproto :: updates :: State , } impl :: BareSerialize for Slice { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Slice { ref new_messages , ref new_encrypted_messages , ref other_updates , ref chats , ref users , ref intermediate_state } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Message > > ( new_messages ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: EncryptedMessage > > ( new_encrypted_messages ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Update > > ( other_updates ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > ( chats ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( users ) ? ; _ser . write_boxed :: < :: mtproto :: updates :: State > ( intermediate_state ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Slice { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Slice { new_messages : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Message > > ( ) ? , new_encrypted_messages : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: EncryptedMessage > > ( ) ? , other_updates : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Update > > ( ) ? , chats : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > ( ) ? , users : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > > ( ) ? , intermediate_state : _de . read_boxed :: < :: mtproto :: updates :: State > ( ) ? , } ) } } impl :: IntoBoxed for Slice { type Boxed = :: mtproto :: updates :: Difference ; fn into_boxed ( self ) -> :: mtproto :: updates :: Difference { :: mtproto :: updates :: Difference :: Slice ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updates.differenceTooLong`\n\n```text\nupdates.differenceTooLong#4afe8f6d pts:int = updates.Difference;\n```\n" ] pub struct TooLong { pub pts : :: mtproto :: int , } impl :: BareSerialize for TooLong { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & TooLong { ref pts } = self ; _ser . write_bare :: < :: mtproto :: int > ( pts ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for TooLong { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( TooLong { pts : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for TooLong { type Boxed = :: mtproto :: updates :: Difference ; fn into_boxed ( self ) -> :: mtproto :: updates :: Difference { :: mtproto :: updates :: Difference :: TooLong ( self ) } } } pub mod state { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `updates.state`\n\n```text\nupdates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State;\n```\n" ] pub struct State { pub pts : :: mtproto :: int , pub qts : :: mtproto :: int , pub date : :: mtproto :: int , pub seq : :: mtproto :: int , pub unread_count : :: mtproto :: int , } impl :: BareSerialize for State { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & State { ref pts , ref qts , ref date , ref seq , ref unread_count } = self ; _ser . write_bare :: < :: mtproto :: int > ( pts ) ? ; _ser . write_bare :: < :: mtproto :: int > ( qts ) ? ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; _ser . write_bare :: < :: mtproto :: int > ( seq ) ? ; _ser . write_bare :: < :: mtproto :: int > ( unread_count ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for State { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( State { pts : _de . read_bare :: < :: mtproto :: int > ( ) ? , qts : _de . read_bare :: < :: mtproto :: int > ( ) ? , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , seq : _de . read_bare :: < :: mtproto :: int > ( ) ? , unread_count : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for State { type Boxed = :: mtproto :: updates :: State ; fn into_boxed ( self ) -> :: mtproto :: updates :: State { :: mtproto :: updates :: State :: State ( self ) } } } } pub mod upload { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `upload.CdnFile`\n\n```text\nupload.cdnFileReuploadNeeded#eea8e46e request_token:bytes = upload.CdnFile;\n\nupload.cdnFile#a99fca4f bytes:bytes = upload.CdnFile;\n```\n" ] pub enum CdnFile { ReuploadNeeded ( :: mtproto :: upload :: cdn_file :: ReuploadNeeded ) , CdnFile ( :: mtproto :: upload :: cdn_file :: CdnFile ) , } impl CdnFile { pub fn bytes ( & self ) -> Option < & :: mtproto :: bytes > { match self { & CdnFile :: CdnFile ( ref x ) => Some ( & x . bytes ) , _ => None } } pub fn request_token ( & self ) -> Option < & :: mtproto :: bytes > { match self { & CdnFile :: ReuploadNeeded ( ref x ) => Some ( & x . request_token ) , _ => None } } } impl :: BoxedSerialize for CdnFile { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & CdnFile :: ReuploadNeeded ( ref x ) => ( :: ConstructorNumber ( 0xeea8e46e ) , x ) , & CdnFile :: CdnFile ( ref x ) => ( :: ConstructorNumber ( 0xa99fca4f ) , x ) , } } } impl :: BoxedDeserialize for CdnFile { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xeea8e46e ) , :: ConstructorNumber ( 0xa99fca4f ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xeea8e46e ) => Ok ( CdnFile :: ReuploadNeeded ( _de . read_bare :: < :: mtproto :: upload :: cdn_file :: ReuploadNeeded > ( ) ? ) ) , :: ConstructorNumber ( 0xa99fca4f ) => Ok ( CdnFile :: CdnFile ( _de . read_bare :: < :: mtproto :: upload :: cdn_file :: CdnFile > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `upload.File`\n\n```text\nupload.file#96a18d5 type:storage.FileType mtime:int bytes:bytes = upload.File;\n\nupload.fileCdnRedirect#ea52fe5a dc_id:int file_token:bytes encryption_key:bytes encryption_iv:bytes cdn_file_hashes:Vector<CdnFileHash> = upload.File;\n```\n" ] pub enum File { File ( :: mtproto :: upload :: file :: File ) , CdnRedirect ( :: mtproto :: upload :: file :: CdnRedirect ) , } impl File { pub fn bytes ( & self ) -> Option < & :: mtproto :: bytes > { match self { & File :: File ( ref x ) => Some ( & x . bytes ) , _ => None } } pub fn cdn_file_hashes ( & self ) -> Option < & :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: CdnFileHash > > { match self { & File :: CdnRedirect ( ref x ) => Some ( & x . cdn_file_hashes ) , _ => None } } pub fn dc_id ( & self ) -> Option < & :: mtproto :: int > { match self { & File :: CdnRedirect ( ref x ) => Some ( & x . dc_id ) , _ => None } } pub fn encryption_iv ( & self ) -> Option < & :: mtproto :: bytes > { match self { & File :: CdnRedirect ( ref x ) => Some ( & x . encryption_iv ) , _ => None } } pub fn encryption_key ( & self ) -> Option < & :: mtproto :: bytes > { match self { & File :: CdnRedirect ( ref x ) => Some ( & x . encryption_key ) , _ => None } } pub fn file_token ( & self ) -> Option < & :: mtproto :: bytes > { match self { & File :: CdnRedirect ( ref x ) => Some ( & x . file_token ) , _ => None } } pub fn mtime ( & self ) -> Option < & :: mtproto :: int > { match self { & File :: File ( ref x ) => Some ( & x . mtime ) , _ => None } } pub fn type_ ( & self ) -> Option < & :: mtproto :: storage :: FileType > { match self { & File :: File ( ref x ) => Some ( & x . type_ ) , _ => None } } } impl :: BoxedSerialize for File { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & File :: File ( ref x ) => ( :: ConstructorNumber ( 0x096a18d5 ) , x ) , & File :: CdnRedirect ( ref x ) => ( :: ConstructorNumber ( 0xea52fe5a ) , x ) , } } } impl :: BoxedDeserialize for File { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x096a18d5 ) , :: ConstructorNumber ( 0xea52fe5a ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x096a18d5 ) => Ok ( File :: File ( _de . read_bare :: < :: mtproto :: upload :: file :: File > ( ) ? ) ) , :: ConstructorNumber ( 0xea52fe5a ) => Ok ( File :: CdnRedirect ( _de . read_bare :: < :: mtproto :: upload :: file :: CdnRedirect > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `upload.WebFile`\n\n```text\nupload.webFile#21e753bc size:int mime_type:string file_type:storage.FileType mtime:int bytes:bytes = upload.WebFile;\n```\n" ] pub enum WebFile { WebFile ( :: mtproto :: upload :: web_file :: WebFile ) , } impl WebFile { pub fn bytes ( & self ) -> & :: mtproto :: bytes { match self { & WebFile :: WebFile ( ref x ) => & x . bytes , } } pub fn file_type ( & self ) -> & :: mtproto :: storage :: FileType { match self { & WebFile :: WebFile ( ref x ) => & x . file_type , } } pub fn mime_type ( & self ) -> & :: mtproto :: string { match self { & WebFile :: WebFile ( ref x ) => & x . mime_type , } } pub fn mtime ( & self ) -> & :: mtproto :: int { match self { & WebFile :: WebFile ( ref x ) => & x . mtime , } } pub fn size ( & self ) -> & :: mtproto :: int { match self { & WebFile :: WebFile ( ref x ) => & x . size , } } } impl :: BoxedSerialize for WebFile { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & WebFile :: WebFile ( ref x ) => ( :: ConstructorNumber ( 0x21e753bc ) , x ) , } } } impl :: BoxedDeserialize for WebFile { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x21e753bc ) , ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x21e753bc ) => Ok ( WebFile :: WebFile ( _de . read_bare :: < :: mtproto :: upload :: web_file :: WebFile > ( ) ? ) ) , id => _invalid_id ! ( id ) , } } } pub mod cdn_file { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `upload.cdnFile`\n\n```text\nupload.cdnFile#a99fca4f bytes:bytes = upload.CdnFile;\n```\n" ] pub struct CdnFile { pub bytes : :: mtproto :: bytes , } impl :: BareSerialize for CdnFile { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & CdnFile { bytes : ref bytes_ } = self ; _ser . write_bare :: < :: mtproto :: bytes > ( bytes_ ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for CdnFile { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( CdnFile { bytes : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , } ) } } impl :: IntoBoxed for CdnFile { type Boxed = :: mtproto :: upload :: CdnFile ; fn into_boxed ( self ) -> :: mtproto :: upload :: CdnFile { :: mtproto :: upload :: CdnFile :: CdnFile ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `upload.cdnFileReuploadNeeded`\n\n```text\nupload.cdnFileReuploadNeeded#eea8e46e request_token:bytes = upload.CdnFile;\n```\n" ] pub struct ReuploadNeeded { pub request_token : :: mtproto :: bytes , } impl :: BareSerialize for ReuploadNeeded { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ReuploadNeeded { ref request_token } = self ; _ser . write_bare :: < :: mtproto :: bytes > ( request_token ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ReuploadNeeded { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ReuploadNeeded { request_token : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , } ) } } impl :: IntoBoxed for ReuploadNeeded { type Boxed = :: mtproto :: upload :: CdnFile ; fn into_boxed ( self ) -> :: mtproto :: upload :: CdnFile { :: mtproto :: upload :: CdnFile :: ReuploadNeeded ( self ) } } } pub mod file { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `upload.fileCdnRedirect`\n\n```text\nupload.fileCdnRedirect#ea52fe5a dc_id:int file_token:bytes encryption_key:bytes encryption_iv:bytes cdn_file_hashes:Vector<CdnFileHash> = upload.File;\n```\n" ] pub struct CdnRedirect { pub dc_id : :: mtproto :: int , pub file_token : :: mtproto :: bytes , pub encryption_key : :: mtproto :: bytes , pub encryption_iv : :: mtproto :: bytes , pub cdn_file_hashes : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: CdnFileHash > , } impl :: BareSerialize for CdnRedirect { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & CdnRedirect { ref dc_id , ref file_token , ref encryption_key , ref encryption_iv , ref cdn_file_hashes } = self ; _ser . write_bare :: < :: mtproto :: int > ( dc_id ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( file_token ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( encryption_key ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( encryption_iv ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: CdnFileHash > > ( cdn_file_hashes ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for CdnRedirect { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( CdnRedirect { dc_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , file_token : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , encryption_key : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , encryption_iv : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , cdn_file_hashes : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: CdnFileHash > > ( ) ? , } ) } } impl :: IntoBoxed for CdnRedirect { type Boxed = :: mtproto :: upload :: File ; fn into_boxed ( self ) -> :: mtproto :: upload :: File { :: mtproto :: upload :: File :: CdnRedirect ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `upload.file`\n\n```text\nupload.file#96a18d5 type:storage.FileType mtime:int bytes:bytes = upload.File;\n```\n" ] pub struct File { pub type_ : :: mtproto :: storage :: FileType , pub mtime : :: mtproto :: int , pub bytes : :: mtproto :: bytes , } impl :: BareSerialize for File { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & File { ref type_ , ref mtime , bytes : ref bytes_ } = self ; _ser . write_boxed :: < :: mtproto :: storage :: FileType > ( type_ ) ? ; _ser . write_bare :: < :: mtproto :: int > ( mtime ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( bytes_ ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for File { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( File { type_ : _de . read_boxed :: < :: mtproto :: storage :: FileType > ( ) ? , mtime : _de . read_bare :: < :: mtproto :: int > ( ) ? , bytes : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , } ) } } impl :: IntoBoxed for File { type Boxed = :: mtproto :: upload :: File ; fn into_boxed ( self ) -> :: mtproto :: upload :: File { :: mtproto :: upload :: File :: File ( self ) } } } pub mod web_file { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `upload.webFile`\n\n```text\nupload.webFile#21e753bc size:int mime_type:string file_type:storage.FileType mtime:int bytes:bytes = upload.WebFile;\n```\n" ] pub struct WebFile { pub size : :: mtproto :: int , pub mime_type : :: mtproto :: string , pub file_type : :: mtproto :: storage :: FileType , pub mtime : :: mtproto :: int , pub bytes : :: mtproto :: bytes , } impl :: BareSerialize for WebFile { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & WebFile { ref size , ref mime_type , ref file_type , ref mtime , bytes : ref bytes_ } = self ; _ser . write_bare :: < :: mtproto :: int > ( size ) ? ; _ser . write_bare :: < :: mtproto :: string > ( mime_type ) ? ; _ser . write_boxed :: < :: mtproto :: storage :: FileType > ( file_type ) ? ; _ser . write_bare :: < :: mtproto :: int > ( mtime ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( bytes_ ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for WebFile { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( WebFile { size : _de . read_bare :: < :: mtproto :: int > ( ) ? , mime_type : _de . read_bare :: < :: mtproto :: string > ( ) ? , file_type : _de . read_boxed :: < :: mtproto :: storage :: FileType > ( ) ? , mtime : _de . read_bare :: < :: mtproto :: int > ( ) ? , bytes : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , } ) } } impl :: IntoBoxed for WebFile { type Boxed = :: mtproto :: upload :: WebFile ; fn into_boxed ( self ) -> :: mtproto :: upload :: WebFile { :: mtproto :: upload :: WebFile :: WebFile ( self ) } } } } pub mod user { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `userEmpty`\n\n```text\nuserEmpty#200250ba id:int = User;\n```\n" ] pub struct Empty { pub id : :: mtproto :: int , } impl :: BareSerialize for Empty { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Empty { ref id } = self ; _ser . write_bare :: < :: mtproto :: int > ( id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Empty { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Empty { id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for Empty { type Boxed = :: mtproto :: User ; fn into_boxed ( self ) -> :: mtproto :: User { :: mtproto :: User :: Empty ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `user`\n\n```text\nuser#2e13f4c3 flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true id:int access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?string bot_inline_placeholder:flags.19?string lang_code:flags.22?string = User;\n```\n" ] pub struct User { pub self_ : bool , pub contact : bool , pub mutual_contact : bool , pub deleted : bool , pub bot : bool , pub bot_chat_history : bool , pub bot_nochats : bool , pub verified : bool , pub restricted : bool , pub min : bool , pub bot_inline_geo : bool , pub id : :: mtproto :: int , pub access_hash : Option < :: mtproto :: long > , pub first_name : Option < :: mtproto :: string > , pub last_name : Option < :: mtproto :: string > , pub username : Option < :: mtproto :: string > , pub phone : Option < :: mtproto :: string > , pub photo : Option < :: mtproto :: UserProfilePhoto > , pub status : Option < :: mtproto :: UserStatus > , pub bot_info_version : Option < :: mtproto :: int > , pub restriction_reason : Option < :: mtproto :: string > , pub bot_inline_placeholder : Option < :: mtproto :: string > , pub lang_code : Option < :: mtproto :: string > , } impl :: BareSerialize for User { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & User { self_ , contact , mutual_contact , deleted , bot , bot_chat_history , bot_nochats , verified , restricted , min , bot_inline_geo , ref id , ref access_hash , ref first_name , ref last_name , ref username , ref phone , ref photo , ref status , ref bot_info_version , ref restriction_reason , ref bot_inline_placeholder , ref lang_code } = self ; let mut _flags = 0i32 ; if self_ { _flags |= 1 << 10u32 ; } if contact { _flags |= 1 << 11u32 ; } if mutual_contact { _flags |= 1 << 12u32 ; } if deleted { _flags |= 1 << 13u32 ; } if bot { _flags |= 1 << 14u32 ; } if bot_chat_history { _flags |= 1 << 15u32 ; } if bot_nochats { _flags |= 1 << 16u32 ; } if verified { _flags |= 1 << 17u32 ; } if restricted { _flags |= 1 << 18u32 ; } if min { _flags |= 1 << 20u32 ; } if bot_inline_geo { _flags |= 1 << 21u32 ; } if access_hash . is_some ( ) { _flags |= 1 << 0u32 ; } if first_name . is_some ( ) { _flags |= 1 << 1u32 ; } if last_name . is_some ( ) { _flags |= 1 << 2u32 ; } if username . is_some ( ) { _flags |= 1 << 3u32 ; } if phone . is_some ( ) { _flags |= 1 << 4u32 ; } if photo . is_some ( ) { _flags |= 1 << 5u32 ; } if status . is_some ( ) { _flags |= 1 << 6u32 ; } if bot_info_version . is_some ( ) { _flags |= 1 << 14u32 ; } if restriction_reason . is_some ( ) { _flags |= 1 << 18u32 ; } if bot_inline_placeholder . is_some ( ) { _flags |= 1 << 19u32 ; } if lang_code . is_some ( ) { _flags |= 1 << 22u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: int > ( id ) ? ; if let & Some ( ref inner ) = access_hash { _ser . write_bare :: < :: mtproto :: long > ( inner ) ? ; } if let & Some ( ref inner ) = first_name { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = last_name { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = username { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = phone { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = photo { _ser . write_boxed :: < :: mtproto :: UserProfilePhoto > ( inner ) ? ; } if let & Some ( ref inner ) = status { _ser . write_boxed :: < :: mtproto :: UserStatus > ( inner ) ? ; } if let & Some ( ref inner ) = bot_info_version { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } if let & Some ( ref inner ) = restriction_reason { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = bot_inline_placeholder { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = lang_code { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for User { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( User { self_ : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 10u32 ) != 0 } , contact : _flags & ( 1 << 11u32 ) != 0 , mutual_contact : _flags & ( 1 << 12u32 ) != 0 , deleted : _flags & ( 1 << 13u32 ) != 0 , bot : _flags & ( 1 << 14u32 ) != 0 , bot_chat_history : _flags & ( 1 << 15u32 ) != 0 , bot_nochats : _flags & ( 1 << 16u32 ) != 0 , verified : _flags & ( 1 << 17u32 ) != 0 , restricted : _flags & ( 1 << 18u32 ) != 0 , min : _flags & ( 1 << 20u32 ) != 0 , bot_inline_geo : _flags & ( 1 << 21u32 ) != 0 , id : _de . read_bare :: < :: mtproto :: int > ( ) ? , access_hash : if _flags & ( 1 << 0u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: long > ( ) ? ) } else { None } , first_name : if _flags & ( 1 << 1u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , last_name : if _flags & ( 1 << 2u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , username : if _flags & ( 1 << 3u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , phone : if _flags & ( 1 << 4u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , photo : if _flags & ( 1 << 5u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: UserProfilePhoto > ( ) ? ) } else { None } , status : if _flags & ( 1 << 6u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: UserStatus > ( ) ? ) } else { None } , bot_info_version : if _flags & ( 1 << 14u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , restriction_reason : if _flags & ( 1 << 18u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , bot_inline_placeholder : if _flags & ( 1 << 19u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , lang_code : if _flags & ( 1 << 22u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for User { type Boxed = :: mtproto :: User ; fn into_boxed ( self ) -> :: mtproto :: User { :: mtproto :: User :: User ( self ) } } } pub mod user_full { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `userFull`\n\n```text\nuserFull#f220f3f flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true user:User about:flags.1?string link:contacts.Link profile_photo:flags.2?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo common_chats_count:int = UserFull;\n```\n" ] pub struct UserFull { pub blocked : bool , pub phone_calls_available : bool , pub phone_calls_private : bool , pub user : :: mtproto :: User , pub about : Option < :: mtproto :: string > , pub link : :: mtproto :: contacts :: Link , pub profile_photo : Option < :: mtproto :: Photo > , pub notify_settings : :: mtproto :: PeerNotifySettings , pub bot_info : Option < :: mtproto :: BotInfo > , pub common_chats_count : :: mtproto :: int , } impl :: BareSerialize for UserFull { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & UserFull { blocked , phone_calls_available , phone_calls_private , ref user , ref about , ref link , ref profile_photo , ref notify_settings , ref bot_info , ref common_chats_count } = self ; let mut _flags = 0i32 ; if blocked { _flags |= 1 << 0u32 ; } if phone_calls_available { _flags |= 1 << 4u32 ; } if phone_calls_private { _flags |= 1 << 5u32 ; } if about . is_some ( ) { _flags |= 1 << 1u32 ; } if profile_photo . is_some ( ) { _flags |= 1 << 2u32 ; } if bot_info . is_some ( ) { _flags |= 1 << 3u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_boxed :: < :: mtproto :: User > ( user ) ? ; if let & Some ( ref inner ) = about { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } _ser . write_boxed :: < :: mtproto :: contacts :: Link > ( link ) ? ; if let & Some ( ref inner ) = profile_photo { _ser . write_boxed :: < :: mtproto :: Photo > ( inner ) ? ; } _ser . write_boxed :: < :: mtproto :: PeerNotifySettings > ( notify_settings ) ? ; if let & Some ( ref inner ) = bot_info { _ser . write_boxed :: < :: mtproto :: BotInfo > ( inner ) ? ; } _ser . write_bare :: < :: mtproto :: int > ( common_chats_count ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for UserFull { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( UserFull { blocked : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _flags & ( 1 << 0u32 ) != 0 } , phone_calls_available : _flags & ( 1 << 4u32 ) != 0 , phone_calls_private : _flags & ( 1 << 5u32 ) != 0 , user : _de . read_boxed :: < :: mtproto :: User > ( ) ? , about : if _flags & ( 1 << 1u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , link : _de . read_boxed :: < :: mtproto :: contacts :: Link > ( ) ? , profile_photo : if _flags & ( 1 << 2u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: Photo > ( ) ? ) } else { None } , notify_settings : _de . read_boxed :: < :: mtproto :: PeerNotifySettings > ( ) ? , bot_info : if _flags & ( 1 << 3u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: BotInfo > ( ) ? ) } else { None } , common_chats_count : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for UserFull { type Boxed = :: mtproto :: UserFull ; fn into_boxed ( self ) -> :: mtproto :: UserFull { :: mtproto :: UserFull :: UserFull ( self ) } } } pub mod user_profile_photo { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `userProfilePhoto`\n\n```text\nuserProfilePhoto#d559d8c8 photo_id:long photo_small:FileLocation photo_big:FileLocation = UserProfilePhoto;\n```\n" ] pub struct UserProfilePhoto { pub photo_id : :: mtproto :: long , pub photo_small : :: mtproto :: FileLocation , pub photo_big : :: mtproto :: FileLocation , } impl :: BareSerialize for UserProfilePhoto { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & UserProfilePhoto { ref photo_id , ref photo_small , ref photo_big } = self ; _ser . write_bare :: < :: mtproto :: long > ( photo_id ) ? ; _ser . write_boxed :: < :: mtproto :: FileLocation > ( photo_small ) ? ; _ser . write_boxed :: < :: mtproto :: FileLocation > ( photo_big ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for UserProfilePhoto { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( UserProfilePhoto { photo_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , photo_small : _de . read_boxed :: < :: mtproto :: FileLocation > ( ) ? , photo_big : _de . read_boxed :: < :: mtproto :: FileLocation > ( ) ? , } ) } } impl :: IntoBoxed for UserProfilePhoto { type Boxed = :: mtproto :: UserProfilePhoto ; fn into_boxed ( self ) -> :: mtproto :: UserProfilePhoto { :: mtproto :: UserProfilePhoto :: UserProfilePhoto ( self ) } } } pub mod user_status { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `userStatusOffline`\n\n```text\nuserStatusOffline#8c703f was_online:int = UserStatus;\n```\n" ] pub struct Offline { pub was_online : :: mtproto :: int , } impl :: BareSerialize for Offline { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Offline { ref was_online } = self ; _ser . write_bare :: < :: mtproto :: int > ( was_online ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Offline { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Offline { was_online : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for Offline { type Boxed = :: mtproto :: UserStatus ; fn into_boxed ( self ) -> :: mtproto :: UserStatus { :: mtproto :: UserStatus :: Offline ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `userStatusOnline`\n\n```text\nuserStatusOnline#edb93949 expires:int = UserStatus;\n```\n" ] pub struct Online { pub expires : :: mtproto :: int , } impl :: BareSerialize for Online { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Online { ref expires } = self ; _ser . write_bare :: < :: mtproto :: int > ( expires ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Online { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Online { expires : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for Online { type Boxed = :: mtproto :: UserStatus ; fn into_boxed ( self ) -> :: mtproto :: UserStatus { :: mtproto :: UserStatus :: Online ( self ) } } } pub mod wall_paper { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `wallPaperSolid`\n\n```text\nwallPaperSolid#63117f24 id:int title:string bg_color:int color:int = WallPaper;\n```\n" ] pub struct Solid { pub id : :: mtproto :: int , pub title : :: mtproto :: string , pub bg_color : :: mtproto :: int , pub color : :: mtproto :: int , } impl :: BareSerialize for Solid { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Solid { ref id , ref title , ref bg_color , ref color } = self ; _ser . write_bare :: < :: mtproto :: int > ( id ) ? ; _ser . write_bare :: < :: mtproto :: string > ( title ) ? ; _ser . write_bare :: < :: mtproto :: int > ( bg_color ) ? ; _ser . write_bare :: < :: mtproto :: int > ( color ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Solid { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Solid { id : _de . read_bare :: < :: mtproto :: int > ( ) ? , title : _de . read_bare :: < :: mtproto :: string > ( ) ? , bg_color : _de . read_bare :: < :: mtproto :: int > ( ) ? , color : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for Solid { type Boxed = :: mtproto :: WallPaper ; fn into_boxed ( self ) -> :: mtproto :: WallPaper { :: mtproto :: WallPaper :: Solid ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `wallPaper`\n\n```text\nwallPaper#ccb03657 id:int title:string sizes:Vector<PhotoSize> color:int = WallPaper;\n```\n" ] pub struct WallPaper { pub id : :: mtproto :: int , pub title : :: mtproto :: string , pub sizes : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PhotoSize > , pub color : :: mtproto :: int , } impl :: BareSerialize for WallPaper { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & WallPaper { ref id , ref title , ref sizes , ref color } = self ; _ser . write_bare :: < :: mtproto :: int > ( id ) ? ; _ser . write_bare :: < :: mtproto :: string > ( title ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PhotoSize > > ( sizes ) ? ; _ser . write_bare :: < :: mtproto :: int > ( color ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for WallPaper { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( WallPaper { id : _de . read_bare :: < :: mtproto :: int > ( ) ? , title : _de . read_bare :: < :: mtproto :: string > ( ) ? , sizes : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PhotoSize > > ( ) ? , color : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for WallPaper { type Boxed = :: mtproto :: WallPaper ; fn into_boxed ( self ) -> :: mtproto :: WallPaper { :: mtproto :: WallPaper :: WallPaper ( self ) } } } pub mod web_document { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `webDocument`\n\n```text\nwebDocument#c61acbd8 url:string access_hash:long size:int mime_type:string attributes:Vector<DocumentAttribute> dc_id:int = WebDocument;\n```\n" ] pub struct WebDocument { pub url : :: mtproto :: string , pub access_hash : :: mtproto :: long , pub size : :: mtproto :: int , pub mime_type : :: mtproto :: string , pub attributes : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: DocumentAttribute > , pub dc_id : :: mtproto :: int , } impl :: BareSerialize for WebDocument { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & WebDocument { ref url , ref access_hash , ref size , ref mime_type , ref attributes , ref dc_id } = self ; _ser . write_bare :: < :: mtproto :: string > ( url ) ? ; _ser . write_bare :: < :: mtproto :: long > ( access_hash ) ? ; _ser . write_bare :: < :: mtproto :: int > ( size ) ? ; _ser . write_bare :: < :: mtproto :: string > ( mime_type ) ? ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: DocumentAttribute > > ( attributes ) ? ; _ser . write_bare :: < :: mtproto :: int > ( dc_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for WebDocument { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( WebDocument { url : _de . read_bare :: < :: mtproto :: string > ( ) ? , access_hash : _de . read_bare :: < :: mtproto :: long > ( ) ? , size : _de . read_bare :: < :: mtproto :: int > ( ) ? , mime_type : _de . read_bare :: < :: mtproto :: string > ( ) ? , attributes : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: DocumentAttribute > > ( ) ? , dc_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for WebDocument { type Boxed = :: mtproto :: WebDocument ; fn into_boxed ( self ) -> :: mtproto :: WebDocument { :: mtproto :: WebDocument :: WebDocument ( self ) } } } pub mod web_page { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `webPageEmpty`\n\n```text\nwebPageEmpty#eb1477e8 id:long = WebPage;\n```\n" ] pub struct Empty { pub id : :: mtproto :: long , } impl :: BareSerialize for Empty { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Empty { ref id } = self ; _ser . write_bare :: < :: mtproto :: long > ( id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Empty { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Empty { id : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for Empty { type Boxed = :: mtproto :: WebPage ; fn into_boxed ( self ) -> :: mtproto :: WebPage { :: mtproto :: WebPage :: Empty ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `webPagePending`\n\n```text\nwebPagePending#c586da1c id:long date:int = WebPage;\n```\n" ] pub struct Pending { pub id : :: mtproto :: long , pub date : :: mtproto :: int , } impl :: BareSerialize for Pending { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & Pending { ref id , ref date } = self ; _ser . write_bare :: < :: mtproto :: long > ( id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for Pending { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( Pending { id : _de . read_bare :: < :: mtproto :: long > ( ) ? , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for Pending { type Boxed = :: mtproto :: WebPage ; fn into_boxed ( self ) -> :: mtproto :: WebPage { :: mtproto :: WebPage :: Pending ( self ) } } # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `webPage`\n\n```text\nwebPage#5f07b4bc flags:# id:long url:string display_url:string hash:int type:flags.0?string site_name:flags.1?string title:flags.2?string description:flags.3?string photo:flags.4?Photo embed_url:flags.5?string embed_type:flags.5?string embed_width:flags.6?int embed_height:flags.6?int duration:flags.7?int author:flags.8?string document:flags.9?Document cached_page:flags.10?Page = WebPage;\n```\n" ] pub struct WebPage { pub id : :: mtproto :: long , pub url : :: mtproto :: string , pub display_url : :: mtproto :: string , pub hash : :: mtproto :: int , pub type_ : Option < :: mtproto :: string > , pub site_name : Option < :: mtproto :: string > , pub title : Option < :: mtproto :: string > , pub description : Option < :: mtproto :: string > , pub photo : Option < :: mtproto :: Photo > , pub embed_url : Option < :: mtproto :: string > , pub embed_type : Option < :: mtproto :: string > , pub embed_width : Option < :: mtproto :: int > , pub embed_height : Option < :: mtproto :: int > , pub duration : Option < :: mtproto :: int > , pub author : Option < :: mtproto :: string > , pub document : Option < :: mtproto :: Document > , pub cached_page : Option < :: mtproto :: Page > , } impl :: BareSerialize for WebPage { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & WebPage { ref id , ref url , ref display_url , ref hash , ref type_ , ref site_name , ref title , ref description , ref photo , ref embed_url , ref embed_type , ref embed_width , ref embed_height , ref duration , ref author , ref document , ref cached_page } = self ; let mut _flags = 0i32 ; if type_ . is_some ( ) { _flags |= 1 << 0u32 ; } if site_name . is_some ( ) { _flags |= 1 << 1u32 ; } if title . is_some ( ) { _flags |= 1 << 2u32 ; } if description . is_some ( ) { _flags |= 1 << 3u32 ; } if photo . is_some ( ) { _flags |= 1 << 4u32 ; } if embed_url . is_some ( ) { _flags |= 1 << 5u32 ; } if embed_type . is_some ( ) { _flags |= 1 << 5u32 ; } if embed_width . is_some ( ) { _flags |= 1 << 6u32 ; } if embed_height . is_some ( ) { _flags |= 1 << 6u32 ; } if duration . is_some ( ) { _flags |= 1 << 7u32 ; } if author . is_some ( ) { _flags |= 1 << 8u32 ; } if document . is_some ( ) { _flags |= 1 << 9u32 ; } if cached_page . is_some ( ) { _flags |= 1 << 10u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & _flags ) ? ; _ser . write_bare :: < :: mtproto :: long > ( id ) ? ; _ser . write_bare :: < :: mtproto :: string > ( url ) ? ; _ser . write_bare :: < :: mtproto :: string > ( display_url ) ? ; _ser . write_bare :: < :: mtproto :: int > ( hash ) ? ; if let & Some ( ref inner ) = type_ { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = site_name { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = title { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = description { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = photo { _ser . write_boxed :: < :: mtproto :: Photo > ( inner ) ? ; } if let & Some ( ref inner ) = embed_url { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = embed_type { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = embed_width { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } if let & Some ( ref inner ) = embed_height { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } if let & Some ( ref inner ) = duration { _ser . write_bare :: < :: mtproto :: int > ( inner ) ? ; } if let & Some ( ref inner ) = author { _ser . write_bare :: < :: mtproto :: string > ( inner ) ? ; } if let & Some ( ref inner ) = document { _ser . write_boxed :: < :: mtproto :: Document > ( inner ) ? ; } if let & Some ( ref inner ) = cached_page { _ser . write_boxed :: < :: mtproto :: Page > ( inner ) ? ; } Ok ( ( ) ) } } impl :: BareDeserialize for WebPage { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let _flags : i32 ; Ok ( WebPage { id : { _flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; _de . read_bare :: < :: mtproto :: long > ( ) ? } , url : _de . read_bare :: < :: mtproto :: string > ( ) ? , display_url : _de . read_bare :: < :: mtproto :: string > ( ) ? , hash : _de . read_bare :: < :: mtproto :: int > ( ) ? , type_ : if _flags & ( 1 << 0u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , site_name : if _flags & ( 1 << 1u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , title : if _flags & ( 1 << 2u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , description : if _flags & ( 1 << 3u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , photo : if _flags & ( 1 << 4u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: Photo > ( ) ? ) } else { None } , embed_url : if _flags & ( 1 << 5u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , embed_type : if _flags & ( 1 << 5u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , embed_width : if _flags & ( 1 << 6u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , embed_height : if _flags & ( 1 << 6u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , duration : if _flags & ( 1 << 7u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: int > ( ) ? ) } else { None } , author : if _flags & ( 1 << 8u32 ) != 0 { Some ( _de . read_bare :: < :: mtproto :: string > ( ) ? ) } else { None } , document : if _flags & ( 1 << 9u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: Document > ( ) ? ) } else { None } , cached_page : if _flags & ( 1 << 10u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: Page > ( ) ? ) } else { None } , } ) } } impl :: IntoBoxed for WebPage { type Boxed = :: mtproto :: WebPage ; fn into_boxed ( self ) -> :: mtproto :: WebPage { :: mtproto :: WebPage :: WebPage ( self ) } } } pub mod wire { pub mod inbound_encrypted { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `wire.inbound_encrypted`\n\n```text\nwire.inbound_encrypted salt:long session_id:long message_id:long seq_no:int payload_len:int = wire.InboundEncrypted;\n```\n" ] pub struct InboundEncrypted { pub salt : :: mtproto :: long , pub session_id : :: mtproto :: long , pub message_id : :: mtproto :: long , pub seq_no : :: mtproto :: int , pub payload_len : :: mtproto :: int , } impl :: BareSerialize for InboundEncrypted { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & InboundEncrypted { ref salt , ref session_id , ref message_id , ref seq_no , ref payload_len } = self ; _ser . write_bare :: < :: mtproto :: long > ( salt ) ? ; _ser . write_bare :: < :: mtproto :: long > ( session_id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( message_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( seq_no ) ? ; _ser . write_bare :: < :: mtproto :: int > ( payload_len ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for InboundEncrypted { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( InboundEncrypted { salt : _de . read_bare :: < :: mtproto :: long > ( ) ? , session_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , message_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , seq_no : _de . read_bare :: < :: mtproto :: int > ( ) ? , payload_len : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } } pub mod inbound_raw { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `wire.inbound_raw`\n\n```text\nwire.inbound_raw auth_key_id:long message_id:long payload_len:int = wire.InboundRaw;\n```\n" ] pub struct InboundRaw { pub auth_key_id : :: mtproto :: long , pub message_id : :: mtproto :: long , pub payload_len : :: mtproto :: int , } impl :: BareSerialize for InboundRaw { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & InboundRaw { ref auth_key_id , ref message_id , ref payload_len } = self ; _ser . write_bare :: < :: mtproto :: long > ( auth_key_id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( message_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( payload_len ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for InboundRaw { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( InboundRaw { auth_key_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , message_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , payload_len : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } } pub mod outbound_encrypted { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `wire.outbound_encrypted`\n\n```text\nwire.outbound_encrypted salt:long session_id:long message_id:long seq_no:int payload:lengthPrefixedTypedObject = wire.OutboundEncrypted;\n```\n" ] pub struct OutboundEncrypted { pub salt : :: mtproto :: long , pub session_id : :: mtproto :: long , pub message_id : :: mtproto :: long , pub seq_no : :: mtproto :: int , pub payload : :: mtproto :: lengthPrefixedTypedObject , } impl :: BareSerialize for OutboundEncrypted { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & OutboundEncrypted { ref salt , ref session_id , ref message_id , ref seq_no , ref payload } = self ; _ser . write_bare :: < :: mtproto :: long > ( salt ) ? ; _ser . write_bare :: < :: mtproto :: long > ( session_id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( message_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( seq_no ) ? ; _ser . write_bare :: < :: mtproto :: lengthPrefixedTypedObject > ( payload ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for OutboundEncrypted { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( OutboundEncrypted { salt : _de . read_bare :: < :: mtproto :: long > ( ) ? , session_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , message_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , seq_no : _de . read_bare :: < :: mtproto :: int > ( ) ? , payload : _de . read_bare :: < :: mtproto :: lengthPrefixedTypedObject > ( ) ? , } ) } } } pub mod outbound_raw { # [ derive ( Debug , Clone , Serialize ) ] # [ doc = "TL-derived from `wire.outbound_raw`\n\n```text\nwire.outbound_raw auth_key_id:long message_id:long payload:lengthPrefixedTypedObject = wire.OutboundRaw;\n```\n" ] pub struct OutboundRaw { pub auth_key_id : :: mtproto :: long , pub message_id : :: mtproto :: long , pub payload : :: mtproto :: lengthPrefixedTypedObject , } impl :: BareSerialize for OutboundRaw { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & OutboundRaw { ref auth_key_id , ref message_id , ref payload } = self ; _ser . write_bare :: < :: mtproto :: long > ( auth_key_id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( message_id ) ? ; _ser . write_bare :: < :: mtproto :: lengthPrefixedTypedObject > ( payload ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for OutboundRaw { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( OutboundRaw { auth_key_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , message_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , payload : _de . read_bare :: < :: mtproto :: lengthPrefixedTypedObject > ( ) ? , } ) } } } } lazy_static ! { pub static ref DYNAMIC_DESERIALIZERS : :: std :: collections :: BTreeMap < :: ConstructorNumber , :: DynamicDeserializer > = { let mut ret = :: std :: collections :: BTreeMap :: new ( ) ; ret . insert ( :: ConstructorNumber ( 0xb8d0afdf ) , < :: mtproto :: AccountDaysTTL as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x7bf2e6f6 ) , < :: mtproto :: Authorization as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xa7eff811 ) , < :: mtproto :: BadMsgNotification as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xedab447b ) , < :: mtproto :: BadMsgNotification as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xbc799737 ) , < :: mtproto :: Bool as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x997275b5 ) , < :: mtproto :: Bool as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xc27ac8c7 ) , < :: mtproto :: BotCommand as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x98e81d3a ) , < :: mtproto :: BotInfo as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x0a74b15b ) , < :: mtproto :: BotInlineMessage as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x8c7f65e2 ) , < :: mtproto :: BotInlineMessage as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xb722de65 ) , < :: mtproto :: BotInlineMessage as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x4366232e ) , < :: mtproto :: BotInlineMessage as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x35edb4d4 ) , < :: mtproto :: BotInlineMessage as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x9bebaeb9 ) , < :: mtproto :: BotInlineResult as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x17db940b ) , < :: mtproto :: BotInlineResult as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x5725e40a ) , < :: mtproto :: CdnConfig as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x77eec38f ) , < :: mtproto :: CdnFileHash as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xc982eaba ) , < :: mtproto :: CdnPublicKey as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x3b5a3e40 ) , < :: mtproto :: ChannelAdminLogEvent as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xe6dfb825 ) , < :: mtproto :: ChannelAdminLogEventAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x55188a2e ) , < :: mtproto :: ChannelAdminLogEventAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x6a4afc38 ) , < :: mtproto :: ChannelAdminLogEventAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xb82f55c3 ) , < :: mtproto :: ChannelAdminLogEventAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x1b7907ae ) , < :: mtproto :: ChannelAdminLogEventAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x26ae0971 ) , < :: mtproto :: ChannelAdminLogEventAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xe9e82c18 ) , < :: mtproto :: ChannelAdminLogEventAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x709b2405 ) , < :: mtproto :: ChannelAdminLogEventAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x42e047bb ) , < :: mtproto :: ChannelAdminLogEventAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x183040d3 ) , < :: mtproto :: ChannelAdminLogEventAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xf89777f2 ) , < :: mtproto :: ChannelAdminLogEventAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xe31c34d8 ) , < :: mtproto :: ChannelAdminLogEventAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xe6d83d7e ) , < :: mtproto :: ChannelAdminLogEventAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xd5676710 ) , < :: mtproto :: ChannelAdminLogEventAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xb1c3caa7 ) , < :: mtproto :: ChannelAdminLogEventAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x5f5c95f1 ) , < :: mtproto :: ChannelAdminLogEventAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xea107ae4 ) , < :: mtproto :: ChannelAdminLogEventsFilter as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x5d7ceba5 ) , < :: mtproto :: ChannelAdminRights as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x58cf4249 ) , < :: mtproto :: ChannelBannedRights as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x94d42ee7 ) , < :: mtproto :: ChannelMessagesFilter as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xcd77d957 ) , < :: mtproto :: ChannelMessagesFilter as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x15ebac1d ) , < :: mtproto :: ChannelParticipant as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xa3289a6d ) , < :: mtproto :: ChannelParticipant as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xe3e2e1f9 ) , < :: mtproto :: ChannelParticipant as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xa82fa898 ) , < :: mtproto :: ChannelParticipant as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x222c1886 ) , < :: mtproto :: ChannelParticipant as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xde3f3c79 ) , < :: mtproto :: ChannelParticipantsFilter as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xb4608969 ) , < :: mtproto :: ChannelParticipantsFilter as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xa3b54985 ) , < :: mtproto :: ChannelParticipantsFilter as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xb0d1865b ) , < :: mtproto :: ChannelParticipantsFilter as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x1427a5e1 ) , < :: mtproto :: ChannelParticipantsFilter as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x0656ac4b ) , < :: mtproto :: ChannelParticipantsFilter as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x9ba2d800 ) , < :: mtproto :: Chat as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xd91cdd54 ) , < :: mtproto :: Chat as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x07328bdb ) , < :: mtproto :: Chat as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x450b7115 ) , < :: mtproto :: Chat as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x289da732 ) , < :: mtproto :: Chat as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x2e02a614 ) , < :: mtproto :: ChatFull as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x76af5481 ) , < :: mtproto :: ChatFull as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x5a686d7c ) , < :: mtproto :: ChatInvite as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xdb74f558 ) , < :: mtproto :: ChatInvite as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xc8d7493e ) , < :: mtproto :: ChatParticipant as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xda13538a ) , < :: mtproto :: ChatParticipant as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xe2d6e436 ) , < :: mtproto :: ChatParticipant as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xfc900c2b ) , < :: mtproto :: ChatParticipants as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x3f460fed ) , < :: mtproto :: ChatParticipants as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x37c1011c ) , < :: mtproto :: ChatPhoto as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x6153276a ) , < :: mtproto :: ChatPhoto as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x6643b654 ) , < :: mtproto :: ClientDHInnerData as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x9c840964 ) , < :: mtproto :: Config as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xf911c994 ) , < :: mtproto :: Contact as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x561bc879 ) , < :: mtproto :: ContactBlocked as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x5f4f9247 ) , < :: mtproto :: ContactLink as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xfeedd3ad ) , < :: mtproto :: ContactLink as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x268f3f59 ) , < :: mtproto :: ContactLink as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xd502c2d0 ) , < :: mtproto :: ContactLink as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xd3680c61 ) , < :: mtproto :: ContactStatus as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x7d748d04 ) , < :: mtproto :: DataJSON as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x05d8c6cc ) , < :: mtproto :: DcOption as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xf660e1d4 ) , < :: mtproto :: DestroyAuthKeyRes as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x0a9f2259 ) , < :: mtproto :: DestroyAuthKeyRes as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xea109b13 ) , < :: mtproto :: DestroyAuthKeyRes as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xe22045fc ) , < :: mtproto :: DestroySessionRes as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x62d350c9 ) , < :: mtproto :: DestroySessionRes as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xe4def5db ) , < :: mtproto :: Dialog as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xae636f24 ) , < :: mtproto :: DisabledFeature as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x36f8c871 ) , < :: mtproto :: Document as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x87232bc7 ) , < :: mtproto :: Document as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x6c37c15c ) , < :: mtproto :: DocumentAttribute as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x11b58939 ) , < :: mtproto :: DocumentAttribute as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x6319d612 ) , < :: mtproto :: DocumentAttribute as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x0ef02ce6 ) , < :: mtproto :: DocumentAttribute as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x9852f9c6 ) , < :: mtproto :: DocumentAttribute as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x15590068 ) , < :: mtproto :: DocumentAttribute as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x9801d2f7 ) , < :: mtproto :: DocumentAttribute as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xba4baec5 ) , < :: mtproto :: DraftMessage as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xfd8e711f ) , < :: mtproto :: DraftMessage as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xab7ec0a0 ) , < :: mtproto :: EncryptedChat as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x3bf703dc ) , < :: mtproto :: EncryptedChat as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xc878527e ) , < :: mtproto :: EncryptedChat as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xfa56ce36 ) , < :: mtproto :: EncryptedChat as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x13d6dd27 ) , < :: mtproto :: EncryptedChat as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xc21f497e ) , < :: mtproto :: EncryptedFile as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x4a70994c ) , < :: mtproto :: EncryptedFile as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xed18c118 ) , < :: mtproto :: EncryptedMessage as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x23734b06 ) , < :: mtproto :: EncryptedMessage as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xc4b9f9bb ) , < :: mtproto :: Error as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x69df3769 ) , < :: mtproto :: ExportedChatInvite as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xfc2e05bc ) , < :: mtproto :: ExportedChatInvite as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x1f486803 ) , < :: mtproto :: ExportedMessageLink as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x7c596b46 ) , < :: mtproto :: FileLocation as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x53d69076 ) , < :: mtproto :: FileLocation as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x162ecc1f ) , < :: mtproto :: FoundGif as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x9c750409 ) , < :: mtproto :: FoundGif as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x0949d9dc ) , < :: mtproto :: FutureSalt as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xae500895 ) , < :: mtproto :: FutureSalts as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xbdf9653b ) , < :: mtproto :: Game as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x1117dd5f ) , < :: mtproto :: GeoPoint as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x2049d70c ) , < :: mtproto :: GeoPoint as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x58fffcd0 ) , < :: mtproto :: HighScore as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x9299359f ) , < :: mtproto :: HttpWait as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xd0028438 ) , < :: mtproto :: ImportedContact as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x3c20629f ) , < :: mtproto :: InlineBotSwitchPM as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x770656a8 ) , < :: mtproto :: InputAppEvent as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x292fed13 ) , < :: mtproto :: InputBotInlineMessage as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x3dcd7a87 ) , < :: mtproto :: InputBotInlineMessage as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xc1b15d65 ) , < :: mtproto :: InputBotInlineMessage as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xaaafadc8 ) , < :: mtproto :: InputBotInlineMessage as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x2daf01a7 ) , < :: mtproto :: InputBotInlineMessage as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x4b425864 ) , < :: mtproto :: InputBotInlineMessage as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x890c3d89 ) , < :: mtproto :: InputBotInlineMessageID as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x2cbbe15a ) , < :: mtproto :: InputBotInlineResult as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xa8d864a7 ) , < :: mtproto :: InputBotInlineResult as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xfff8fdc4 ) , < :: mtproto :: InputBotInlineResult as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x4fa417f2 ) , < :: mtproto :: InputBotInlineResult as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xee8c1e86 ) , < :: mtproto :: InputChannel as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xafeb712e ) , < :: mtproto :: InputChannel as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x1ca48f57 ) , < :: mtproto :: InputChatPhoto as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x927c55b4 ) , < :: mtproto :: InputChatPhoto as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x8953ad37 ) , < :: mtproto :: InputChatPhoto as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xf392b7f4 ) , < :: mtproto :: InputContact as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x72f0eaae ) , < :: mtproto :: InputDocument as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x18798952 ) , < :: mtproto :: InputDocument as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xf141b5e1 ) , < :: mtproto :: InputEncryptedChat as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x1837c364 ) , < :: mtproto :: InputEncryptedFile as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x64bd0306 ) , < :: mtproto :: InputEncryptedFile as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x5a17b5e5 ) , < :: mtproto :: InputEncryptedFile as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x2dc173c8 ) , < :: mtproto :: InputEncryptedFile as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xf52ff27f ) , < :: mtproto :: InputFile as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xfa4f0bb5 ) , < :: mtproto :: InputFile as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x14637196 ) , < :: mtproto :: InputFileLocation as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xf5235d55 ) , < :: mtproto :: InputFileLocation as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x430f0724 ) , < :: mtproto :: InputFileLocation as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x032c3e77 ) , < :: mtproto :: InputGame as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xc331e80a ) , < :: mtproto :: InputGame as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xe4c123d6 ) , < :: mtproto :: InputGeoPoint as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xf3b7acc9 ) , < :: mtproto :: InputGeoPoint as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x9664f57f ) , < :: mtproto :: InputMedia as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x2f37e231 ) , < :: mtproto :: InputMedia as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x81fa373a ) , < :: mtproto :: InputMedia as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xf9c44144 ) , < :: mtproto :: InputMedia as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xa6e45987 ) , < :: mtproto :: InputMedia as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xe39621fd ) , < :: mtproto :: InputMedia as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x5acb668e ) , < :: mtproto :: InputMedia as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xc13d1c11 ) , < :: mtproto :: InputMedia as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x4843b0fd ) , < :: mtproto :: InputMedia as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x0922aec1 ) , < :: mtproto :: InputMedia as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xb6f74335 ) , < :: mtproto :: InputMedia as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xd33f43f3 ) , < :: mtproto :: InputMedia as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xf4e096c3 ) , < :: mtproto :: InputMedia as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x7b1a118f ) , < :: mtproto :: InputMedia as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xb8bc5b0c ) , < :: mtproto :: InputNotifyPeer as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x193b4417 ) , < :: mtproto :: InputNotifyPeer as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x4a95e84e ) , < :: mtproto :: InputNotifyPeer as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xa429b886 ) , < :: mtproto :: InputNotifyPeer as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xc10eb2cf ) , < :: mtproto :: InputPaymentCredentials as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x3417d728 ) , < :: mtproto :: InputPaymentCredentials as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x0aa1c39f ) , < :: mtproto :: InputPaymentCredentials as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x795667a6 ) , < :: mtproto :: InputPaymentCredentials as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x7f3b18ea ) , < :: mtproto :: InputPeer as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x7da07ec9 ) , < :: mtproto :: InputPeer as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x179be863 ) , < :: mtproto :: InputPeer as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x7b8e7de6 ) , < :: mtproto :: InputPeer as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x20adaef8 ) , < :: mtproto :: InputPeer as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xf03064d8 ) , < :: mtproto :: InputPeerNotifyEvents as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xe86a2c74 ) , < :: mtproto :: InputPeerNotifyEvents as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x38935eb2 ) , < :: mtproto :: InputPeerNotifySettings as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x1e36fded ) , < :: mtproto :: InputPhoneCall as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x1cd7bf0d ) , < :: mtproto :: InputPhoto as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xfb95c6c4 ) , < :: mtproto :: InputPhoto as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x4f96cb18 ) , < :: mtproto :: InputPrivacyKey as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xbdfb0426 ) , < :: mtproto :: InputPrivacyKey as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xfabadc5f ) , < :: mtproto :: InputPrivacyKey as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x0d09e07b ) , < :: mtproto :: InputPrivacyRule as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x184b35ce ) , < :: mtproto :: InputPrivacyRule as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x131cc67f ) , < :: mtproto :: InputPrivacyRule as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x0ba52007 ) , < :: mtproto :: InputPrivacyRule as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xd66b66c9 ) , < :: mtproto :: InputPrivacyRule as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x90110467 ) , < :: mtproto :: InputPrivacyRule as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x5eaa7809 ) , < :: mtproto :: InputSingleMedia as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xffb62b95 ) , < :: mtproto :: InputStickerSet as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x9de7a269 ) , < :: mtproto :: InputStickerSet as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x861cc8a0 ) , < :: mtproto :: InputStickerSet as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xffa0a496 ) , < :: mtproto :: InputStickerSetItem as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x4a992157 ) , < :: mtproto :: InputStickeredMedia as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x0438865b ) , < :: mtproto :: InputStickeredMedia as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xb98886cf ) , < :: mtproto :: InputUser as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xf7c1b13f ) , < :: mtproto :: InputUser as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xd8292816 ) , < :: mtproto :: InputUser as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x9bed434d ) , < :: mtproto :: InputWebDocument as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xc239d686 ) , < :: mtproto :: InputWebFileLocation as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xc30aa358 ) , < :: mtproto :: Invoice as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xa2fa4880 ) , < :: mtproto :: KeyboardButton as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x258aff05 ) , < :: mtproto :: KeyboardButton as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x683a5e46 ) , < :: mtproto :: KeyboardButton as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xb16a6c29 ) , < :: mtproto :: KeyboardButton as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xfc796b3f ) , < :: mtproto :: KeyboardButton as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x0568a748 ) , < :: mtproto :: KeyboardButton as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x50f41ccf ) , < :: mtproto :: KeyboardButton as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xafd93fbb ) , < :: mtproto :: KeyboardButton as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x77608b83 ) , < :: mtproto :: KeyboardButtonRow as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xcb296bf8 ) , < :: mtproto :: LabeledPrice as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xf385c1f6 ) , < :: mtproto :: LangPackDifference as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x117698f1 ) , < :: mtproto :: LangPackLanguage as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xcad181f6 ) , < :: mtproto :: LangPackString as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x6c47ac9f ) , < :: mtproto :: LangPackString as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x2979eeb2 ) , < :: mtproto :: LangPackString as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xaed6dbb2 ) , < :: mtproto :: MaskCoords as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x83e5de54 ) , < :: mtproto :: Message as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x44f9b43d ) , < :: mtproto :: Message as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x9e19a1f6 ) , < :: mtproto :: Message as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xb6aef7b0 ) , < :: mtproto :: MessageAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xa6638b9a ) , < :: mtproto :: MessageAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xb5a1ce5a ) , < :: mtproto :: MessageAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x7fcb13a8 ) , < :: mtproto :: MessageAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x95e3fbef ) , < :: mtproto :: MessageAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x488a7337 ) , < :: mtproto :: MessageAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xb2ae9b0c ) , < :: mtproto :: MessageAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xf89cf5e8 ) , < :: mtproto :: MessageAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x95d2ac92 ) , < :: mtproto :: MessageAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x51bdb021 ) , < :: mtproto :: MessageAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xb055eaee ) , < :: mtproto :: MessageAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x94bd38ed ) , < :: mtproto :: MessageAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x9fbab604 ) , < :: mtproto :: MessageAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x92a72876 ) , < :: mtproto :: MessageAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x8f31b327 ) , < :: mtproto :: MessageAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x40699cd0 ) , < :: mtproto :: MessageAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x80e11a7f ) , < :: mtproto :: MessageAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x4792929b ) , < :: mtproto :: MessageAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xfae69f56 ) , < :: mtproto :: MessageAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xbb92ba95 ) , < :: mtproto :: MessageEntity as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xfa04579d ) , < :: mtproto :: MessageEntity as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x6f635b0d ) , < :: mtproto :: MessageEntity as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x6cef8ac7 ) , < :: mtproto :: MessageEntity as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x6ed02538 ) , < :: mtproto :: MessageEntity as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x64e475c2 ) , < :: mtproto :: MessageEntity as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xbd610bc9 ) , < :: mtproto :: MessageEntity as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x826f8b60 ) , < :: mtproto :: MessageEntity as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x28a20571 ) , < :: mtproto :: MessageEntity as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x73924be0 ) , < :: mtproto :: MessageEntity as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x76a6d327 ) , < :: mtproto :: MessageEntity as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x352dca58 ) , < :: mtproto :: MessageEntity as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x208e68c9 ) , < :: mtproto :: MessageEntity as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x559ebe6d ) , < :: mtproto :: MessageFwdHeader as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x3ded6320 ) , < :: mtproto :: MessageMedia as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xb5223b0f ) , < :: mtproto :: MessageMedia as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x56e0d474 ) , < :: mtproto :: MessageMedia as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x5e7d2f39 ) , < :: mtproto :: MessageMedia as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x9f84f49e ) , < :: mtproto :: MessageMedia as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x7c4414d3 ) , < :: mtproto :: MessageMedia as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xa32dd600 ) , < :: mtproto :: MessageMedia as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x2ec0533f ) , < :: mtproto :: MessageMedia as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xfdb19008 ) , < :: mtproto :: MessageMedia as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x84551347 ) , < :: mtproto :: MessageMedia as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x7c3c2609 ) , < :: mtproto :: MessageMedia as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x0ae30253 ) , < :: mtproto :: MessageRange as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x57e2f66c ) , < :: mtproto :: MessagesFilter as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x9609a51c ) , < :: mtproto :: MessagesFilter as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x9fc00e65 ) , < :: mtproto :: MessagesFilter as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x56e9f0e4 ) , < :: mtproto :: MessagesFilter as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x9eddf188 ) , < :: mtproto :: MessagesFilter as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x7ef0dd87 ) , < :: mtproto :: MessagesFilter as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xffc86587 ) , < :: mtproto :: MessagesFilter as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x50f5c392 ) , < :: mtproto :: MessagesFilter as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x3751b49e ) , < :: mtproto :: MessagesFilter as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x3a20ecb8 ) , < :: mtproto :: MessagesFilter as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x80c99768 ) , < :: mtproto :: MessagesFilter as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x7a7c17a4 ) , < :: mtproto :: MessagesFilter as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xb549da53 ) , < :: mtproto :: MessagesFilter as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xc1f8e69a ) , < :: mtproto :: MessagesFilter as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xe7026d0d ) , < :: mtproto :: MessagesFilter as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xe062db83 ) , < :: mtproto :: MessagesFilter as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x276d3ec6 ) , < :: mtproto :: MsgDetailedInfo as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x809db6df ) , < :: mtproto :: MsgDetailedInfo as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x7d861a08 ) , < :: mtproto :: MsgResendReq as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x62d6b459 ) , < :: mtproto :: MsgsAck as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x8cc0d131 ) , < :: mtproto :: MsgsAllInfo as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x04deb57d ) , < :: mtproto :: MsgsStateInfo as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xda69fb52 ) , < :: mtproto :: MsgsStateReq as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x8e1a1775 ) , < :: mtproto :: NearestDc as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x9ec20908 ) , < :: mtproto :: NewSession as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x9fd40bd8 ) , < :: mtproto :: NotifyPeer as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xb4c83b4c ) , < :: mtproto :: NotifyPeer as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xc007cec3 ) , < :: mtproto :: NotifyPeer as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x74d07c60 ) , < :: mtproto :: NotifyPeer as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x56730bcc ) , < :: mtproto :: Null as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x83c95aec ) , < :: mtproto :: PQInnerData as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x3c6a84d4 ) , < :: mtproto :: PQInnerData as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x8e3f9ebe ) , < :: mtproto :: Page as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x556ec7aa ) , < :: mtproto :: Page as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x13567e8a ) , < :: mtproto :: PageBlock as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x70abc3fd ) , < :: mtproto :: PageBlock as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x8ffa9a1f ) , < :: mtproto :: PageBlock as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xbaafe5e0 ) , < :: mtproto :: PageBlock as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xbfd064ec ) , < :: mtproto :: PageBlock as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xf12bb6e1 ) , < :: mtproto :: PageBlock as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x467a0766 ) , < :: mtproto :: PageBlock as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xc070d93e ) , < :: mtproto :: PageBlock as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x48870999 ) , < :: mtproto :: PageBlock as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xdb20b188 ) , < :: mtproto :: PageBlock as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xce0d37b0 ) , < :: mtproto :: PageBlock as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x3a58c7f4 ) , < :: mtproto :: PageBlock as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x263d7c26 ) , < :: mtproto :: PageBlock as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x4f4456d3 ) , < :: mtproto :: PageBlock as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xe9c69982 ) , < :: mtproto :: PageBlock as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xd9d71866 ) , < :: mtproto :: PageBlock as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x39f23300 ) , < :: mtproto :: PageBlock as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xcde200d1 ) , < :: mtproto :: PageBlock as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x292c7be9 ) , < :: mtproto :: PageBlock as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x08b31c4f ) , < :: mtproto :: PageBlock as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x130c8963 ) , < :: mtproto :: PageBlock as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xef1751b5 ) , < :: mtproto :: PageBlock as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x31b81a7f ) , < :: mtproto :: PageBlock as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xea02c27e ) , < :: mtproto :: PaymentCharge as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x909c3f94 ) , < :: mtproto :: PaymentRequestedInfo as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xcdc27a1f ) , < :: mtproto :: PaymentSavedCredentials as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x9db1bc6d ) , < :: mtproto :: Peer as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xbad0e5bb ) , < :: mtproto :: Peer as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xbddde532 ) , < :: mtproto :: Peer as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xadd53cb3 ) , < :: mtproto :: PeerNotifyEvents as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x6d1ded88 ) , < :: mtproto :: PeerNotifyEvents as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x70a68512 ) , < :: mtproto :: PeerNotifySettings as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x9acda4c0 ) , < :: mtproto :: PeerNotifySettings as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x818426cd ) , < :: mtproto :: PeerSettings as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x5366c915 ) , < :: mtproto :: PhoneCall as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x1b8f4ad1 ) , < :: mtproto :: PhoneCall as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x83761ce4 ) , < :: mtproto :: PhoneCall as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x6d003d3f ) , < :: mtproto :: PhoneCall as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xffe6ab67 ) , < :: mtproto :: PhoneCall as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x50ca4de1 ) , < :: mtproto :: PhoneCall as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x85e42301 ) , < :: mtproto :: PhoneCallDiscardReason as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xe095c1a0 ) , < :: mtproto :: PhoneCallDiscardReason as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x57adc690 ) , < :: mtproto :: PhoneCallDiscardReason as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xfaf7e8c9 ) , < :: mtproto :: PhoneCallDiscardReason as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xa2bb35cb ) , < :: mtproto :: PhoneCallProtocol as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x9d4c17c0 ) , < :: mtproto :: PhoneConnection as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x2331b22d ) , < :: mtproto :: Photo as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x9288dd29 ) , < :: mtproto :: Photo as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x0e17e23c ) , < :: mtproto :: PhotoSize as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x77bfb61b ) , < :: mtproto :: PhotoSize as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xe9a734fa ) , < :: mtproto :: PhotoSize as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x347773c5 ) , < :: mtproto :: Pong as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x5ce14175 ) , < :: mtproto :: PopularContact as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x1e8caaeb ) , < :: mtproto :: PostAddress as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xbc2eab30 ) , < :: mtproto :: PrivacyKey as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x500e6dfa ) , < :: mtproto :: PrivacyKey as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x3d662b7b ) , < :: mtproto :: PrivacyKey as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xfffe1bac ) , < :: mtproto :: PrivacyRule as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x65427b82 ) , < :: mtproto :: PrivacyRule as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x4d5bbe0c ) , < :: mtproto :: PrivacyRule as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xf888fa1a ) , < :: mtproto :: PrivacyRule as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x8b73e763 ) , < :: mtproto :: PrivacyRule as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x0c7f49b7 ) , < :: mtproto :: PrivacyRule as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xa384b779 ) , < :: mtproto :: ReceivedNotifyMessage as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x46e1d13d ) , < :: mtproto :: RecentMeUrl as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x8dbc3336 ) , < :: mtproto :: RecentMeUrl as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xa01b22f9 ) , < :: mtproto :: RecentMeUrl as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xeb49081d ) , < :: mtproto :: RecentMeUrl as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xbc0a57dc ) , < :: mtproto :: RecentMeUrl as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xa03e5b85 ) , < :: mtproto :: ReplyMarkup as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xf4108aa0 ) , < :: mtproto :: ReplyMarkup as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x3502758c ) , < :: mtproto :: ReplyMarkup as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x48a30254 ) , < :: mtproto :: ReplyMarkup as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x58dbcab8 ) , < :: mtproto :: ReportReason as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x1e22c78d ) , < :: mtproto :: ReportReason as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x2e59d922 ) , < :: mtproto :: ReportReason as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xe1746d0a ) , < :: mtproto :: ReportReason as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x05162463 ) , < :: mtproto :: ResPQ as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xdc3d824f ) , < :: mtproto :: RichText as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x744694e0 ) , < :: mtproto :: RichText as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x6724abc4 ) , < :: mtproto :: RichText as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xd912a59c ) , < :: mtproto :: RichText as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xc12622c4 ) , < :: mtproto :: RichText as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x9bf8bb95 ) , < :: mtproto :: RichText as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x6c3f19b9 ) , < :: mtproto :: RichText as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x3c2884c1 ) , < :: mtproto :: RichText as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xde5a0dd6 ) , < :: mtproto :: RichText as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x7e6260d7 ) , < :: mtproto :: RichText as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x5e2ad36e ) , < :: mtproto :: RpcDropAnswer as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xcd78e586 ) , < :: mtproto :: RpcDropAnswer as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xa43ad8b7 ) , < :: mtproto :: RpcDropAnswer as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x2144ca19 ) , < :: mtproto :: RpcError as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x16bf744e ) , < :: mtproto :: SendMessageAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xfd5ec8f5 ) , < :: mtproto :: SendMessageAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xa187d66f ) , < :: mtproto :: SendMessageAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xe9763aec ) , < :: mtproto :: SendMessageAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xd52f73f7 ) , < :: mtproto :: SendMessageAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xf351d7ab ) , < :: mtproto :: SendMessageAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xd1d34a26 ) , < :: mtproto :: SendMessageAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xaa0cd9e4 ) , < :: mtproto :: SendMessageAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x176f8ba1 ) , < :: mtproto :: SendMessageAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x628cbc6f ) , < :: mtproto :: SendMessageAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xdd6a8f48 ) , < :: mtproto :: SendMessageAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x88f27fbc ) , < :: mtproto :: SendMessageAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x243e1c66 ) , < :: mtproto :: SendMessageAction as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xb5890dba ) , < :: mtproto :: ServerDHInnerData as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x79cb045d ) , < :: mtproto :: ServerDHParams as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xd0e8075c ) , < :: mtproto :: ServerDHParams as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x3bcbf734 ) , < :: mtproto :: SetClientDHParamsAnswer as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x46dc1fb9 ) , < :: mtproto :: SetClientDHParamsAnswer as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xa69dae02 ) , < :: mtproto :: SetClientDHParamsAnswer as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xb6213cdf ) , < :: mtproto :: ShippingOption as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x12b299d4 ) , < :: mtproto :: StickerPack as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xcd303b41 ) , < :: mtproto :: StickerSet as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x6410a5d2 ) , < :: mtproto :: StickerSetCovered as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x3407e51b ) , < :: mtproto :: StickerSetCovered as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xedcdc05b ) , < :: mtproto :: TopPeer as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xab661b5b ) , < :: mtproto :: TopPeerCategory as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x148677e2 ) , < :: mtproto :: TopPeerCategory as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x0637b7ed ) , < :: mtproto :: TopPeerCategory as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xbd17a14a ) , < :: mtproto :: TopPeerCategory as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x161d9628 ) , < :: mtproto :: TopPeerCategory as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x1e76a78c ) , < :: mtproto :: TopPeerCategory as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xfb834291 ) , < :: mtproto :: TopPeerCategoryPeers as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x1f2b0afd ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x4e90bfd6 ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xa20db0e5 ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x5c486927 ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x9a65ea1f ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x07761198 ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x1bfbd823 ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xa7332b73 ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x95313b0c ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x2575bbb9 ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x9d2e67c5 ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x12bcbd9a ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x1710f156 ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xb4a2e88d ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x38fe25b7 ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xea4b0e5c ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x6e5f8c22 ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x8e5e9873 ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x80ece81a ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xbec268ef ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xebe46819 ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xee3b272a ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x12b9417b ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x9961fd5c ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x2f2f21bf ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x7f891213 ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x68c13933 ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xeb0467fb ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xb6d45656 ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x62ba04d9 ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x4214f37f ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xc37521c9 ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x98a12b4b ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x6e947941 ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xb6901959 ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x688a30aa ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x0bb2d201 ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x43ae3dec ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x9375341e ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x54826690 ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x0e48f964 ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x1b3f4df7 ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x98592475 ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xe73547e1 ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xe40370a3 ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xf9d27a5a ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x25d6c9c7 ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xee2bb969 ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x571d2742 ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x9a422c20 ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xa229dd06 ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x3354678f ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x40771900 ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xd711a2cc ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xd8caf68d ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x8317c0c3 ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x9b9240a6 ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xe0cdc940 ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x5d2f3aa9 ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xab0f6b1e ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x10c2404b ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x56022f4d ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xe511996d ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x89893b45 ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x7084a7be ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x70db6837 ) , < :: mtproto :: Update as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xe317af7e ) , < :: mtproto :: Updates as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x914fbf11 ) , < :: mtproto :: Updates as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x16812688 ) , < :: mtproto :: Updates as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x78d4dec1 ) , < :: mtproto :: Updates as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x725b04c3 ) , < :: mtproto :: Updates as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x74ae4240 ) , < :: mtproto :: Updates as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x11f1331c ) , < :: mtproto :: Updates as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x200250ba ) , < :: mtproto :: User as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x2e13f4c3 ) , < :: mtproto :: User as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x0f220f3f ) , < :: mtproto :: UserFull as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x4f11bae1 ) , < :: mtproto :: UserProfilePhoto as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xd559d8c8 ) , < :: mtproto :: UserProfilePhoto as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x09d05049 ) , < :: mtproto :: UserStatus as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xedb93949 ) , < :: mtproto :: UserStatus as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x008c703f ) , < :: mtproto :: UserStatus as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xe26f42f1 ) , < :: mtproto :: UserStatus as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x07bf09fc ) , < :: mtproto :: UserStatus as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x77ebc742 ) , < :: mtproto :: UserStatus as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xccb03657 ) , < :: mtproto :: WallPaper as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x63117f24 ) , < :: mtproto :: WallPaper as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xc61acbd8 ) , < :: mtproto :: WebDocument as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xeb1477e8 ) , < :: mtproto :: WebPage as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xc586da1c ) , < :: mtproto :: WebPage as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x5f07b4bc ) , < :: mtproto :: WebPage as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x85849473 ) , < :: mtproto :: WebPage as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x1250abde ) , < :: mtproto :: account :: Authorizations as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x96dabc18 ) , < :: mtproto :: account :: Password as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x7c18141c ) , < :: mtproto :: account :: Password as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x86916deb ) , < :: mtproto :: account :: PasswordInputSettings as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xb7b72ab3 ) , < :: mtproto :: account :: PasswordSettings as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x554abb6f ) , < :: mtproto :: account :: PrivacyRules as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xdb64fd34 ) , < :: mtproto :: account :: TmpPassword as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xcd050916 ) , < :: mtproto :: auth :: Authorization as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x811ea28e ) , < :: mtproto :: auth :: CheckedPhone as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x72a3158c ) , < :: mtproto :: auth :: CodeType as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x741cd3e3 ) , < :: mtproto :: auth :: CodeType as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x226ccefb ) , < :: mtproto :: auth :: CodeType as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xdf969c2d ) , < :: mtproto :: auth :: ExportedAuthorization as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x137948a5 ) , < :: mtproto :: auth :: PasswordRecovery as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x5e002502 ) , < :: mtproto :: auth :: SentCode as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x3dbb5986 ) , < :: mtproto :: auth :: SentCodeType as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xc000bba2 ) , < :: mtproto :: auth :: SentCodeType as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x5353e5a7 ) , < :: mtproto :: auth :: SentCodeType as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xab03c6d9 ) , < :: mtproto :: auth :: SentCodeType as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xed8af74d ) , < :: mtproto :: channels :: AdminLogResults as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xd0d9b163 ) , < :: mtproto :: channels :: ChannelParticipant as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xf56ee2a8 ) , < :: mtproto :: channels :: ChannelParticipants as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xf0173fe9 ) , < :: mtproto :: channels :: ChannelParticipants as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x1c138d15 ) , < :: mtproto :: contacts :: Blocked as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x900802a1 ) , < :: mtproto :: contacts :: Blocked as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xb74ba9d2 ) , < :: mtproto :: contacts :: Contacts as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xeae87e42 ) , < :: mtproto :: contacts :: Contacts as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x1aa1f784 ) , < :: mtproto :: contacts :: Found as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x77d01c3b ) , < :: mtproto :: contacts :: ImportedContacts as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x3ace484c ) , < :: mtproto :: contacts :: Link as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x7f077ad9 ) , < :: mtproto :: contacts :: ResolvedPeer as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xde266ef5 ) , < :: mtproto :: contacts :: TopPeers as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x70b772a8 ) , < :: mtproto :: contacts :: TopPeers as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x8987f311 ) , < :: mtproto :: help :: AppUpdate as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xc45a6536 ) , < :: mtproto :: help :: AppUpdate as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xd997c3c5 ) , < :: mtproto :: help :: ConfigSimple as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x18cb9f78 ) , < :: mtproto :: help :: InviteText as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x0e0310d7 ) , < :: mtproto :: help :: RecentMeUrls as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x17c6b5f6 ) , < :: mtproto :: help :: Support as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xf1ee3e90 ) , < :: mtproto :: help :: TermsOfService as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x75a3f765 ) , < :: mtproto :: manual :: BindAuthKeyInner as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x3072cfa1 ) , < :: mtproto :: manual :: GzipPacked as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x73f1f8dc ) , < :: mtproto :: manual :: MessageContainer as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xf35c6d01 ) , < :: mtproto :: manual :: RpcResult as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xb45c69d1 ) , < :: mtproto :: messages :: AffectedHistory as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x84d19185 ) , < :: mtproto :: messages :: AffectedMessages as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xe86602c3 ) , < :: mtproto :: messages :: AllStickers as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xedfd405f ) , < :: mtproto :: messages :: AllStickers as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x4fcba9c8 ) , < :: mtproto :: messages :: ArchivedStickers as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x36585ea4 ) , < :: mtproto :: messages :: BotCallbackAnswer as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x947ca848 ) , < :: mtproto :: messages :: BotResults as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xe5d7d19c ) , < :: mtproto :: messages :: ChatFull as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x64ff9fd5 ) , < :: mtproto :: messages :: Chats as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x9cd81144 ) , < :: mtproto :: messages :: Chats as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xc0e24635 ) , < :: mtproto :: messages :: DhConfig as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x2c221edd ) , < :: mtproto :: messages :: DhConfig as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x15ba6c40 ) , < :: mtproto :: messages :: Dialogs as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x71e094f3 ) , < :: mtproto :: messages :: Dialogs as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x9e8fa6d3 ) , < :: mtproto :: messages :: FavedStickers as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xf37f2f16 ) , < :: mtproto :: messages :: FavedStickers as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x04ede3cf ) , < :: mtproto :: messages :: FeaturedStickers as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xf89d88e5 ) , < :: mtproto :: messages :: FeaturedStickers as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x450a1c0a ) , < :: mtproto :: messages :: FoundGifs as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x9a3bfd99 ) , < :: mtproto :: messages :: HighScores as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x26b5dde6 ) , < :: mtproto :: messages :: MessageEditData as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x8c718e87 ) , < :: mtproto :: messages :: Messages as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x0b446ae3 ) , < :: mtproto :: messages :: Messages as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x99262e37 ) , < :: mtproto :: messages :: Messages as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x74535f21 ) , < :: mtproto :: messages :: Messages as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x3371c354 ) , < :: mtproto :: messages :: PeerDialogs as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x0b17f890 ) , < :: mtproto :: messages :: RecentStickers as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x5ce20970 ) , < :: mtproto :: messages :: RecentStickers as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xe8025ca2 ) , < :: mtproto :: messages :: SavedGifs as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x2e0709a5 ) , < :: mtproto :: messages :: SavedGifs as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x560f8935 ) , < :: mtproto :: messages :: SentEncryptedMessage as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x9493ff32 ) , < :: mtproto :: messages :: SentEncryptedMessage as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xb60a24a6 ) , < :: mtproto :: messages :: StickerSet as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x38641628 ) , < :: mtproto :: messages :: StickerSetInstallResult as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x35e410a8 ) , < :: mtproto :: messages :: StickerSetInstallResult as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xf1749a22 ) , < :: mtproto :: messages :: Stickers as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x8a8ecd32 ) , < :: mtproto :: messages :: Stickers as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x3f56aea3 ) , < :: mtproto :: payments :: PaymentForm as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x500911e1 ) , < :: mtproto :: payments :: PaymentReceipt as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x4e5f810d ) , < :: mtproto :: payments :: PaymentResult as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x6b56b921 ) , < :: mtproto :: payments :: PaymentResult as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xfb8fe43c ) , < :: mtproto :: payments :: SavedInfo as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xd1451883 ) , < :: mtproto :: payments :: ValidatedRequestedInfo as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xec82e140 ) , < :: mtproto :: phone :: PhoneCall as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x20212ca8 ) , < :: mtproto :: photos :: Photo as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x8dca6aa5 ) , < :: mtproto :: photos :: Photos as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x15051f54 ) , < :: mtproto :: photos :: Photos as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xaa963b05 ) , < :: mtproto :: storage :: FileType as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x40bc6f52 ) , < :: mtproto :: storage :: FileType as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x007efe0e ) , < :: mtproto :: storage :: FileType as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xcae1aadf ) , < :: mtproto :: storage :: FileType as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x0a4f63c0 ) , < :: mtproto :: storage :: FileType as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xae1e508d ) , < :: mtproto :: storage :: FileType as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x528a0677 ) , < :: mtproto :: storage :: FileType as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x4b09ebbc ) , < :: mtproto :: storage :: FileType as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xb3cea0e4 ) , < :: mtproto :: storage :: FileType as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x1081464c ) , < :: mtproto :: storage :: FileType as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x3e11affb ) , < :: mtproto :: updates :: ChannelDifference as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x6a9d7b35 ) , < :: mtproto :: updates :: ChannelDifference as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x2064674e ) , < :: mtproto :: updates :: ChannelDifference as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x5d75a138 ) , < :: mtproto :: updates :: Difference as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x00f49ca0 ) , < :: mtproto :: updates :: Difference as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xa8fb1981 ) , < :: mtproto :: updates :: Difference as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x4afe8f6d ) , < :: mtproto :: updates :: Difference as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xa56c2a3e ) , < :: mtproto :: updates :: State as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xeea8e46e ) , < :: mtproto :: upload :: CdnFile as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xa99fca4f ) , < :: mtproto :: upload :: CdnFile as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x096a18d5 ) , < :: mtproto :: upload :: File as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0xea52fe5a ) , < :: mtproto :: upload :: File as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret . insert ( :: ConstructorNumber ( 0x21e753bc ) , < :: mtproto :: upload :: WebFile as :: BoxedDeserializeDynamic > :: boxed_deserialize_to_box as :: DynamicDeserializer ) ; ret } ; }