1
# ! [ allow ( non_camel_case_types ) ] pub use mtproto_prelude :: * ; pub const LAYER : i32 = 73i32 ; # [ derive ( Debug , Clone ) ] pub enum AccountDaysTTL { accountDaysTTL ( accountDaysTTL ) , } 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 :: accountDaysTTL > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = AccountDaysTTL ; fn into_boxed ( self ) -> AccountDaysTTL { AccountDaysTTL :: accountDaysTTL ( self ) } } # [ derive ( Debug , Clone ) ] pub enum Authorization { authorization ( authorization ) , } 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 > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = Authorization ; fn into_boxed ( self ) -> Authorization { Authorization :: authorization ( self ) } } # [ derive ( Debug , Clone ) ] pub enum BadMsgNotification { bad_msg_notification ( bad_msg_notification ) , bad_server_salt ( bad_server_salt ) , } impl :: BoxedSerialize for BadMsgNotification { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & BadMsgNotification :: bad_msg_notification ( ref x ) => ( :: ConstructorNumber ( 0xa7eff811 ) , x ) , & BadMsgNotification :: bad_server_salt ( 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 :: bad_msg_notification ( _de . read_bare :: < :: mtproto :: bad_msg_notification > ( ) ? ) ) , :: ConstructorNumber ( 0xedab447b ) => Ok ( BadMsgNotification :: bad_server_salt ( _de . read_bare :: < :: mtproto :: bad_server_salt > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct bad_msg_notification { pub bad_msg_id : :: mtproto :: long , pub bad_msg_seqno : :: mtproto :: int , pub error_code : :: mtproto :: int , } impl :: BareSerialize for bad_msg_notification { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & bad_msg_notification { 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 bad_msg_notification { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( bad_msg_notification { 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 bad_msg_notification { type Boxed = BadMsgNotification ; fn into_boxed ( self ) -> BadMsgNotification { BadMsgNotification :: bad_msg_notification ( self ) } } # [ derive ( Debug , Clone ) ] pub struct bad_server_salt { 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 bad_server_salt { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & bad_server_salt { 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 bad_server_salt { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( bad_server_salt { 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 bad_server_salt { type Boxed = BadMsgNotification ; fn into_boxed ( self ) -> BadMsgNotification { BadMsgNotification :: bad_server_salt ( self ) } } # [ derive ( Debug , Clone ) ] pub enum Bool { boolFalse , boolTrue , } impl :: BoxedSerialize for Bool { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Bool :: boolFalse => ( :: ConstructorNumber ( 0xbc799737 ) , & ( ) ) , & Bool :: boolTrue => ( :: 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 :: boolFalse ) , :: ConstructorNumber ( 0x997275b5 ) => Ok ( Bool :: boolTrue ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub enum BotCommand { botCommand ( botCommand ) , } 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 :: botCommand > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = BotCommand ; fn into_boxed ( self ) -> BotCommand { BotCommand :: botCommand ( self ) } } # [ derive ( Debug , Clone ) ] pub enum BotInfo { botInfo ( botInfo ) , } 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 :: botInfo > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = BotInfo ; fn into_boxed ( self ) -> BotInfo { BotInfo :: botInfo ( self ) } } # [ derive ( Debug , Clone ) ] pub enum BotInlineMessage { botInlineMessageMediaAuto ( botInlineMessageMediaAuto ) , botInlineMessageText ( botInlineMessageText ) , botInlineMessageMediaGeo ( botInlineMessageMediaGeo ) , botInlineMessageMediaVenue ( botInlineMessageMediaVenue ) , botInlineMessageMediaContact ( botInlineMessageMediaContact ) , } impl :: BoxedSerialize for BotInlineMessage { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & BotInlineMessage :: botInlineMessageMediaAuto ( ref x ) => ( :: ConstructorNumber ( 0x0a74b15b ) , x ) , & BotInlineMessage :: botInlineMessageText ( ref x ) => ( :: ConstructorNumber ( 0x8c7f65e2 ) , x ) , & BotInlineMessage :: botInlineMessageMediaGeo ( ref x ) => ( :: ConstructorNumber ( 0xb722de65 ) , x ) , & BotInlineMessage :: botInlineMessageMediaVenue ( ref x ) => ( :: ConstructorNumber ( 0x4366232e ) , x ) , & BotInlineMessage :: botInlineMessageMediaContact ( 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 :: botInlineMessageMediaAuto ( _de . read_bare :: < :: mtproto :: botInlineMessageMediaAuto > ( ) ? ) ) , :: ConstructorNumber ( 0x8c7f65e2 ) => Ok ( BotInlineMessage :: botInlineMessageText ( _de . read_bare :: < :: mtproto :: botInlineMessageText > ( ) ? ) ) , :: ConstructorNumber ( 0xb722de65 ) => Ok ( BotInlineMessage :: botInlineMessageMediaGeo ( _de . read_bare :: < :: mtproto :: botInlineMessageMediaGeo > ( ) ? ) ) , :: ConstructorNumber ( 0x4366232e ) => Ok ( BotInlineMessage :: botInlineMessageMediaVenue ( _de . read_bare :: < :: mtproto :: botInlineMessageMediaVenue > ( ) ? ) ) , :: ConstructorNumber ( 0x35edb4d4 ) => Ok ( BotInlineMessage :: botInlineMessageMediaContact ( _de . read_bare :: < :: mtproto :: botInlineMessageMediaContact > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct botInlineMessageMediaAuto { pub caption : :: mtproto :: string , pub reply_markup : Option < :: mtproto :: ReplyMarkup > , } impl :: BareSerialize for botInlineMessageMediaAuto { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & botInlineMessageMediaAuto { 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 botInlineMessageMediaAuto { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( botInlineMessageMediaAuto { 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 botInlineMessageMediaAuto { type Boxed = BotInlineMessage ; fn into_boxed ( self ) -> BotInlineMessage { BotInlineMessage :: botInlineMessageMediaAuto ( self ) } } # [ derive ( Debug , Clone ) ] pub struct botInlineMessageText { 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 botInlineMessageText { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & botInlineMessageText { 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 botInlineMessageText { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( botInlineMessageText { 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 botInlineMessageText { type Boxed = BotInlineMessage ; fn into_boxed ( self ) -> BotInlineMessage { BotInlineMessage :: botInlineMessageText ( self ) } } # [ derive ( Debug , Clone ) ] pub struct botInlineMessageMediaGeo { pub geo : :: mtproto :: GeoPoint , pub period : :: mtproto :: int , pub reply_markup : Option < :: mtproto :: ReplyMarkup > , } impl :: BareSerialize for botInlineMessageMediaGeo { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & botInlineMessageMediaGeo { 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 botInlineMessageMediaGeo { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( botInlineMessageMediaGeo { 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 botInlineMessageMediaGeo { type Boxed = BotInlineMessage ; fn into_boxed ( self ) -> BotInlineMessage { BotInlineMessage :: botInlineMessageMediaGeo ( self ) } } # [ derive ( Debug , Clone ) ] pub struct botInlineMessageMediaVenue { 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 botInlineMessageMediaVenue { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & botInlineMessageMediaVenue { 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 botInlineMessageMediaVenue { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( botInlineMessageMediaVenue { 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 botInlineMessageMediaVenue { type Boxed = BotInlineMessage ; fn into_boxed ( self ) -> BotInlineMessage { BotInlineMessage :: botInlineMessageMediaVenue ( self ) } } # [ derive ( Debug , Clone ) ] pub struct botInlineMessageMediaContact { pub phone_number : :: mtproto :: string , pub first_name : :: mtproto :: string , pub last_name : :: mtproto :: string , pub reply_markup : Option < :: mtproto :: ReplyMarkup > , } impl :: BareSerialize for botInlineMessageMediaContact { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & botInlineMessageMediaContact { 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 botInlineMessageMediaContact { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( botInlineMessageMediaContact { 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 botInlineMessageMediaContact { type Boxed = BotInlineMessage ; fn into_boxed ( self ) -> BotInlineMessage { BotInlineMessage :: botInlineMessageMediaContact ( self ) } } # [ derive ( Debug , Clone ) ] pub enum BotInlineResult { botInlineResult ( botInlineResult ) , botInlineMediaResult ( botInlineMediaResult ) , } impl :: BoxedSerialize for BotInlineResult { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & BotInlineResult :: botInlineResult ( ref x ) => ( :: ConstructorNumber ( 0x9bebaeb9 ) , x ) , & BotInlineResult :: botInlineMediaResult ( 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 :: botInlineResult ( _de . read_bare :: < :: mtproto :: botInlineResult > ( ) ? ) ) , :: ConstructorNumber ( 0x17db940b ) => Ok ( BotInlineResult :: botInlineMediaResult ( _de . read_bare :: < :: mtproto :: botInlineMediaResult > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct botInlineResult { 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 botInlineResult { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & botInlineResult { 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 botInlineResult { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( botInlineResult { 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 botInlineResult { type Boxed = BotInlineResult ; fn into_boxed ( self ) -> BotInlineResult { BotInlineResult :: botInlineResult ( self ) } } # [ derive ( Debug , Clone ) ] pub struct botInlineMediaResult { 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 botInlineMediaResult { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & botInlineMediaResult { 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 botInlineMediaResult { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( botInlineMediaResult { 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 botInlineMediaResult { type Boxed = BotInlineResult ; fn into_boxed ( self ) -> BotInlineResult { BotInlineResult :: botInlineMediaResult ( self ) } } # [ derive ( Debug , Clone ) ] pub enum CdnConfig { cdnConfig ( cdnConfig ) , } 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 :: cdnConfig > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = CdnConfig ; fn into_boxed ( self ) -> CdnConfig { CdnConfig :: cdnConfig ( self ) } } # [ derive ( Debug , Clone ) ] pub enum CdnFileHash { cdnFileHash ( cdnFileHash ) , } 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 :: cdnFileHash > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = CdnFileHash ; fn into_boxed ( self ) -> CdnFileHash { CdnFileHash :: cdnFileHash ( self ) } } # [ derive ( Debug , Clone ) ] pub enum CdnPublicKey { cdnPublicKey ( cdnPublicKey ) , } 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 :: cdnPublicKey > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = CdnPublicKey ; fn into_boxed ( self ) -> CdnPublicKey { CdnPublicKey :: cdnPublicKey ( self ) } } # [ derive ( Debug , Clone ) ] pub enum ChannelAdminLogEvent { channelAdminLogEvent ( channelAdminLogEvent ) , } 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 :: channelAdminLogEvent > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = ChannelAdminLogEvent ; fn into_boxed ( self ) -> ChannelAdminLogEvent { ChannelAdminLogEvent :: channelAdminLogEvent ( self ) } } # [ derive ( Debug , Clone ) ] pub enum ChannelAdminLogEventAction { channelAdminLogEventActionChangeTitle ( channelAdminLogEventActionChangeTitle ) , channelAdminLogEventActionChangeAbout ( channelAdminLogEventActionChangeAbout ) , channelAdminLogEventActionChangeUsername ( channelAdminLogEventActionChangeUsername ) , channelAdminLogEventActionChangePhoto ( channelAdminLogEventActionChangePhoto ) , channelAdminLogEventActionToggleInvites ( channelAdminLogEventActionToggleInvites ) , channelAdminLogEventActionToggleSignatures ( channelAdminLogEventActionToggleSignatures ) , channelAdminLogEventActionUpdatePinned ( channelAdminLogEventActionUpdatePinned ) , channelAdminLogEventActionEditMessage ( channelAdminLogEventActionEditMessage ) , channelAdminLogEventActionDeleteMessage ( channelAdminLogEventActionDeleteMessage ) , channelAdminLogEventActionParticipantJoin , channelAdminLogEventActionParticipantLeave , channelAdminLogEventActionParticipantInvite ( channelAdminLogEventActionParticipantInvite ) , channelAdminLogEventActionParticipantToggleBan ( channelAdminLogEventActionParticipantToggleBan ) , channelAdminLogEventActionParticipantToggleAdmin ( channelAdminLogEventActionParticipantToggleAdmin ) , channelAdminLogEventActionChangeStickerSet ( channelAdminLogEventActionChangeStickerSet ) , channelAdminLogEventActionTogglePreHistoryHidden ( channelAdminLogEventActionTogglePreHistoryHidden ) , } impl :: BoxedSerialize for ChannelAdminLogEventAction { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ChannelAdminLogEventAction :: channelAdminLogEventActionChangeTitle ( ref x ) => ( :: ConstructorNumber ( 0xe6dfb825 ) , x ) , & ChannelAdminLogEventAction :: channelAdminLogEventActionChangeAbout ( ref x ) => ( :: ConstructorNumber ( 0x55188a2e ) , x ) , & ChannelAdminLogEventAction :: channelAdminLogEventActionChangeUsername ( ref x ) => ( :: ConstructorNumber ( 0x6a4afc38 ) , x ) , & ChannelAdminLogEventAction :: channelAdminLogEventActionChangePhoto ( ref x ) => ( :: ConstructorNumber ( 0xb82f55c3 ) , x ) , & ChannelAdminLogEventAction :: channelAdminLogEventActionToggleInvites ( ref x ) => ( :: ConstructorNumber ( 0x1b7907ae ) , x ) , & ChannelAdminLogEventAction :: channelAdminLogEventActionToggleSignatures ( ref x ) => ( :: ConstructorNumber ( 0x26ae0971 ) , x ) , & ChannelAdminLogEventAction :: channelAdminLogEventActionUpdatePinned ( ref x ) => ( :: ConstructorNumber ( 0xe9e82c18 ) , x ) , & ChannelAdminLogEventAction :: channelAdminLogEventActionEditMessage ( ref x ) => ( :: ConstructorNumber ( 0x709b2405 ) , x ) , & ChannelAdminLogEventAction :: channelAdminLogEventActionDeleteMessage ( ref x ) => ( :: ConstructorNumber ( 0x42e047bb ) , x ) , & ChannelAdminLogEventAction :: channelAdminLogEventActionParticipantJoin => ( :: ConstructorNumber ( 0x183040d3 ) , & ( ) ) , & ChannelAdminLogEventAction :: channelAdminLogEventActionParticipantLeave => ( :: ConstructorNumber ( 0xf89777f2 ) , & ( ) ) , & ChannelAdminLogEventAction :: channelAdminLogEventActionParticipantInvite ( ref x ) => ( :: ConstructorNumber ( 0xe31c34d8 ) , x ) , & ChannelAdminLogEventAction :: channelAdminLogEventActionParticipantToggleBan ( ref x ) => ( :: ConstructorNumber ( 0xe6d83d7e ) , x ) , & ChannelAdminLogEventAction :: channelAdminLogEventActionParticipantToggleAdmin ( ref x ) => ( :: ConstructorNumber ( 0xd5676710 ) , x ) , & ChannelAdminLogEventAction :: channelAdminLogEventActionChangeStickerSet ( ref x ) => ( :: ConstructorNumber ( 0xb1c3caa7 ) , x ) , & ChannelAdminLogEventAction :: channelAdminLogEventActionTogglePreHistoryHidden ( 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 :: channelAdminLogEventActionChangeTitle ( _de . read_bare :: < :: mtproto :: channelAdminLogEventActionChangeTitle > ( ) ? ) ) , :: ConstructorNumber ( 0x55188a2e ) => Ok ( ChannelAdminLogEventAction :: channelAdminLogEventActionChangeAbout ( _de . read_bare :: < :: mtproto :: channelAdminLogEventActionChangeAbout > ( ) ? ) ) , :: ConstructorNumber ( 0x6a4afc38 ) => Ok ( ChannelAdminLogEventAction :: channelAdminLogEventActionChangeUsername ( _de . read_bare :: < :: mtproto :: channelAdminLogEventActionChangeUsername > ( ) ? ) ) , :: ConstructorNumber ( 0xb82f55c3 ) => Ok ( ChannelAdminLogEventAction :: channelAdminLogEventActionChangePhoto ( _de . read_bare :: < :: mtproto :: channelAdminLogEventActionChangePhoto > ( ) ? ) ) , :: ConstructorNumber ( 0x1b7907ae ) => Ok ( ChannelAdminLogEventAction :: channelAdminLogEventActionToggleInvites ( _de . read_bare :: < :: mtproto :: channelAdminLogEventActionToggleInvites > ( ) ? ) ) , :: ConstructorNumber ( 0x26ae0971 ) => Ok ( ChannelAdminLogEventAction :: channelAdminLogEventActionToggleSignatures ( _de . read_bare :: < :: mtproto :: channelAdminLogEventActionToggleSignatures > ( ) ? ) ) , :: ConstructorNumber ( 0xe9e82c18 ) => Ok ( ChannelAdminLogEventAction :: channelAdminLogEventActionUpdatePinned ( _de . read_bare :: < :: mtproto :: channelAdminLogEventActionUpdatePinned > ( ) ? ) ) , :: ConstructorNumber ( 0x709b2405 ) => Ok ( ChannelAdminLogEventAction :: channelAdminLogEventActionEditMessage ( _de . read_bare :: < :: mtproto :: channelAdminLogEventActionEditMessage > ( ) ? ) ) , :: ConstructorNumber ( 0x42e047bb ) => Ok ( ChannelAdminLogEventAction :: channelAdminLogEventActionDeleteMessage ( _de . read_bare :: < :: mtproto :: channelAdminLogEventActionDeleteMessage > ( ) ? ) ) , :: ConstructorNumber ( 0x183040d3 ) => Ok ( ChannelAdminLogEventAction :: channelAdminLogEventActionParticipantJoin ) , :: ConstructorNumber ( 0xf89777f2 ) => Ok ( ChannelAdminLogEventAction :: channelAdminLogEventActionParticipantLeave ) , :: ConstructorNumber ( 0xe31c34d8 ) => Ok ( ChannelAdminLogEventAction :: channelAdminLogEventActionParticipantInvite ( _de . read_bare :: < :: mtproto :: channelAdminLogEventActionParticipantInvite > ( ) ? ) ) , :: ConstructorNumber ( 0xe6d83d7e ) => Ok ( ChannelAdminLogEventAction :: channelAdminLogEventActionParticipantToggleBan ( _de . read_bare :: < :: mtproto :: channelAdminLogEventActionParticipantToggleBan > ( ) ? ) ) , :: ConstructorNumber ( 0xd5676710 ) => Ok ( ChannelAdminLogEventAction :: channelAdminLogEventActionParticipantToggleAdmin ( _de . read_bare :: < :: mtproto :: channelAdminLogEventActionParticipantToggleAdmin > ( ) ? ) ) , :: ConstructorNumber ( 0xb1c3caa7 ) => Ok ( ChannelAdminLogEventAction :: channelAdminLogEventActionChangeStickerSet ( _de . read_bare :: < :: mtproto :: channelAdminLogEventActionChangeStickerSet > ( ) ? ) ) , :: ConstructorNumber ( 0x5f5c95f1 ) => Ok ( ChannelAdminLogEventAction :: channelAdminLogEventActionTogglePreHistoryHidden ( _de . read_bare :: < :: mtproto :: channelAdminLogEventActionTogglePreHistoryHidden > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct channelAdminLogEventActionChangeTitle { pub prev_value : :: mtproto :: string , pub new_value : :: mtproto :: string , } impl :: BareSerialize for channelAdminLogEventActionChangeTitle { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & channelAdminLogEventActionChangeTitle { 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 channelAdminLogEventActionChangeTitle { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( channelAdminLogEventActionChangeTitle { prev_value : _de . read_bare :: < :: mtproto :: string > ( ) ? , new_value : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for channelAdminLogEventActionChangeTitle { type Boxed = ChannelAdminLogEventAction ; fn into_boxed ( self ) -> ChannelAdminLogEventAction { ChannelAdminLogEventAction :: channelAdminLogEventActionChangeTitle ( self ) } } # [ derive ( Debug , Clone ) ] pub struct channelAdminLogEventActionChangeAbout { pub prev_value : :: mtproto :: string , pub new_value : :: mtproto :: string , } impl :: BareSerialize for channelAdminLogEventActionChangeAbout { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & channelAdminLogEventActionChangeAbout { 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 channelAdminLogEventActionChangeAbout { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( channelAdminLogEventActionChangeAbout { prev_value : _de . read_bare :: < :: mtproto :: string > ( ) ? , new_value : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for channelAdminLogEventActionChangeAbout { type Boxed = ChannelAdminLogEventAction ; fn into_boxed ( self ) -> ChannelAdminLogEventAction { ChannelAdminLogEventAction :: channelAdminLogEventActionChangeAbout ( self ) } } # [ derive ( Debug , Clone ) ] pub struct channelAdminLogEventActionChangeUsername { pub prev_value : :: mtproto :: string , pub new_value : :: mtproto :: string , } impl :: BareSerialize for channelAdminLogEventActionChangeUsername { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & channelAdminLogEventActionChangeUsername { 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 channelAdminLogEventActionChangeUsername { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( channelAdminLogEventActionChangeUsername { prev_value : _de . read_bare :: < :: mtproto :: string > ( ) ? , new_value : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for channelAdminLogEventActionChangeUsername { type Boxed = ChannelAdminLogEventAction ; fn into_boxed ( self ) -> ChannelAdminLogEventAction { ChannelAdminLogEventAction :: channelAdminLogEventActionChangeUsername ( self ) } } # [ derive ( Debug , Clone ) ] pub struct channelAdminLogEventActionChangePhoto { pub prev_photo : :: mtproto :: ChatPhoto , pub new_photo : :: mtproto :: ChatPhoto , } impl :: BareSerialize for channelAdminLogEventActionChangePhoto { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & channelAdminLogEventActionChangePhoto { 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 channelAdminLogEventActionChangePhoto { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( channelAdminLogEventActionChangePhoto { prev_photo : _de . read_boxed :: < :: mtproto :: ChatPhoto > ( ) ? , new_photo : _de . read_boxed :: < :: mtproto :: ChatPhoto > ( ) ? , } ) } } impl :: IntoBoxed for channelAdminLogEventActionChangePhoto { type Boxed = ChannelAdminLogEventAction ; fn into_boxed ( self ) -> ChannelAdminLogEventAction { ChannelAdminLogEventAction :: channelAdminLogEventActionChangePhoto ( self ) } } # [ derive ( Debug , Clone ) ] pub struct channelAdminLogEventActionToggleInvites { pub new_value : :: mtproto :: Bool , } impl :: BareSerialize for channelAdminLogEventActionToggleInvites { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & channelAdminLogEventActionToggleInvites { ref new_value } = self ; _ser . write_boxed :: < :: mtproto :: Bool > ( new_value ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for channelAdminLogEventActionToggleInvites { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( channelAdminLogEventActionToggleInvites { new_value : _de . read_boxed :: < :: mtproto :: Bool > ( ) ? , } ) } } impl :: IntoBoxed for channelAdminLogEventActionToggleInvites { type Boxed = ChannelAdminLogEventAction ; fn into_boxed ( self ) -> ChannelAdminLogEventAction { ChannelAdminLogEventAction :: channelAdminLogEventActionToggleInvites ( self ) } } # [ derive ( Debug , Clone ) ] pub struct channelAdminLogEventActionToggleSignatures { pub new_value : :: mtproto :: Bool , } impl :: BareSerialize for channelAdminLogEventActionToggleSignatures { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & channelAdminLogEventActionToggleSignatures { ref new_value } = self ; _ser . write_boxed :: < :: mtproto :: Bool > ( new_value ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for channelAdminLogEventActionToggleSignatures { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( channelAdminLogEventActionToggleSignatures { new_value : _de . read_boxed :: < :: mtproto :: Bool > ( ) ? , } ) } } impl :: IntoBoxed for channelAdminLogEventActionToggleSignatures { type Boxed = ChannelAdminLogEventAction ; fn into_boxed ( self ) -> ChannelAdminLogEventAction { ChannelAdminLogEventAction :: channelAdminLogEventActionToggleSignatures ( self ) } } # [ derive ( Debug , Clone ) ] pub struct channelAdminLogEventActionUpdatePinned { pub message : :: mtproto :: Message , } impl :: BareSerialize for channelAdminLogEventActionUpdatePinned { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & channelAdminLogEventActionUpdatePinned { ref message } = self ; _ser . write_boxed :: < :: mtproto :: Message > ( message ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for channelAdminLogEventActionUpdatePinned { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( channelAdminLogEventActionUpdatePinned { message : _de . read_boxed :: < :: mtproto :: Message > ( ) ? , } ) } } impl :: IntoBoxed for channelAdminLogEventActionUpdatePinned { type Boxed = ChannelAdminLogEventAction ; fn into_boxed ( self ) -> ChannelAdminLogEventAction { ChannelAdminLogEventAction :: channelAdminLogEventActionUpdatePinned ( self ) } } # [ derive ( Debug , Clone ) ] pub struct channelAdminLogEventActionEditMessage { pub prev_message : :: mtproto :: Message , pub new_message : :: mtproto :: Message , } impl :: BareSerialize for channelAdminLogEventActionEditMessage { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & channelAdminLogEventActionEditMessage { 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 channelAdminLogEventActionEditMessage { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( channelAdminLogEventActionEditMessage { prev_message : _de . read_boxed :: < :: mtproto :: Message > ( ) ? , new_message : _de . read_boxed :: < :: mtproto :: Message > ( ) ? , } ) } } impl :: IntoBoxed for channelAdminLogEventActionEditMessage { type Boxed = ChannelAdminLogEventAction ; fn into_boxed ( self ) -> ChannelAdminLogEventAction { ChannelAdminLogEventAction :: channelAdminLogEventActionEditMessage ( self ) } } # [ derive ( Debug , Clone ) ] pub struct channelAdminLogEventActionDeleteMessage { pub message : :: mtproto :: Message , } impl :: BareSerialize for channelAdminLogEventActionDeleteMessage { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & channelAdminLogEventActionDeleteMessage { ref message } = self ; _ser . write_boxed :: < :: mtproto :: Message > ( message ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for channelAdminLogEventActionDeleteMessage { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( channelAdminLogEventActionDeleteMessage { message : _de . read_boxed :: < :: mtproto :: Message > ( ) ? , } ) } } impl :: IntoBoxed for channelAdminLogEventActionDeleteMessage { type Boxed = ChannelAdminLogEventAction ; fn into_boxed ( self ) -> ChannelAdminLogEventAction { ChannelAdminLogEventAction :: channelAdminLogEventActionDeleteMessage ( self ) } } # [ derive ( Debug , Clone ) ] pub struct channelAdminLogEventActionParticipantInvite { pub participant : :: mtproto :: ChannelParticipant , } impl :: BareSerialize for channelAdminLogEventActionParticipantInvite { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & channelAdminLogEventActionParticipantInvite { ref participant } = self ; _ser . write_boxed :: < :: mtproto :: ChannelParticipant > ( participant ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for channelAdminLogEventActionParticipantInvite { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( channelAdminLogEventActionParticipantInvite { participant : _de . read_boxed :: < :: mtproto :: ChannelParticipant > ( ) ? , } ) } } impl :: IntoBoxed for channelAdminLogEventActionParticipantInvite { type Boxed = ChannelAdminLogEventAction ; fn into_boxed ( self ) -> ChannelAdminLogEventAction { ChannelAdminLogEventAction :: channelAdminLogEventActionParticipantInvite ( self ) } } # [ derive ( Debug , Clone ) ] pub struct channelAdminLogEventActionParticipantToggleBan { pub prev_participant : :: mtproto :: ChannelParticipant , pub new_participant : :: mtproto :: ChannelParticipant , } impl :: BareSerialize for channelAdminLogEventActionParticipantToggleBan { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & channelAdminLogEventActionParticipantToggleBan { 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 channelAdminLogEventActionParticipantToggleBan { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( channelAdminLogEventActionParticipantToggleBan { prev_participant : _de . read_boxed :: < :: mtproto :: ChannelParticipant > ( ) ? , new_participant : _de . read_boxed :: < :: mtproto :: ChannelParticipant > ( ) ? , } ) } } impl :: IntoBoxed for channelAdminLogEventActionParticipantToggleBan { type Boxed = ChannelAdminLogEventAction ; fn into_boxed ( self ) -> ChannelAdminLogEventAction { ChannelAdminLogEventAction :: channelAdminLogEventActionParticipantToggleBan ( self ) } } # [ derive ( Debug , Clone ) ] pub struct channelAdminLogEventActionParticipantToggleAdmin { pub prev_participant : :: mtproto :: ChannelParticipant , pub new_participant : :: mtproto :: ChannelParticipant , } impl :: BareSerialize for channelAdminLogEventActionParticipantToggleAdmin { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & channelAdminLogEventActionParticipantToggleAdmin { 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 channelAdminLogEventActionParticipantToggleAdmin { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( channelAdminLogEventActionParticipantToggleAdmin { prev_participant : _de . read_boxed :: < :: mtproto :: ChannelParticipant > ( ) ? , new_participant : _de . read_boxed :: < :: mtproto :: ChannelParticipant > ( ) ? , } ) } } impl :: IntoBoxed for channelAdminLogEventActionParticipantToggleAdmin { type Boxed = ChannelAdminLogEventAction ; fn into_boxed ( self ) -> ChannelAdminLogEventAction { ChannelAdminLogEventAction :: channelAdminLogEventActionParticipantToggleAdmin ( self ) } } # [ derive ( Debug , Clone ) ] pub struct channelAdminLogEventActionChangeStickerSet { pub prev_stickerset : :: mtproto :: InputStickerSet , pub new_stickerset : :: mtproto :: InputStickerSet , } impl :: BareSerialize for channelAdminLogEventActionChangeStickerSet { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & channelAdminLogEventActionChangeStickerSet { 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 channelAdminLogEventActionChangeStickerSet { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( channelAdminLogEventActionChangeStickerSet { prev_stickerset : _de . read_boxed :: < :: mtproto :: InputStickerSet > ( ) ? , new_stickerset : _de . read_boxed :: < :: mtproto :: InputStickerSet > ( ) ? , } ) } } impl :: IntoBoxed for channelAdminLogEventActionChangeStickerSet { type Boxed = ChannelAdminLogEventAction ; fn into_boxed ( self ) -> ChannelAdminLogEventAction { ChannelAdminLogEventAction :: channelAdminLogEventActionChangeStickerSet ( self ) } } # [ derive ( Debug , Clone ) ] pub struct channelAdminLogEventActionTogglePreHistoryHidden { pub new_value : :: mtproto :: Bool , } impl :: BareSerialize for channelAdminLogEventActionTogglePreHistoryHidden { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & channelAdminLogEventActionTogglePreHistoryHidden { ref new_value } = self ; _ser . write_boxed :: < :: mtproto :: Bool > ( new_value ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for channelAdminLogEventActionTogglePreHistoryHidden { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( channelAdminLogEventActionTogglePreHistoryHidden { new_value : _de . read_boxed :: < :: mtproto :: Bool > ( ) ? , } ) } } impl :: IntoBoxed for channelAdminLogEventActionTogglePreHistoryHidden { type Boxed = ChannelAdminLogEventAction ; fn into_boxed ( self ) -> ChannelAdminLogEventAction { ChannelAdminLogEventAction :: channelAdminLogEventActionTogglePreHistoryHidden ( self ) } } # [ derive ( Debug , Clone ) ] pub enum ChannelAdminLogEventsFilter { channelAdminLogEventsFilter ( channelAdminLogEventsFilter ) , } 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 :: channelAdminLogEventsFilter > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = ChannelAdminLogEventsFilter ; fn into_boxed ( self ) -> ChannelAdminLogEventsFilter { ChannelAdminLogEventsFilter :: channelAdminLogEventsFilter ( self ) } } # [ derive ( Debug , Clone ) ] pub enum ChannelAdminRights { channelAdminRights ( channelAdminRights ) , } 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 :: channelAdminRights > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = ChannelAdminRights ; fn into_boxed ( self ) -> ChannelAdminRights { ChannelAdminRights :: channelAdminRights ( self ) } } # [ derive ( Debug , Clone ) ] pub enum ChannelBannedRights { channelBannedRights ( channelBannedRights ) , } 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 :: channelBannedRights > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = ChannelBannedRights ; fn into_boxed ( self ) -> ChannelBannedRights { ChannelBannedRights :: channelBannedRights ( self ) } } # [ derive ( Debug , Clone ) ] pub enum ChannelMessagesFilter { channelMessagesFilterEmpty , channelMessagesFilter ( channelMessagesFilter ) , } impl :: BoxedSerialize for ChannelMessagesFilter { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ChannelMessagesFilter :: channelMessagesFilterEmpty => ( :: 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 :: channelMessagesFilterEmpty ) , :: ConstructorNumber ( 0xcd77d957 ) => Ok ( ChannelMessagesFilter :: channelMessagesFilter ( _de . read_bare :: < :: mtproto :: channelMessagesFilter > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = ChannelMessagesFilter ; fn into_boxed ( self ) -> ChannelMessagesFilter { ChannelMessagesFilter :: channelMessagesFilter ( self ) } } # [ derive ( Debug , Clone ) ] pub enum ChannelParticipant { channelParticipant ( channelParticipant ) , channelParticipantSelf ( channelParticipantSelf ) , channelParticipantCreator ( channelParticipantCreator ) , channelParticipantAdmin ( channelParticipantAdmin ) , channelParticipantBanned ( channelParticipantBanned ) , } impl :: BoxedSerialize for ChannelParticipant { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ChannelParticipant :: channelParticipant ( ref x ) => ( :: ConstructorNumber ( 0x15ebac1d ) , x ) , & ChannelParticipant :: channelParticipantSelf ( ref x ) => ( :: ConstructorNumber ( 0xa3289a6d ) , x ) , & ChannelParticipant :: channelParticipantCreator ( ref x ) => ( :: ConstructorNumber ( 0xe3e2e1f9 ) , x ) , & ChannelParticipant :: channelParticipantAdmin ( ref x ) => ( :: ConstructorNumber ( 0xa82fa898 ) , x ) , & ChannelParticipant :: channelParticipantBanned ( 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 :: channelParticipant > ( ) ? ) ) , :: ConstructorNumber ( 0xa3289a6d ) => Ok ( ChannelParticipant :: channelParticipantSelf ( _de . read_bare :: < :: mtproto :: channelParticipantSelf > ( ) ? ) ) , :: ConstructorNumber ( 0xe3e2e1f9 ) => Ok ( ChannelParticipant :: channelParticipantCreator ( _de . read_bare :: < :: mtproto :: channelParticipantCreator > ( ) ? ) ) , :: ConstructorNumber ( 0xa82fa898 ) => Ok ( ChannelParticipant :: channelParticipantAdmin ( _de . read_bare :: < :: mtproto :: channelParticipantAdmin > ( ) ? ) ) , :: ConstructorNumber ( 0x222c1886 ) => Ok ( ChannelParticipant :: channelParticipantBanned ( _de . read_bare :: < :: mtproto :: channelParticipantBanned > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = ChannelParticipant ; fn into_boxed ( self ) -> ChannelParticipant { ChannelParticipant :: channelParticipant ( self ) } } # [ derive ( Debug , Clone ) ] pub struct channelParticipantSelf { pub user_id : :: mtproto :: int , pub inviter_id : :: mtproto :: int , pub date : :: mtproto :: int , } impl :: BareSerialize for channelParticipantSelf { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & channelParticipantSelf { 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 channelParticipantSelf { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( channelParticipantSelf { user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , inviter_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for channelParticipantSelf { type Boxed = ChannelParticipant ; fn into_boxed ( self ) -> ChannelParticipant { ChannelParticipant :: channelParticipantSelf ( self ) } } # [ derive ( Debug , Clone ) ] pub struct channelParticipantCreator { pub user_id : :: mtproto :: int , } impl :: BareSerialize for channelParticipantCreator { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & channelParticipantCreator { ref user_id } = self ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for channelParticipantCreator { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( channelParticipantCreator { user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for channelParticipantCreator { type Boxed = ChannelParticipant ; fn into_boxed ( self ) -> ChannelParticipant { ChannelParticipant :: channelParticipantCreator ( self ) } } # [ derive ( Debug , Clone ) ] pub struct channelParticipantAdmin { 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 channelParticipantAdmin { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & channelParticipantAdmin { 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 channelParticipantAdmin { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( channelParticipantAdmin { 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 channelParticipantAdmin { type Boxed = ChannelParticipant ; fn into_boxed ( self ) -> ChannelParticipant { ChannelParticipant :: channelParticipantAdmin ( self ) } } # [ derive ( Debug , Clone ) ] pub struct channelParticipantBanned { 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 channelParticipantBanned { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & channelParticipantBanned { 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 channelParticipantBanned { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( channelParticipantBanned { 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 channelParticipantBanned { type Boxed = ChannelParticipant ; fn into_boxed ( self ) -> ChannelParticipant { ChannelParticipant :: channelParticipantBanned ( self ) } } # [ derive ( Debug , Clone ) ] pub enum ChannelParticipantsFilter { channelParticipantsRecent , channelParticipantsAdmins , channelParticipantsKicked ( channelParticipantsKicked ) , channelParticipantsBots , channelParticipantsBanned ( channelParticipantsBanned ) , channelParticipantsSearch ( channelParticipantsSearch ) , } impl :: BoxedSerialize for ChannelParticipantsFilter { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ChannelParticipantsFilter :: channelParticipantsRecent => ( :: ConstructorNumber ( 0xde3f3c79 ) , & ( ) ) , & ChannelParticipantsFilter :: channelParticipantsAdmins => ( :: ConstructorNumber ( 0xb4608969 ) , & ( ) ) , & ChannelParticipantsFilter :: channelParticipantsKicked ( ref x ) => ( :: ConstructorNumber ( 0xa3b54985 ) , x ) , & ChannelParticipantsFilter :: channelParticipantsBots => ( :: ConstructorNumber ( 0xb0d1865b ) , & ( ) ) , & ChannelParticipantsFilter :: channelParticipantsBanned ( ref x ) => ( :: ConstructorNumber ( 0x1427a5e1 ) , x ) , & ChannelParticipantsFilter :: channelParticipantsSearch ( 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 :: channelParticipantsRecent ) , :: ConstructorNumber ( 0xb4608969 ) => Ok ( ChannelParticipantsFilter :: channelParticipantsAdmins ) , :: ConstructorNumber ( 0xa3b54985 ) => Ok ( ChannelParticipantsFilter :: channelParticipantsKicked ( _de . read_bare :: < :: mtproto :: channelParticipantsKicked > ( ) ? ) ) , :: ConstructorNumber ( 0xb0d1865b ) => Ok ( ChannelParticipantsFilter :: channelParticipantsBots ) , :: ConstructorNumber ( 0x1427a5e1 ) => Ok ( ChannelParticipantsFilter :: channelParticipantsBanned ( _de . read_bare :: < :: mtproto :: channelParticipantsBanned > ( ) ? ) ) , :: ConstructorNumber ( 0x0656ac4b ) => Ok ( ChannelParticipantsFilter :: channelParticipantsSearch ( _de . read_bare :: < :: mtproto :: channelParticipantsSearch > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct channelParticipantsKicked { pub q : :: mtproto :: string , } impl :: BareSerialize for channelParticipantsKicked { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & channelParticipantsKicked { ref q } = self ; _ser . write_bare :: < :: mtproto :: string > ( q ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for channelParticipantsKicked { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( channelParticipantsKicked { q : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for channelParticipantsKicked { type Boxed = ChannelParticipantsFilter ; fn into_boxed ( self ) -> ChannelParticipantsFilter { ChannelParticipantsFilter :: channelParticipantsKicked ( self ) } } # [ derive ( Debug , Clone ) ] pub struct channelParticipantsBanned { pub q : :: mtproto :: string , } impl :: BareSerialize for channelParticipantsBanned { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & channelParticipantsBanned { ref q } = self ; _ser . write_bare :: < :: mtproto :: string > ( q ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for channelParticipantsBanned { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( channelParticipantsBanned { q : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for channelParticipantsBanned { type Boxed = ChannelParticipantsFilter ; fn into_boxed ( self ) -> ChannelParticipantsFilter { ChannelParticipantsFilter :: channelParticipantsBanned ( self ) } } # [ derive ( Debug , Clone ) ] pub struct channelParticipantsSearch { pub q : :: mtproto :: string , } impl :: BareSerialize for channelParticipantsSearch { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & channelParticipantsSearch { ref q } = self ; _ser . write_bare :: < :: mtproto :: string > ( q ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for channelParticipantsSearch { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( channelParticipantsSearch { q : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for channelParticipantsSearch { type Boxed = ChannelParticipantsFilter ; fn into_boxed ( self ) -> ChannelParticipantsFilter { ChannelParticipantsFilter :: channelParticipantsSearch ( self ) } } # [ derive ( Debug , Clone ) ] pub enum Chat { chatEmpty ( chatEmpty ) , chat ( chat ) , chatForbidden ( chatForbidden ) , channel ( channel ) , channelForbidden ( channelForbidden ) , } 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 :: chatEmpty > ( ) ? ) ) , :: ConstructorNumber ( 0xd91cdd54 ) => Ok ( Chat :: chat ( _de . read_bare :: < :: mtproto :: chat > ( ) ? ) ) , :: ConstructorNumber ( 0x07328bdb ) => Ok ( Chat :: chatForbidden ( _de . read_bare :: < :: mtproto :: chatForbidden > ( ) ? ) ) , :: ConstructorNumber ( 0x450b7115 ) => Ok ( Chat :: channel ( _de . read_bare :: < :: mtproto :: channel > ( ) ? ) ) , :: ConstructorNumber ( 0x289da732 ) => Ok ( Chat :: channelForbidden ( _de . read_bare :: < :: mtproto :: channelForbidden > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = Chat ; fn into_boxed ( self ) -> Chat { Chat :: chatEmpty ( self ) } } # [ derive ( Debug , Clone ) ] 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 = Chat ; fn into_boxed ( self ) -> Chat { Chat :: chat ( self ) } } # [ derive ( Debug , Clone ) ] 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 = Chat ; fn into_boxed ( self ) -> Chat { Chat :: chatForbidden ( self ) } } # [ derive ( Debug , Clone ) ] 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 = Chat ; fn into_boxed ( self ) -> Chat { Chat :: channel ( self ) } } # [ derive ( Debug , Clone ) ] 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 = Chat ; fn into_boxed ( self ) -> Chat { Chat :: channelForbidden ( self ) } } # [ derive ( Debug , Clone ) ] pub enum ChatFull { chatFull ( chatFull ) , channelFull ( channelFull ) , } 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 :: chatFull > ( ) ? ) ) , :: ConstructorNumber ( 0x76af5481 ) => Ok ( ChatFull :: channelFull ( _de . read_bare :: < :: mtproto :: channelFull > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = ChatFull ; fn into_boxed ( self ) -> ChatFull { ChatFull :: chatFull ( self ) } } # [ derive ( Debug , Clone ) ] 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 = ChatFull ; fn into_boxed ( self ) -> ChatFull { ChatFull :: channelFull ( self ) } } # [ derive ( Debug , Clone ) ] pub enum ChatInvite { chatInviteAlready ( chatInviteAlready ) , chatInvite ( chatInvite ) , } impl :: BoxedSerialize for ChatInvite { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ChatInvite :: chatInviteAlready ( 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 :: chatInviteAlready ( _de . read_bare :: < :: mtproto :: chatInviteAlready > ( ) ? ) ) , :: ConstructorNumber ( 0xdb74f558 ) => Ok ( ChatInvite :: chatInvite ( _de . read_bare :: < :: mtproto :: chatInvite > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct chatInviteAlready { pub chat : :: mtproto :: Chat , } impl :: BareSerialize for chatInviteAlready { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & chatInviteAlready { ref chat } = self ; _ser . write_boxed :: < :: mtproto :: Chat > ( chat ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for chatInviteAlready { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( chatInviteAlready { chat : _de . read_boxed :: < :: mtproto :: Chat > ( ) ? , } ) } } impl :: IntoBoxed for chatInviteAlready { type Boxed = ChatInvite ; fn into_boxed ( self ) -> ChatInvite { ChatInvite :: chatInviteAlready ( self ) } } # [ derive ( Debug , Clone ) ] 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 = ChatInvite ; fn into_boxed ( self ) -> ChatInvite { ChatInvite :: chatInvite ( self ) } } # [ derive ( Debug , Clone ) ] pub enum ChatParticipant { chatParticipant ( chatParticipant ) , chatParticipantCreator ( chatParticipantCreator ) , chatParticipantAdmin ( chatParticipantAdmin ) , } impl :: BoxedSerialize for ChatParticipant { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ChatParticipant :: chatParticipant ( ref x ) => ( :: ConstructorNumber ( 0xc8d7493e ) , x ) , & ChatParticipant :: chatParticipantCreator ( ref x ) => ( :: ConstructorNumber ( 0xda13538a ) , x ) , & ChatParticipant :: chatParticipantAdmin ( 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 :: chatParticipant > ( ) ? ) ) , :: ConstructorNumber ( 0xda13538a ) => Ok ( ChatParticipant :: chatParticipantCreator ( _de . read_bare :: < :: mtproto :: chatParticipantCreator > ( ) ? ) ) , :: ConstructorNumber ( 0xe2d6e436 ) => Ok ( ChatParticipant :: chatParticipantAdmin ( _de . read_bare :: < :: mtproto :: chatParticipantAdmin > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = ChatParticipant ; fn into_boxed ( self ) -> ChatParticipant { ChatParticipant :: chatParticipant ( self ) } } # [ derive ( Debug , Clone ) ] pub struct chatParticipantCreator { pub user_id : :: mtproto :: int , } impl :: BareSerialize for chatParticipantCreator { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & chatParticipantCreator { ref user_id } = self ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for chatParticipantCreator { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( chatParticipantCreator { user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for chatParticipantCreator { type Boxed = ChatParticipant ; fn into_boxed ( self ) -> ChatParticipant { ChatParticipant :: chatParticipantCreator ( self ) } } # [ derive ( Debug , Clone ) ] pub struct chatParticipantAdmin { pub user_id : :: mtproto :: int , pub inviter_id : :: mtproto :: int , pub date : :: mtproto :: int , } impl :: BareSerialize for chatParticipantAdmin { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & chatParticipantAdmin { 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 chatParticipantAdmin { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( chatParticipantAdmin { user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , inviter_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for chatParticipantAdmin { type Boxed = ChatParticipant ; fn into_boxed ( self ) -> ChatParticipant { ChatParticipant :: chatParticipantAdmin ( self ) } } # [ derive ( Debug , Clone ) ] pub enum ChatParticipants { chatParticipantsForbidden ( chatParticipantsForbidden ) , chatParticipants ( chatParticipants ) , } impl :: BoxedSerialize for ChatParticipants { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ChatParticipants :: chatParticipantsForbidden ( 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 :: chatParticipantsForbidden ( _de . read_bare :: < :: mtproto :: chatParticipantsForbidden > ( ) ? ) ) , :: ConstructorNumber ( 0x3f460fed ) => Ok ( ChatParticipants :: chatParticipants ( _de . read_bare :: < :: mtproto :: chatParticipants > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct chatParticipantsForbidden { pub chat_id : :: mtproto :: int , pub self_participant : Option < :: mtproto :: ChatParticipant > , } impl :: BareSerialize for chatParticipantsForbidden { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & chatParticipantsForbidden { 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 chatParticipantsForbidden { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( chatParticipantsForbidden { 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 chatParticipantsForbidden { type Boxed = ChatParticipants ; fn into_boxed ( self ) -> ChatParticipants { ChatParticipants :: chatParticipantsForbidden ( self ) } } # [ derive ( Debug , Clone ) ] 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 = ChatParticipants ; fn into_boxed ( self ) -> ChatParticipants { ChatParticipants :: chatParticipants ( self ) } } # [ derive ( Debug , Clone ) ] pub enum ChatPhoto { chatPhotoEmpty , chatPhoto ( chatPhoto ) , } impl :: BoxedSerialize for ChatPhoto { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ChatPhoto :: chatPhotoEmpty => ( :: 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 :: chatPhotoEmpty ) , :: ConstructorNumber ( 0x6153276a ) => Ok ( ChatPhoto :: chatPhoto ( _de . read_bare :: < :: mtproto :: chatPhoto > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = ChatPhoto ; fn into_boxed ( self ) -> ChatPhoto { ChatPhoto :: chatPhoto ( self ) } } # [ derive ( Debug , Clone ) ] pub enum Client_DH_Inner_Data { client_DH_inner_data ( client_DH_inner_data ) , } impl :: BoxedSerialize for Client_DH_Inner_Data { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Client_DH_Inner_Data :: client_DH_inner_data ( ref x ) => ( :: ConstructorNumber ( 0x6643b654 ) , x ) , } } } impl :: BoxedDeserialize for Client_DH_Inner_Data { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0x6643b654 ) ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0x6643b654 ) => Ok ( Client_DH_Inner_Data :: client_DH_inner_data ( _de . read_bare :: < :: mtproto :: client_DH_inner_data > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct client_DH_inner_data { pub nonce : :: mtproto :: int128 , pub server_nonce : :: mtproto :: int128 , pub retry_id : :: mtproto :: long , pub g_b : :: mtproto :: bytes , } impl :: BareSerialize for client_DH_inner_data { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & client_DH_inner_data { 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 client_DH_inner_data { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( client_DH_inner_data { 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 client_DH_inner_data { type Boxed = Client_DH_Inner_Data ; fn into_boxed ( self ) -> Client_DH_Inner_Data { Client_DH_Inner_Data :: client_DH_inner_data ( self ) } } # [ derive ( Debug , Clone ) ] pub enum Config { config ( config ) , } 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 > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = Config ; fn into_boxed ( self ) -> Config { Config :: config ( self ) } } # [ derive ( Debug , Clone ) ] pub enum Contact { contact ( contact ) , } 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 > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = Contact ; fn into_boxed ( self ) -> Contact { Contact :: contact ( self ) } } # [ derive ( Debug , Clone ) ] pub enum ContactBlocked { contactBlocked ( contactBlocked ) , } 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 :: contactBlocked > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = ContactBlocked ; fn into_boxed ( self ) -> ContactBlocked { ContactBlocked :: contactBlocked ( self ) } } # [ derive ( Debug , Clone ) ] pub enum ContactLink { contactLinkUnknown , contactLinkNone , contactLinkHasPhone , contactLinkContact , } impl :: BoxedSerialize for ContactLink { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ContactLink :: contactLinkUnknown => ( :: ConstructorNumber ( 0x5f4f9247 ) , & ( ) ) , & ContactLink :: contactLinkNone => ( :: ConstructorNumber ( 0xfeedd3ad ) , & ( ) ) , & ContactLink :: contactLinkHasPhone => ( :: ConstructorNumber ( 0x268f3f59 ) , & ( ) ) , & ContactLink :: contactLinkContact => ( :: 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 :: contactLinkUnknown ) , :: ConstructorNumber ( 0xfeedd3ad ) => Ok ( ContactLink :: contactLinkNone ) , :: ConstructorNumber ( 0x268f3f59 ) => Ok ( ContactLink :: contactLinkHasPhone ) , :: ConstructorNumber ( 0xd502c2d0 ) => Ok ( ContactLink :: contactLinkContact ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub enum ContactStatus { contactStatus ( contactStatus ) , } 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 :: contactStatus > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = ContactStatus ; fn into_boxed ( self ) -> ContactStatus { ContactStatus :: contactStatus ( self ) } } # [ derive ( Debug , Clone ) ] pub enum DataJSON { dataJSON ( dataJSON ) , } 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 :: dataJSON > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = DataJSON ; fn into_boxed ( self ) -> DataJSON { DataJSON :: dataJSON ( self ) } } # [ derive ( Debug , Clone ) ] pub enum DcOption { dcOption ( dcOption ) , } 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 :: dcOption > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = DcOption ; fn into_boxed ( self ) -> DcOption { DcOption :: dcOption ( self ) } } # [ derive ( Debug , Clone ) ] pub enum DestroyAuthKeyRes { destroy_auth_key_ok , destroy_auth_key_none , destroy_auth_key_fail , } impl :: BoxedSerialize for DestroyAuthKeyRes { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & DestroyAuthKeyRes :: destroy_auth_key_ok => ( :: ConstructorNumber ( 0xf660e1d4 ) , & ( ) ) , & DestroyAuthKeyRes :: destroy_auth_key_none => ( :: ConstructorNumber ( 0x0a9f2259 ) , & ( ) ) , & DestroyAuthKeyRes :: destroy_auth_key_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 :: destroy_auth_key_ok ) , :: ConstructorNumber ( 0x0a9f2259 ) => Ok ( DestroyAuthKeyRes :: destroy_auth_key_none ) , :: ConstructorNumber ( 0xea109b13 ) => Ok ( DestroyAuthKeyRes :: destroy_auth_key_fail ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub enum DestroySessionRes { destroy_session_ok ( destroy_session_ok ) , destroy_session_none ( destroy_session_none ) , } impl :: BoxedSerialize for DestroySessionRes { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & DestroySessionRes :: destroy_session_ok ( ref x ) => ( :: ConstructorNumber ( 0xe22045fc ) , x ) , & DestroySessionRes :: destroy_session_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 :: destroy_session_ok ( _de . read_bare :: < :: mtproto :: destroy_session_ok > ( ) ? ) ) , :: ConstructorNumber ( 0x62d350c9 ) => Ok ( DestroySessionRes :: destroy_session_none ( _de . read_bare :: < :: mtproto :: destroy_session_none > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct destroy_session_ok { pub session_id : :: mtproto :: long , } impl :: BareSerialize for destroy_session_ok { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & destroy_session_ok { ref session_id } = self ; _ser . write_bare :: < :: mtproto :: long > ( session_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for destroy_session_ok { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( destroy_session_ok { session_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for destroy_session_ok { type Boxed = DestroySessionRes ; fn into_boxed ( self ) -> DestroySessionRes { DestroySessionRes :: destroy_session_ok ( self ) } } # [ derive ( Debug , Clone ) ] pub struct destroy_session_none { pub session_id : :: mtproto :: long , } impl :: BareSerialize for destroy_session_none { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & destroy_session_none { ref session_id } = self ; _ser . write_bare :: < :: mtproto :: long > ( session_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for destroy_session_none { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( destroy_session_none { session_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for destroy_session_none { type Boxed = DestroySessionRes ; fn into_boxed ( self ) -> DestroySessionRes { DestroySessionRes :: destroy_session_none ( self ) } } # [ derive ( Debug , Clone ) ] pub enum Dialog { dialog ( dialog ) , } 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 > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = Dialog ; fn into_boxed ( self ) -> Dialog { Dialog :: dialog ( self ) } } # [ derive ( Debug , Clone ) ] pub enum DisabledFeature { disabledFeature ( disabledFeature ) , } 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 :: disabledFeature > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = DisabledFeature ; fn into_boxed ( self ) -> DisabledFeature { DisabledFeature :: disabledFeature ( self ) } } # [ derive ( Debug , Clone ) ] pub enum Document { documentEmpty ( documentEmpty ) , document ( document ) , } impl :: BoxedSerialize for Document { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Document :: documentEmpty ( 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 :: documentEmpty ( _de . read_bare :: < :: mtproto :: documentEmpty > ( ) ? ) ) , :: ConstructorNumber ( 0x87232bc7 ) => Ok ( Document :: document ( _de . read_bare :: < :: mtproto :: document > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct documentEmpty { pub id : :: mtproto :: long , } impl :: BareSerialize for documentEmpty { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & documentEmpty { ref id } = self ; _ser . write_bare :: < :: mtproto :: long > ( id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for documentEmpty { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( documentEmpty { id : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for documentEmpty { type Boxed = Document ; fn into_boxed ( self ) -> Document { Document :: documentEmpty ( self ) } } # [ derive ( Debug , Clone ) ] 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 = Document ; fn into_boxed ( self ) -> Document { Document :: document ( self ) } } # [ derive ( Debug , Clone ) ] pub enum DocumentAttribute { documentAttributeImageSize ( documentAttributeImageSize ) , documentAttributeAnimated , documentAttributeSticker ( documentAttributeSticker ) , documentAttributeVideo ( documentAttributeVideo ) , documentAttributeAudio ( documentAttributeAudio ) , documentAttributeFilename ( documentAttributeFilename ) , documentAttributeHasStickers , } impl :: BoxedSerialize for DocumentAttribute { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & DocumentAttribute :: documentAttributeImageSize ( ref x ) => ( :: ConstructorNumber ( 0x6c37c15c ) , x ) , & DocumentAttribute :: documentAttributeAnimated => ( :: ConstructorNumber ( 0x11b58939 ) , & ( ) ) , & DocumentAttribute :: documentAttributeSticker ( ref x ) => ( :: ConstructorNumber ( 0x6319d612 ) , x ) , & DocumentAttribute :: documentAttributeVideo ( ref x ) => ( :: ConstructorNumber ( 0x0ef02ce6 ) , x ) , & DocumentAttribute :: documentAttributeAudio ( ref x ) => ( :: ConstructorNumber ( 0x9852f9c6 ) , x ) , & DocumentAttribute :: documentAttributeFilename ( ref x ) => ( :: ConstructorNumber ( 0x15590068 ) , x ) , & DocumentAttribute :: documentAttributeHasStickers => ( :: 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 :: documentAttributeImageSize ( _de . read_bare :: < :: mtproto :: documentAttributeImageSize > ( ) ? ) ) , :: ConstructorNumber ( 0x11b58939 ) => Ok ( DocumentAttribute :: documentAttributeAnimated ) , :: ConstructorNumber ( 0x6319d612 ) => Ok ( DocumentAttribute :: documentAttributeSticker ( _de . read_bare :: < :: mtproto :: documentAttributeSticker > ( ) ? ) ) , :: ConstructorNumber ( 0x0ef02ce6 ) => Ok ( DocumentAttribute :: documentAttributeVideo ( _de . read_bare :: < :: mtproto :: documentAttributeVideo > ( ) ? ) ) , :: ConstructorNumber ( 0x9852f9c6 ) => Ok ( DocumentAttribute :: documentAttributeAudio ( _de . read_bare :: < :: mtproto :: documentAttributeAudio > ( ) ? ) ) , :: ConstructorNumber ( 0x15590068 ) => Ok ( DocumentAttribute :: documentAttributeFilename ( _de . read_bare :: < :: mtproto :: documentAttributeFilename > ( ) ? ) ) , :: ConstructorNumber ( 0x9801d2f7 ) => Ok ( DocumentAttribute :: documentAttributeHasStickers ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct documentAttributeImageSize { pub w : :: mtproto :: int , pub h : :: mtproto :: int , } impl :: BareSerialize for documentAttributeImageSize { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & documentAttributeImageSize { ref w , ref h } = self ; _ser . write_bare :: < :: mtproto :: int > ( w ) ? ; _ser . write_bare :: < :: mtproto :: int > ( h ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for documentAttributeImageSize { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( documentAttributeImageSize { w : _de . read_bare :: < :: mtproto :: int > ( ) ? , h : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for documentAttributeImageSize { type Boxed = DocumentAttribute ; fn into_boxed ( self ) -> DocumentAttribute { DocumentAttribute :: documentAttributeImageSize ( self ) } } # [ derive ( Debug , Clone ) ] pub struct documentAttributeSticker { pub mask : bool , pub alt : :: mtproto :: string , pub stickerset : :: mtproto :: InputStickerSet , pub mask_coords : Option < :: mtproto :: MaskCoords > , } impl :: BareSerialize for documentAttributeSticker { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & documentAttributeSticker { 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 documentAttributeSticker { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( documentAttributeSticker { 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 documentAttributeSticker { type Boxed = DocumentAttribute ; fn into_boxed ( self ) -> DocumentAttribute { DocumentAttribute :: documentAttributeSticker ( self ) } } # [ derive ( Debug , Clone ) ] pub struct documentAttributeVideo { pub round_message : bool , pub duration : :: mtproto :: int , pub w : :: mtproto :: int , pub h : :: mtproto :: int , } impl :: BareSerialize for documentAttributeVideo { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & documentAttributeVideo { 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 documentAttributeVideo { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( documentAttributeVideo { 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 documentAttributeVideo { type Boxed = DocumentAttribute ; fn into_boxed ( self ) -> DocumentAttribute { DocumentAttribute :: documentAttributeVideo ( self ) } } # [ derive ( Debug , Clone ) ] pub struct documentAttributeAudio { 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 documentAttributeAudio { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & documentAttributeAudio { 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 documentAttributeAudio { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( documentAttributeAudio { 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 documentAttributeAudio { type Boxed = DocumentAttribute ; fn into_boxed ( self ) -> DocumentAttribute { DocumentAttribute :: documentAttributeAudio ( self ) } } # [ derive ( Debug , Clone ) ] pub struct documentAttributeFilename { pub file_name : :: mtproto :: string , } impl :: BareSerialize for documentAttributeFilename { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & documentAttributeFilename { ref file_name } = self ; _ser . write_bare :: < :: mtproto :: string > ( file_name ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for documentAttributeFilename { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( documentAttributeFilename { file_name : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for documentAttributeFilename { type Boxed = DocumentAttribute ; fn into_boxed ( self ) -> DocumentAttribute { DocumentAttribute :: documentAttributeFilename ( self ) } } # [ derive ( Debug , Clone ) ] pub enum DraftMessage { draftMessageEmpty , draftMessage ( draftMessage ) , } impl :: BoxedSerialize for DraftMessage { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & DraftMessage :: draftMessageEmpty => ( :: 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 :: draftMessageEmpty ) , :: ConstructorNumber ( 0xfd8e711f ) => Ok ( DraftMessage :: draftMessage ( _de . read_bare :: < :: mtproto :: draftMessage > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = DraftMessage ; fn into_boxed ( self ) -> DraftMessage { DraftMessage :: draftMessage ( self ) } } # [ derive ( Debug , Clone ) ] pub enum EncryptedChat { encryptedChatEmpty ( encryptedChatEmpty ) , encryptedChatWaiting ( encryptedChatWaiting ) , encryptedChatRequested ( encryptedChatRequested ) , encryptedChat ( encryptedChat ) , encryptedChatDiscarded ( encryptedChatDiscarded ) , } impl :: BoxedSerialize for EncryptedChat { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & EncryptedChat :: encryptedChatEmpty ( ref x ) => ( :: ConstructorNumber ( 0xab7ec0a0 ) , x ) , & EncryptedChat :: encryptedChatWaiting ( ref x ) => ( :: ConstructorNumber ( 0x3bf703dc ) , x ) , & EncryptedChat :: encryptedChatRequested ( ref x ) => ( :: ConstructorNumber ( 0xc878527e ) , x ) , & EncryptedChat :: encryptedChat ( ref x ) => ( :: ConstructorNumber ( 0xfa56ce36 ) , x ) , & EncryptedChat :: encryptedChatDiscarded ( 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 :: encryptedChatEmpty ( _de . read_bare :: < :: mtproto :: encryptedChatEmpty > ( ) ? ) ) , :: ConstructorNumber ( 0x3bf703dc ) => Ok ( EncryptedChat :: encryptedChatWaiting ( _de . read_bare :: < :: mtproto :: encryptedChatWaiting > ( ) ? ) ) , :: ConstructorNumber ( 0xc878527e ) => Ok ( EncryptedChat :: encryptedChatRequested ( _de . read_bare :: < :: mtproto :: encryptedChatRequested > ( ) ? ) ) , :: ConstructorNumber ( 0xfa56ce36 ) => Ok ( EncryptedChat :: encryptedChat ( _de . read_bare :: < :: mtproto :: encryptedChat > ( ) ? ) ) , :: ConstructorNumber ( 0x13d6dd27 ) => Ok ( EncryptedChat :: encryptedChatDiscarded ( _de . read_bare :: < :: mtproto :: encryptedChatDiscarded > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct encryptedChatEmpty { pub id : :: mtproto :: int , } impl :: BareSerialize for encryptedChatEmpty { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & encryptedChatEmpty { ref id } = self ; _ser . write_bare :: < :: mtproto :: int > ( id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for encryptedChatEmpty { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( encryptedChatEmpty { id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for encryptedChatEmpty { type Boxed = EncryptedChat ; fn into_boxed ( self ) -> EncryptedChat { EncryptedChat :: encryptedChatEmpty ( self ) } } # [ derive ( Debug , Clone ) ] pub struct encryptedChatWaiting { 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 encryptedChatWaiting { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & encryptedChatWaiting { 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 encryptedChatWaiting { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( encryptedChatWaiting { 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 encryptedChatWaiting { type Boxed = EncryptedChat ; fn into_boxed ( self ) -> EncryptedChat { EncryptedChat :: encryptedChatWaiting ( self ) } } # [ derive ( Debug , Clone ) ] pub struct encryptedChatRequested { 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 encryptedChatRequested { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & encryptedChatRequested { 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 encryptedChatRequested { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( encryptedChatRequested { 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 encryptedChatRequested { type Boxed = EncryptedChat ; fn into_boxed ( self ) -> EncryptedChat { EncryptedChat :: encryptedChatRequested ( self ) } } # [ derive ( Debug , Clone ) ] 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 = EncryptedChat ; fn into_boxed ( self ) -> EncryptedChat { EncryptedChat :: encryptedChat ( self ) } } # [ derive ( Debug , Clone ) ] pub struct encryptedChatDiscarded { pub id : :: mtproto :: int , } impl :: BareSerialize for encryptedChatDiscarded { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & encryptedChatDiscarded { ref id } = self ; _ser . write_bare :: < :: mtproto :: int > ( id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for encryptedChatDiscarded { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( encryptedChatDiscarded { id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for encryptedChatDiscarded { type Boxed = EncryptedChat ; fn into_boxed ( self ) -> EncryptedChat { EncryptedChat :: encryptedChatDiscarded ( self ) } } # [ derive ( Debug , Clone ) ] pub enum EncryptedFile { encryptedFileEmpty , encryptedFile ( encryptedFile ) , } impl :: BoxedSerialize for EncryptedFile { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & EncryptedFile :: encryptedFileEmpty => ( :: 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 :: encryptedFileEmpty ) , :: ConstructorNumber ( 0x4a70994c ) => Ok ( EncryptedFile :: encryptedFile ( _de . read_bare :: < :: mtproto :: encryptedFile > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = EncryptedFile ; fn into_boxed ( self ) -> EncryptedFile { EncryptedFile :: encryptedFile ( self ) } } # [ derive ( Debug , Clone ) ] pub enum EncryptedMessage { encryptedMessage ( encryptedMessage ) , encryptedMessageService ( encryptedMessageService ) , } impl :: BoxedSerialize for EncryptedMessage { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & EncryptedMessage :: encryptedMessage ( ref x ) => ( :: ConstructorNumber ( 0xed18c118 ) , x ) , & EncryptedMessage :: encryptedMessageService ( 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 :: encryptedMessage > ( ) ? ) ) , :: ConstructorNumber ( 0x23734b06 ) => Ok ( EncryptedMessage :: encryptedMessageService ( _de . read_bare :: < :: mtproto :: encryptedMessageService > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = EncryptedMessage ; fn into_boxed ( self ) -> EncryptedMessage { EncryptedMessage :: encryptedMessage ( self ) } } # [ derive ( Debug , Clone ) ] pub struct encryptedMessageService { pub random_id : :: mtproto :: long , pub chat_id : :: mtproto :: int , pub date : :: mtproto :: int , pub bytes : :: mtproto :: bytes , } impl :: BareSerialize for encryptedMessageService { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & encryptedMessageService { 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 encryptedMessageService { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( encryptedMessageService { 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 encryptedMessageService { type Boxed = EncryptedMessage ; fn into_boxed ( self ) -> EncryptedMessage { EncryptedMessage :: encryptedMessageService ( self ) } } # [ derive ( Debug , Clone ) ] pub enum Error { error ( error ) , } 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 > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = Error ; fn into_boxed ( self ) -> Error { Error :: error ( self ) } } # [ derive ( Debug , Clone ) ] pub enum ExportedChatInvite { chatInviteEmpty , chatInviteExported ( chatInviteExported ) , } impl :: BoxedSerialize for ExportedChatInvite { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ExportedChatInvite :: chatInviteEmpty => ( :: ConstructorNumber ( 0x69df3769 ) , & ( ) ) , & ExportedChatInvite :: chatInviteExported ( 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 :: chatInviteEmpty ) , :: ConstructorNumber ( 0xfc2e05bc ) => Ok ( ExportedChatInvite :: chatInviteExported ( _de . read_bare :: < :: mtproto :: chatInviteExported > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct chatInviteExported { pub link : :: mtproto :: string , } impl :: BareSerialize for chatInviteExported { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & chatInviteExported { ref link } = self ; _ser . write_bare :: < :: mtproto :: string > ( link ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for chatInviteExported { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( chatInviteExported { link : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for chatInviteExported { type Boxed = ExportedChatInvite ; fn into_boxed ( self ) -> ExportedChatInvite { ExportedChatInvite :: chatInviteExported ( self ) } } # [ derive ( Debug , Clone ) ] pub enum ExportedMessageLink { exportedMessageLink ( exportedMessageLink ) , } 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 :: exportedMessageLink > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = ExportedMessageLink ; fn into_boxed ( self ) -> ExportedMessageLink { ExportedMessageLink :: exportedMessageLink ( self ) } } # [ derive ( Debug , Clone ) ] pub enum FileLocation { fileLocationUnavailable ( fileLocationUnavailable ) , fileLocation ( fileLocation ) , } impl :: BoxedSerialize for FileLocation { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & FileLocation :: fileLocationUnavailable ( 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 :: fileLocationUnavailable ( _de . read_bare :: < :: mtproto :: fileLocationUnavailable > ( ) ? ) ) , :: ConstructorNumber ( 0x53d69076 ) => Ok ( FileLocation :: fileLocation ( _de . read_bare :: < :: mtproto :: fileLocation > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct fileLocationUnavailable { pub volume_id : :: mtproto :: long , pub local_id : :: mtproto :: int , pub secret : :: mtproto :: long , } impl :: BareSerialize for fileLocationUnavailable { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & fileLocationUnavailable { 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 fileLocationUnavailable { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( fileLocationUnavailable { volume_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , local_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , secret : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for fileLocationUnavailable { type Boxed = FileLocation ; fn into_boxed ( self ) -> FileLocation { FileLocation :: fileLocationUnavailable ( self ) } } # [ derive ( Debug , Clone ) ] 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 = FileLocation ; fn into_boxed ( self ) -> FileLocation { FileLocation :: fileLocation ( self ) } } # [ derive ( Debug , Clone ) ] pub enum FoundGif { foundGif ( foundGif ) , foundGifCached ( foundGifCached ) , } impl :: BoxedSerialize for FoundGif { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & FoundGif :: foundGif ( ref x ) => ( :: ConstructorNumber ( 0x162ecc1f ) , x ) , & FoundGif :: foundGifCached ( 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 :: foundGif > ( ) ? ) ) , :: ConstructorNumber ( 0x9c750409 ) => Ok ( FoundGif :: foundGifCached ( _de . read_bare :: < :: mtproto :: foundGifCached > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = FoundGif ; fn into_boxed ( self ) -> FoundGif { FoundGif :: foundGif ( self ) } } # [ derive ( Debug , Clone ) ] pub struct foundGifCached { pub url : :: mtproto :: string , pub photo : :: mtproto :: Photo , pub document : :: mtproto :: Document , } impl :: BareSerialize for foundGifCached { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & foundGifCached { 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 foundGifCached { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( foundGifCached { url : _de . read_bare :: < :: mtproto :: string > ( ) ? , photo : _de . read_boxed :: < :: mtproto :: Photo > ( ) ? , document : _de . read_boxed :: < :: mtproto :: Document > ( ) ? , } ) } } impl :: IntoBoxed for foundGifCached { type Boxed = FoundGif ; fn into_boxed ( self ) -> FoundGif { FoundGif :: foundGifCached ( self ) } } # [ derive ( Debug , Clone ) ] pub enum FutureSalt { future_salt ( future_salt ) , } impl :: BoxedSerialize for FutureSalt { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & FutureSalt :: future_salt ( 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 :: future_salt ( _de . read_bare :: < :: mtproto :: future_salt > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct future_salt { pub valid_since : :: mtproto :: int , pub valid_until : :: mtproto :: int , pub salt : :: mtproto :: long , } impl :: BareSerialize for future_salt { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & future_salt { 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 future_salt { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( future_salt { valid_since : _de . read_bare :: < :: mtproto :: int > ( ) ? , valid_until : _de . read_bare :: < :: mtproto :: int > ( ) ? , salt : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for future_salt { type Boxed = FutureSalt ; fn into_boxed ( self ) -> FutureSalt { FutureSalt :: future_salt ( self ) } } # [ derive ( Debug , Clone ) ] pub enum FutureSalts { future_salts ( future_salts ) , } impl :: BoxedSerialize for FutureSalts { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & FutureSalts :: future_salts ( 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 :: future_salts ( _de . read_bare :: < :: mtproto :: future_salts > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct future_salts { pub req_msg_id : :: mtproto :: long , pub now : :: mtproto :: int , pub salts : :: mtproto :: vector < :: mtproto :: Bare , :: mtproto :: future_salt > , } impl :: BareSerialize for future_salts { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & future_salts { 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 > > ( salts ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for future_salts { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( future_salts { 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 > > ( ) ? , } ) } } impl :: IntoBoxed for future_salts { type Boxed = FutureSalts ; fn into_boxed ( self ) -> FutureSalts { FutureSalts :: future_salts ( self ) } } # [ derive ( Debug , Clone ) ] pub enum Game { game ( game ) , } 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 > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = Game ; fn into_boxed ( self ) -> Game { Game :: game ( self ) } } # [ derive ( Debug , Clone ) ] pub enum GeoPoint { geoPointEmpty , geoPoint ( geoPoint ) , } impl :: BoxedSerialize for GeoPoint { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & GeoPoint :: geoPointEmpty => ( :: 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 :: geoPointEmpty ) , :: ConstructorNumber ( 0x2049d70c ) => Ok ( GeoPoint :: geoPoint ( _de . read_bare :: < :: mtproto :: geoPoint > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = GeoPoint ; fn into_boxed ( self ) -> GeoPoint { GeoPoint :: geoPoint ( self ) } } # [ derive ( Debug , Clone ) ] pub enum HighScore { highScore ( highScore ) , } 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 :: highScore > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = HighScore ; fn into_boxed ( self ) -> HighScore { HighScore :: highScore ( self ) } } # [ derive ( Debug , Clone ) ] pub enum HttpWait { http_wait ( http_wait ) , } impl :: BoxedSerialize for HttpWait { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & HttpWait :: http_wait ( 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 :: http_wait ( _de . read_bare :: < :: mtproto :: http_wait > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct http_wait { pub max_delay : :: mtproto :: int , pub wait_after : :: mtproto :: int , pub max_wait : :: mtproto :: int , } impl :: BareSerialize for http_wait { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & http_wait { 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 http_wait { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( http_wait { max_delay : _de . read_bare :: < :: mtproto :: int > ( ) ? , wait_after : _de . read_bare :: < :: mtproto :: int > ( ) ? , max_wait : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for http_wait { type Boxed = HttpWait ; fn into_boxed ( self ) -> HttpWait { HttpWait :: http_wait ( self ) } } # [ derive ( Debug , Clone ) ] pub enum ImportedContact { importedContact ( importedContact ) , } 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 :: importedContact > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = ImportedContact ; fn into_boxed ( self ) -> ImportedContact { ImportedContact :: importedContact ( self ) } } # [ derive ( Debug , Clone ) ] pub enum InlineBotSwitchPM { inlineBotSwitchPM ( inlineBotSwitchPM ) , } 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 :: inlineBotSwitchPM > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = InlineBotSwitchPM ; fn into_boxed ( self ) -> InlineBotSwitchPM { InlineBotSwitchPM :: inlineBotSwitchPM ( self ) } } # [ derive ( Debug , Clone ) ] pub enum InputAppEvent { inputAppEvent ( inputAppEvent ) , } 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 :: inputAppEvent > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = InputAppEvent ; fn into_boxed ( self ) -> InputAppEvent { InputAppEvent :: inputAppEvent ( self ) } } # [ derive ( Debug , Clone ) ] pub enum InputBotInlineMessage { inputBotInlineMessageMediaAuto ( inputBotInlineMessageMediaAuto ) , inputBotInlineMessageText ( inputBotInlineMessageText ) , inputBotInlineMessageMediaGeo ( inputBotInlineMessageMediaGeo ) , inputBotInlineMessageMediaVenue ( inputBotInlineMessageMediaVenue ) , inputBotInlineMessageMediaContact ( inputBotInlineMessageMediaContact ) , inputBotInlineMessageGame ( inputBotInlineMessageGame ) , } impl :: BoxedSerialize for InputBotInlineMessage { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputBotInlineMessage :: inputBotInlineMessageMediaAuto ( ref x ) => ( :: ConstructorNumber ( 0x292fed13 ) , x ) , & InputBotInlineMessage :: inputBotInlineMessageText ( ref x ) => ( :: ConstructorNumber ( 0x3dcd7a87 ) , x ) , & InputBotInlineMessage :: inputBotInlineMessageMediaGeo ( ref x ) => ( :: ConstructorNumber ( 0xc1b15d65 ) , x ) , & InputBotInlineMessage :: inputBotInlineMessageMediaVenue ( ref x ) => ( :: ConstructorNumber ( 0xaaafadc8 ) , x ) , & InputBotInlineMessage :: inputBotInlineMessageMediaContact ( ref x ) => ( :: ConstructorNumber ( 0x2daf01a7 ) , x ) , & InputBotInlineMessage :: inputBotInlineMessageGame ( 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 :: inputBotInlineMessageMediaAuto ( _de . read_bare :: < :: mtproto :: inputBotInlineMessageMediaAuto > ( ) ? ) ) , :: ConstructorNumber ( 0x3dcd7a87 ) => Ok ( InputBotInlineMessage :: inputBotInlineMessageText ( _de . read_bare :: < :: mtproto :: inputBotInlineMessageText > ( ) ? ) ) , :: ConstructorNumber ( 0xc1b15d65 ) => Ok ( InputBotInlineMessage :: inputBotInlineMessageMediaGeo ( _de . read_bare :: < :: mtproto :: inputBotInlineMessageMediaGeo > ( ) ? ) ) , :: ConstructorNumber ( 0xaaafadc8 ) => Ok ( InputBotInlineMessage :: inputBotInlineMessageMediaVenue ( _de . read_bare :: < :: mtproto :: inputBotInlineMessageMediaVenue > ( ) ? ) ) , :: ConstructorNumber ( 0x2daf01a7 ) => Ok ( InputBotInlineMessage :: inputBotInlineMessageMediaContact ( _de . read_bare :: < :: mtproto :: inputBotInlineMessageMediaContact > ( ) ? ) ) , :: ConstructorNumber ( 0x4b425864 ) => Ok ( InputBotInlineMessage :: inputBotInlineMessageGame ( _de . read_bare :: < :: mtproto :: inputBotInlineMessageGame > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct inputBotInlineMessageMediaAuto { pub caption : :: mtproto :: string , pub reply_markup : Option < :: mtproto :: ReplyMarkup > , } impl :: BareSerialize for inputBotInlineMessageMediaAuto { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputBotInlineMessageMediaAuto { 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 inputBotInlineMessageMediaAuto { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( inputBotInlineMessageMediaAuto { 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 inputBotInlineMessageMediaAuto { type Boxed = InputBotInlineMessage ; fn into_boxed ( self ) -> InputBotInlineMessage { InputBotInlineMessage :: inputBotInlineMessageMediaAuto ( self ) } } # [ derive ( Debug , Clone ) ] pub struct inputBotInlineMessageText { 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 inputBotInlineMessageText { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputBotInlineMessageText { 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 inputBotInlineMessageText { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( inputBotInlineMessageText { 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 inputBotInlineMessageText { type Boxed = InputBotInlineMessage ; fn into_boxed ( self ) -> InputBotInlineMessage { InputBotInlineMessage :: inputBotInlineMessageText ( self ) } } # [ derive ( Debug , Clone ) ] pub struct inputBotInlineMessageMediaGeo { pub geo_point : :: mtproto :: InputGeoPoint , pub period : :: mtproto :: int , pub reply_markup : Option < :: mtproto :: ReplyMarkup > , } impl :: BareSerialize for inputBotInlineMessageMediaGeo { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputBotInlineMessageMediaGeo { 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 inputBotInlineMessageMediaGeo { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( inputBotInlineMessageMediaGeo { 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 inputBotInlineMessageMediaGeo { type Boxed = InputBotInlineMessage ; fn into_boxed ( self ) -> InputBotInlineMessage { InputBotInlineMessage :: inputBotInlineMessageMediaGeo ( self ) } } # [ derive ( Debug , Clone ) ] pub struct inputBotInlineMessageMediaVenue { 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 inputBotInlineMessageMediaVenue { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputBotInlineMessageMediaVenue { 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 inputBotInlineMessageMediaVenue { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( inputBotInlineMessageMediaVenue { 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 inputBotInlineMessageMediaVenue { type Boxed = InputBotInlineMessage ; fn into_boxed ( self ) -> InputBotInlineMessage { InputBotInlineMessage :: inputBotInlineMessageMediaVenue ( self ) } } # [ derive ( Debug , Clone ) ] pub struct inputBotInlineMessageMediaContact { pub phone_number : :: mtproto :: string , pub first_name : :: mtproto :: string , pub last_name : :: mtproto :: string , pub reply_markup : Option < :: mtproto :: ReplyMarkup > , } impl :: BareSerialize for inputBotInlineMessageMediaContact { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputBotInlineMessageMediaContact { 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 inputBotInlineMessageMediaContact { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( inputBotInlineMessageMediaContact { 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 inputBotInlineMessageMediaContact { type Boxed = InputBotInlineMessage ; fn into_boxed ( self ) -> InputBotInlineMessage { InputBotInlineMessage :: inputBotInlineMessageMediaContact ( self ) } } # [ derive ( Debug , Clone ) ] pub struct inputBotInlineMessageGame { pub reply_markup : Option < :: mtproto :: ReplyMarkup > , } impl :: BareSerialize for inputBotInlineMessageGame { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputBotInlineMessageGame { 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 inputBotInlineMessageGame { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( inputBotInlineMessageGame { reply_markup : { flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; if flags & ( 1 << 2u32 ) != 0 { Some ( _de . read_boxed :: < :: mtproto :: ReplyMarkup > ( ) ? ) } else { None } } , } ) } } impl :: IntoBoxed for inputBotInlineMessageGame { type Boxed = InputBotInlineMessage ; fn into_boxed ( self ) -> InputBotInlineMessage { InputBotInlineMessage :: inputBotInlineMessageGame ( self ) } } # [ derive ( Debug , Clone ) ] pub enum InputBotInlineMessageID { inputBotInlineMessageID ( inputBotInlineMessageID ) , } 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 :: inputBotInlineMessageID > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = InputBotInlineMessageID ; fn into_boxed ( self ) -> InputBotInlineMessageID { InputBotInlineMessageID :: inputBotInlineMessageID ( self ) } } # [ derive ( Debug , Clone ) ] pub enum InputBotInlineResult { inputBotInlineResult ( inputBotInlineResult ) , inputBotInlineResultPhoto ( inputBotInlineResultPhoto ) , inputBotInlineResultDocument ( inputBotInlineResultDocument ) , inputBotInlineResultGame ( inputBotInlineResultGame ) , } impl :: BoxedSerialize for InputBotInlineResult { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputBotInlineResult :: inputBotInlineResult ( ref x ) => ( :: ConstructorNumber ( 0x2cbbe15a ) , x ) , & InputBotInlineResult :: inputBotInlineResultPhoto ( ref x ) => ( :: ConstructorNumber ( 0xa8d864a7 ) , x ) , & InputBotInlineResult :: inputBotInlineResultDocument ( ref x ) => ( :: ConstructorNumber ( 0xfff8fdc4 ) , x ) , & InputBotInlineResult :: inputBotInlineResultGame ( 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 :: inputBotInlineResult > ( ) ? ) ) , :: ConstructorNumber ( 0xa8d864a7 ) => Ok ( InputBotInlineResult :: inputBotInlineResultPhoto ( _de . read_bare :: < :: mtproto :: inputBotInlineResultPhoto > ( ) ? ) ) , :: ConstructorNumber ( 0xfff8fdc4 ) => Ok ( InputBotInlineResult :: inputBotInlineResultDocument ( _de . read_bare :: < :: mtproto :: inputBotInlineResultDocument > ( ) ? ) ) , :: ConstructorNumber ( 0x4fa417f2 ) => Ok ( InputBotInlineResult :: inputBotInlineResultGame ( _de . read_bare :: < :: mtproto :: inputBotInlineResultGame > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = InputBotInlineResult ; fn into_boxed ( self ) -> InputBotInlineResult { InputBotInlineResult :: inputBotInlineResult ( self ) } } # [ derive ( Debug , Clone ) ] pub struct inputBotInlineResultPhoto { pub id : :: mtproto :: string , pub type_ : :: mtproto :: string , pub photo : :: mtproto :: InputPhoto , pub send_message : :: mtproto :: InputBotInlineMessage , } impl :: BareSerialize for inputBotInlineResultPhoto { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputBotInlineResultPhoto { 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 inputBotInlineResultPhoto { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( inputBotInlineResultPhoto { 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 inputBotInlineResultPhoto { type Boxed = InputBotInlineResult ; fn into_boxed ( self ) -> InputBotInlineResult { InputBotInlineResult :: inputBotInlineResultPhoto ( self ) } } # [ derive ( Debug , Clone ) ] pub struct inputBotInlineResultDocument { 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 inputBotInlineResultDocument { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputBotInlineResultDocument { 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 inputBotInlineResultDocument { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( inputBotInlineResultDocument { 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 inputBotInlineResultDocument { type Boxed = InputBotInlineResult ; fn into_boxed ( self ) -> InputBotInlineResult { InputBotInlineResult :: inputBotInlineResultDocument ( self ) } } # [ derive ( Debug , Clone ) ] pub struct inputBotInlineResultGame { pub id : :: mtproto :: string , pub short_name : :: mtproto :: string , pub send_message : :: mtproto :: InputBotInlineMessage , } impl :: BareSerialize for inputBotInlineResultGame { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputBotInlineResultGame { 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 inputBotInlineResultGame { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( inputBotInlineResultGame { id : _de . read_bare :: < :: mtproto :: string > ( ) ? , short_name : _de . read_bare :: < :: mtproto :: string > ( ) ? , send_message : _de . read_boxed :: < :: mtproto :: InputBotInlineMessage > ( ) ? , } ) } } impl :: IntoBoxed for inputBotInlineResultGame { type Boxed = InputBotInlineResult ; fn into_boxed ( self ) -> InputBotInlineResult { InputBotInlineResult :: inputBotInlineResultGame ( self ) } } # [ derive ( Debug , Clone ) ] pub enum InputChannel { inputChannelEmpty , inputChannel ( inputChannel ) , } impl :: BoxedSerialize for InputChannel { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputChannel :: inputChannelEmpty => ( :: 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 :: inputChannelEmpty ) , :: ConstructorNumber ( 0xafeb712e ) => Ok ( InputChannel :: inputChannel ( _de . read_bare :: < :: mtproto :: inputChannel > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = InputChannel ; fn into_boxed ( self ) -> InputChannel { InputChannel :: inputChannel ( self ) } } # [ derive ( Debug , Clone ) ] pub enum InputChatPhoto { inputChatPhotoEmpty , inputChatUploadedPhoto ( inputChatUploadedPhoto ) , inputChatPhoto ( inputChatPhoto ) , } impl :: BoxedSerialize for InputChatPhoto { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputChatPhoto :: inputChatPhotoEmpty => ( :: ConstructorNumber ( 0x1ca48f57 ) , & ( ) ) , & InputChatPhoto :: inputChatUploadedPhoto ( ref x ) => ( :: ConstructorNumber ( 0x927c55b4 ) , x ) , & InputChatPhoto :: inputChatPhoto ( 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 :: inputChatPhotoEmpty ) , :: ConstructorNumber ( 0x927c55b4 ) => Ok ( InputChatPhoto :: inputChatUploadedPhoto ( _de . read_bare :: < :: mtproto :: inputChatUploadedPhoto > ( ) ? ) ) , :: ConstructorNumber ( 0x8953ad37 ) => Ok ( InputChatPhoto :: inputChatPhoto ( _de . read_bare :: < :: mtproto :: inputChatPhoto > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct inputChatUploadedPhoto { pub file : :: mtproto :: InputFile , } impl :: BareSerialize for inputChatUploadedPhoto { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputChatUploadedPhoto { ref file } = self ; _ser . write_boxed :: < :: mtproto :: InputFile > ( file ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for inputChatUploadedPhoto { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( inputChatUploadedPhoto { file : _de . read_boxed :: < :: mtproto :: InputFile > ( ) ? , } ) } } impl :: IntoBoxed for inputChatUploadedPhoto { type Boxed = InputChatPhoto ; fn into_boxed ( self ) -> InputChatPhoto { InputChatPhoto :: inputChatUploadedPhoto ( self ) } } # [ derive ( Debug , Clone ) ] pub struct inputChatPhoto { pub id : :: mtproto :: InputPhoto , } impl :: BareSerialize for inputChatPhoto { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputChatPhoto { ref id } = self ; _ser . write_boxed :: < :: mtproto :: InputPhoto > ( id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for inputChatPhoto { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( inputChatPhoto { id : _de . read_boxed :: < :: mtproto :: InputPhoto > ( ) ? , } ) } } impl :: IntoBoxed for inputChatPhoto { type Boxed = InputChatPhoto ; fn into_boxed ( self ) -> InputChatPhoto { InputChatPhoto :: inputChatPhoto ( self ) } } # [ derive ( Debug , Clone ) ] pub enum InputContact { inputPhoneContact ( inputPhoneContact ) , } 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 :: inputPhoneContact > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = InputContact ; fn into_boxed ( self ) -> InputContact { InputContact :: inputPhoneContact ( self ) } } # [ derive ( Debug , Clone ) ] pub enum InputDocument { inputDocumentEmpty , inputDocument ( inputDocument ) , } impl :: BoxedSerialize for InputDocument { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputDocument :: inputDocumentEmpty => ( :: 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 :: inputDocumentEmpty ) , :: ConstructorNumber ( 0x18798952 ) => Ok ( InputDocument :: inputDocument ( _de . read_bare :: < :: mtproto :: inputDocument > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = InputDocument ; fn into_boxed ( self ) -> InputDocument { InputDocument :: inputDocument ( self ) } } # [ derive ( Debug , Clone ) ] pub enum InputEncryptedChat { inputEncryptedChat ( inputEncryptedChat ) , } 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 :: inputEncryptedChat > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = InputEncryptedChat ; fn into_boxed ( self ) -> InputEncryptedChat { InputEncryptedChat :: inputEncryptedChat ( self ) } } # [ derive ( Debug , Clone ) ] pub enum InputEncryptedFile { inputEncryptedFileEmpty , inputEncryptedFileUploaded ( inputEncryptedFileUploaded ) , inputEncryptedFile ( inputEncryptedFile ) , inputEncryptedFileBigUploaded ( inputEncryptedFileBigUploaded ) , } impl :: BoxedSerialize for InputEncryptedFile { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputEncryptedFile :: inputEncryptedFileEmpty => ( :: ConstructorNumber ( 0x1837c364 ) , & ( ) ) , & InputEncryptedFile :: inputEncryptedFileUploaded ( ref x ) => ( :: ConstructorNumber ( 0x64bd0306 ) , x ) , & InputEncryptedFile :: inputEncryptedFile ( ref x ) => ( :: ConstructorNumber ( 0x5a17b5e5 ) , x ) , & InputEncryptedFile :: inputEncryptedFileBigUploaded ( 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 :: inputEncryptedFileEmpty ) , :: ConstructorNumber ( 0x64bd0306 ) => Ok ( InputEncryptedFile :: inputEncryptedFileUploaded ( _de . read_bare :: < :: mtproto :: inputEncryptedFileUploaded > ( ) ? ) ) , :: ConstructorNumber ( 0x5a17b5e5 ) => Ok ( InputEncryptedFile :: inputEncryptedFile ( _de . read_bare :: < :: mtproto :: inputEncryptedFile > ( ) ? ) ) , :: ConstructorNumber ( 0x2dc173c8 ) => Ok ( InputEncryptedFile :: inputEncryptedFileBigUploaded ( _de . read_bare :: < :: mtproto :: inputEncryptedFileBigUploaded > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct inputEncryptedFileUploaded { pub id : :: mtproto :: long , pub parts : :: mtproto :: int , pub md5_checksum : :: mtproto :: string , pub key_fingerprint : :: mtproto :: int , } impl :: BareSerialize for inputEncryptedFileUploaded { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputEncryptedFileUploaded { 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 inputEncryptedFileUploaded { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( inputEncryptedFileUploaded { 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 inputEncryptedFileUploaded { type Boxed = InputEncryptedFile ; fn into_boxed ( self ) -> InputEncryptedFile { InputEncryptedFile :: inputEncryptedFileUploaded ( self ) } } # [ derive ( Debug , Clone ) ] 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 = InputEncryptedFile ; fn into_boxed ( self ) -> InputEncryptedFile { InputEncryptedFile :: inputEncryptedFile ( self ) } } # [ derive ( Debug , Clone ) ] pub struct inputEncryptedFileBigUploaded { pub id : :: mtproto :: long , pub parts : :: mtproto :: int , pub key_fingerprint : :: mtproto :: int , } impl :: BareSerialize for inputEncryptedFileBigUploaded { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputEncryptedFileBigUploaded { 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 inputEncryptedFileBigUploaded { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( inputEncryptedFileBigUploaded { id : _de . read_bare :: < :: mtproto :: long > ( ) ? , parts : _de . read_bare :: < :: mtproto :: int > ( ) ? , key_fingerprint : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for inputEncryptedFileBigUploaded { type Boxed = InputEncryptedFile ; fn into_boxed ( self ) -> InputEncryptedFile { InputEncryptedFile :: inputEncryptedFileBigUploaded ( self ) } } # [ derive ( Debug , Clone ) ] pub enum InputFile { inputFile ( inputFile ) , inputFileBig ( inputFileBig ) , } impl :: BoxedSerialize for InputFile { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputFile :: inputFile ( ref x ) => ( :: ConstructorNumber ( 0xf52ff27f ) , x ) , & InputFile :: inputFileBig ( 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 :: inputFile > ( ) ? ) ) , :: ConstructorNumber ( 0xfa4f0bb5 ) => Ok ( InputFile :: inputFileBig ( _de . read_bare :: < :: mtproto :: inputFileBig > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = InputFile ; fn into_boxed ( self ) -> InputFile { InputFile :: inputFile ( self ) } } # [ derive ( Debug , Clone ) ] pub struct inputFileBig { pub id : :: mtproto :: long , pub parts : :: mtproto :: int , pub name : :: mtproto :: string , } impl :: BareSerialize for inputFileBig { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputFileBig { 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 inputFileBig { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( inputFileBig { id : _de . read_bare :: < :: mtproto :: long > ( ) ? , parts : _de . read_bare :: < :: mtproto :: int > ( ) ? , name : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for inputFileBig { type Boxed = InputFile ; fn into_boxed ( self ) -> InputFile { InputFile :: inputFileBig ( self ) } } # [ derive ( Debug , Clone ) ] pub enum InputFileLocation { inputFileLocation ( inputFileLocation ) , inputEncryptedFileLocation ( inputEncryptedFileLocation ) , inputDocumentFileLocation ( inputDocumentFileLocation ) , } impl :: BoxedSerialize for InputFileLocation { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputFileLocation :: inputFileLocation ( ref x ) => ( :: ConstructorNumber ( 0x14637196 ) , x ) , & InputFileLocation :: inputEncryptedFileLocation ( ref x ) => ( :: ConstructorNumber ( 0xf5235d55 ) , x ) , & InputFileLocation :: inputDocumentFileLocation ( 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 :: inputFileLocation ( _de . read_bare :: < :: mtproto :: inputFileLocation > ( ) ? ) ) , :: ConstructorNumber ( 0xf5235d55 ) => Ok ( InputFileLocation :: inputEncryptedFileLocation ( _de . read_bare :: < :: mtproto :: inputEncryptedFileLocation > ( ) ? ) ) , :: ConstructorNumber ( 0x430f0724 ) => Ok ( InputFileLocation :: inputDocumentFileLocation ( _de . read_bare :: < :: mtproto :: inputDocumentFileLocation > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct inputFileLocation { pub volume_id : :: mtproto :: long , pub local_id : :: mtproto :: int , pub secret : :: mtproto :: long , } impl :: BareSerialize for inputFileLocation { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputFileLocation { 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 inputFileLocation { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( inputFileLocation { volume_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , local_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , secret : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for inputFileLocation { type Boxed = InputFileLocation ; fn into_boxed ( self ) -> InputFileLocation { InputFileLocation :: inputFileLocation ( self ) } } # [ derive ( Debug , Clone ) ] pub struct inputEncryptedFileLocation { pub id : :: mtproto :: long , pub access_hash : :: mtproto :: long , } impl :: BareSerialize for inputEncryptedFileLocation { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputEncryptedFileLocation { ref id , ref access_hash } = self ; _ser . write_bare :: < :: mtproto :: long > ( id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( access_hash ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for inputEncryptedFileLocation { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( inputEncryptedFileLocation { id : _de . read_bare :: < :: mtproto :: long > ( ) ? , access_hash : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for inputEncryptedFileLocation { type Boxed = InputFileLocation ; fn into_boxed ( self ) -> InputFileLocation { InputFileLocation :: inputEncryptedFileLocation ( self ) } } # [ derive ( Debug , Clone ) ] pub struct inputDocumentFileLocation { pub id : :: mtproto :: long , pub access_hash : :: mtproto :: long , pub version : :: mtproto :: int , } impl :: BareSerialize for inputDocumentFileLocation { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputDocumentFileLocation { 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 inputDocumentFileLocation { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( inputDocumentFileLocation { id : _de . read_bare :: < :: mtproto :: long > ( ) ? , access_hash : _de . read_bare :: < :: mtproto :: long > ( ) ? , version : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for inputDocumentFileLocation { type Boxed = InputFileLocation ; fn into_boxed ( self ) -> InputFileLocation { InputFileLocation :: inputDocumentFileLocation ( self ) } } # [ derive ( Debug , Clone ) ] pub enum InputGame { inputGameID ( inputGameID ) , inputGameShortName ( inputGameShortName ) , } impl :: BoxedSerialize for InputGame { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputGame :: inputGameID ( ref x ) => ( :: ConstructorNumber ( 0x032c3e77 ) , x ) , & InputGame :: inputGameShortName ( 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 :: inputGameID ( _de . read_bare :: < :: mtproto :: inputGameID > ( ) ? ) ) , :: ConstructorNumber ( 0xc331e80a ) => Ok ( InputGame :: inputGameShortName ( _de . read_bare :: < :: mtproto :: inputGameShortName > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct inputGameID { pub id : :: mtproto :: long , pub access_hash : :: mtproto :: long , } impl :: BareSerialize for inputGameID { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputGameID { ref id , ref access_hash } = self ; _ser . write_bare :: < :: mtproto :: long > ( id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( access_hash ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for inputGameID { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( inputGameID { id : _de . read_bare :: < :: mtproto :: long > ( ) ? , access_hash : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for inputGameID { type Boxed = InputGame ; fn into_boxed ( self ) -> InputGame { InputGame :: inputGameID ( self ) } } # [ derive ( Debug , Clone ) ] pub struct inputGameShortName { pub bot_id : :: mtproto :: InputUser , pub short_name : :: mtproto :: string , } impl :: BareSerialize for inputGameShortName { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputGameShortName { 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 inputGameShortName { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( inputGameShortName { bot_id : _de . read_boxed :: < :: mtproto :: InputUser > ( ) ? , short_name : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for inputGameShortName { type Boxed = InputGame ; fn into_boxed ( self ) -> InputGame { InputGame :: inputGameShortName ( self ) } } # [ derive ( Debug , Clone ) ] pub enum InputGeoPoint { inputGeoPointEmpty , inputGeoPoint ( inputGeoPoint ) , } impl :: BoxedSerialize for InputGeoPoint { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputGeoPoint :: inputGeoPointEmpty => ( :: 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 :: inputGeoPointEmpty ) , :: ConstructorNumber ( 0xf3b7acc9 ) => Ok ( InputGeoPoint :: inputGeoPoint ( _de . read_bare :: < :: mtproto :: inputGeoPoint > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = InputGeoPoint ; fn into_boxed ( self ) -> InputGeoPoint { InputGeoPoint :: inputGeoPoint ( self ) } } # [ derive ( Debug , Clone ) ] pub enum InputMedia { inputMediaEmpty , inputMediaUploadedPhoto ( inputMediaUploadedPhoto ) , inputMediaPhoto ( inputMediaPhoto ) , inputMediaGeoPoint ( inputMediaGeoPoint ) , inputMediaContact ( inputMediaContact ) , inputMediaUploadedDocument ( inputMediaUploadedDocument ) , inputMediaDocument ( inputMediaDocument ) , inputMediaVenue ( inputMediaVenue ) , inputMediaGifExternal ( inputMediaGifExternal ) , inputMediaPhotoExternal ( inputMediaPhotoExternal ) , inputMediaDocumentExternal ( inputMediaDocumentExternal ) , inputMediaGame ( inputMediaGame ) , inputMediaInvoice ( inputMediaInvoice ) , inputMediaGeoLive ( inputMediaGeoLive ) , } impl :: BoxedSerialize for InputMedia { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputMedia :: inputMediaEmpty => ( :: ConstructorNumber ( 0x9664f57f ) , & ( ) ) , & InputMedia :: inputMediaUploadedPhoto ( ref x ) => ( :: ConstructorNumber ( 0x2f37e231 ) , x ) , & InputMedia :: inputMediaPhoto ( ref x ) => ( :: ConstructorNumber ( 0x81fa373a ) , x ) , & InputMedia :: inputMediaGeoPoint ( ref x ) => ( :: ConstructorNumber ( 0xf9c44144 ) , x ) , & InputMedia :: inputMediaContact ( ref x ) => ( :: ConstructorNumber ( 0xa6e45987 ) , x ) , & InputMedia :: inputMediaUploadedDocument ( ref x ) => ( :: ConstructorNumber ( 0xe39621fd ) , x ) , & InputMedia :: inputMediaDocument ( ref x ) => ( :: ConstructorNumber ( 0x5acb668e ) , x ) , & InputMedia :: inputMediaVenue ( ref x ) => ( :: ConstructorNumber ( 0xc13d1c11 ) , x ) , & InputMedia :: inputMediaGifExternal ( ref x ) => ( :: ConstructorNumber ( 0x4843b0fd ) , x ) , & InputMedia :: inputMediaPhotoExternal ( ref x ) => ( :: ConstructorNumber ( 0x0922aec1 ) , x ) , & InputMedia :: inputMediaDocumentExternal ( ref x ) => ( :: ConstructorNumber ( 0xb6f74335 ) , x ) , & InputMedia :: inputMediaGame ( ref x ) => ( :: ConstructorNumber ( 0xd33f43f3 ) , x ) , & InputMedia :: inputMediaInvoice ( ref x ) => ( :: ConstructorNumber ( 0xf4e096c3 ) , x ) , & InputMedia :: inputMediaGeoLive ( 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 :: inputMediaEmpty ) , :: ConstructorNumber ( 0x2f37e231 ) => Ok ( InputMedia :: inputMediaUploadedPhoto ( _de . read_bare :: < :: mtproto :: inputMediaUploadedPhoto > ( ) ? ) ) , :: ConstructorNumber ( 0x81fa373a ) => Ok ( InputMedia :: inputMediaPhoto ( _de . read_bare :: < :: mtproto :: inputMediaPhoto > ( ) ? ) ) , :: ConstructorNumber ( 0xf9c44144 ) => Ok ( InputMedia :: inputMediaGeoPoint ( _de . read_bare :: < :: mtproto :: inputMediaGeoPoint > ( ) ? ) ) , :: ConstructorNumber ( 0xa6e45987 ) => Ok ( InputMedia :: inputMediaContact ( _de . read_bare :: < :: mtproto :: inputMediaContact > ( ) ? ) ) , :: ConstructorNumber ( 0xe39621fd ) => Ok ( InputMedia :: inputMediaUploadedDocument ( _de . read_bare :: < :: mtproto :: inputMediaUploadedDocument > ( ) ? ) ) , :: ConstructorNumber ( 0x5acb668e ) => Ok ( InputMedia :: inputMediaDocument ( _de . read_bare :: < :: mtproto :: inputMediaDocument > ( ) ? ) ) , :: ConstructorNumber ( 0xc13d1c11 ) => Ok ( InputMedia :: inputMediaVenue ( _de . read_bare :: < :: mtproto :: inputMediaVenue > ( ) ? ) ) , :: ConstructorNumber ( 0x4843b0fd ) => Ok ( InputMedia :: inputMediaGifExternal ( _de . read_bare :: < :: mtproto :: inputMediaGifExternal > ( ) ? ) ) , :: ConstructorNumber ( 0x0922aec1 ) => Ok ( InputMedia :: inputMediaPhotoExternal ( _de . read_bare :: < :: mtproto :: inputMediaPhotoExternal > ( ) ? ) ) , :: ConstructorNumber ( 0xb6f74335 ) => Ok ( InputMedia :: inputMediaDocumentExternal ( _de . read_bare :: < :: mtproto :: inputMediaDocumentExternal > ( ) ? ) ) , :: ConstructorNumber ( 0xd33f43f3 ) => Ok ( InputMedia :: inputMediaGame ( _de . read_bare :: < :: mtproto :: inputMediaGame > ( ) ? ) ) , :: ConstructorNumber ( 0xf4e096c3 ) => Ok ( InputMedia :: inputMediaInvoice ( _de . read_bare :: < :: mtproto :: inputMediaInvoice > ( ) ? ) ) , :: ConstructorNumber ( 0x7b1a118f ) => Ok ( InputMedia :: inputMediaGeoLive ( _de . read_bare :: < :: mtproto :: inputMediaGeoLive > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct inputMediaUploadedPhoto { 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 inputMediaUploadedPhoto { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputMediaUploadedPhoto { 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 inputMediaUploadedPhoto { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( inputMediaUploadedPhoto { 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 inputMediaUploadedPhoto { type Boxed = InputMedia ; fn into_boxed ( self ) -> InputMedia { InputMedia :: inputMediaUploadedPhoto ( self ) } } # [ derive ( Debug , Clone ) ] pub struct inputMediaPhoto { pub id : :: mtproto :: InputPhoto , pub caption : :: mtproto :: string , pub ttl_seconds : Option < :: mtproto :: int > , } impl :: BareSerialize for inputMediaPhoto { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputMediaPhoto { 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 inputMediaPhoto { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( inputMediaPhoto { 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 inputMediaPhoto { type Boxed = InputMedia ; fn into_boxed ( self ) -> InputMedia { InputMedia :: inputMediaPhoto ( self ) } } # [ derive ( Debug , Clone ) ] pub struct inputMediaGeoPoint { pub geo_point : :: mtproto :: InputGeoPoint , } impl :: BareSerialize for inputMediaGeoPoint { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputMediaGeoPoint { ref geo_point } = self ; _ser . write_boxed :: < :: mtproto :: InputGeoPoint > ( geo_point ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for inputMediaGeoPoint { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( inputMediaGeoPoint { geo_point : _de . read_boxed :: < :: mtproto :: InputGeoPoint > ( ) ? , } ) } } impl :: IntoBoxed for inputMediaGeoPoint { type Boxed = InputMedia ; fn into_boxed ( self ) -> InputMedia { InputMedia :: inputMediaGeoPoint ( self ) } } # [ derive ( Debug , Clone ) ] pub struct inputMediaContact { pub phone_number : :: mtproto :: string , pub first_name : :: mtproto :: string , pub last_name : :: mtproto :: string , } impl :: BareSerialize for inputMediaContact { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputMediaContact { 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 inputMediaContact { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( inputMediaContact { phone_number : _de . read_bare :: < :: mtproto :: string > ( ) ? , first_name : _de . read_bare :: < :: mtproto :: string > ( ) ? , last_name : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for inputMediaContact { type Boxed = InputMedia ; fn into_boxed ( self ) -> InputMedia { InputMedia :: inputMediaContact ( self ) } } # [ derive ( Debug , Clone ) ] pub struct inputMediaUploadedDocument { 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 inputMediaUploadedDocument { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputMediaUploadedDocument { 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 inputMediaUploadedDocument { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( inputMediaUploadedDocument { 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 inputMediaUploadedDocument { type Boxed = InputMedia ; fn into_boxed ( self ) -> InputMedia { InputMedia :: inputMediaUploadedDocument ( self ) } } # [ derive ( Debug , Clone ) ] pub struct inputMediaDocument { pub id : :: mtproto :: InputDocument , pub caption : :: mtproto :: string , pub ttl_seconds : Option < :: mtproto :: int > , } impl :: BareSerialize for inputMediaDocument { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputMediaDocument { 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 inputMediaDocument { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( inputMediaDocument { 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 inputMediaDocument { type Boxed = InputMedia ; fn into_boxed ( self ) -> InputMedia { InputMedia :: inputMediaDocument ( self ) } } # [ derive ( Debug , Clone ) ] pub struct inputMediaVenue { 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 inputMediaVenue { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputMediaVenue { 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 inputMediaVenue { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( inputMediaVenue { 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 inputMediaVenue { type Boxed = InputMedia ; fn into_boxed ( self ) -> InputMedia { InputMedia :: inputMediaVenue ( self ) } } # [ derive ( Debug , Clone ) ] pub struct inputMediaGifExternal { pub url : :: mtproto :: string , pub q : :: mtproto :: string , } impl :: BareSerialize for inputMediaGifExternal { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputMediaGifExternal { ref url , ref q } = self ; _ser . write_bare :: < :: mtproto :: string > ( url ) ? ; _ser . write_bare :: < :: mtproto :: string > ( q ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for inputMediaGifExternal { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( inputMediaGifExternal { url : _de . read_bare :: < :: mtproto :: string > ( ) ? , q : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for inputMediaGifExternal { type Boxed = InputMedia ; fn into_boxed ( self ) -> InputMedia { InputMedia :: inputMediaGifExternal ( self ) } } # [ derive ( Debug , Clone ) ] pub struct inputMediaPhotoExternal { pub url : :: mtproto :: string , pub caption : :: mtproto :: string , pub ttl_seconds : Option < :: mtproto :: int > , } impl :: BareSerialize for inputMediaPhotoExternal { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputMediaPhotoExternal { 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 inputMediaPhotoExternal { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( inputMediaPhotoExternal { 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 inputMediaPhotoExternal { type Boxed = InputMedia ; fn into_boxed ( self ) -> InputMedia { InputMedia :: inputMediaPhotoExternal ( self ) } } # [ derive ( Debug , Clone ) ] pub struct inputMediaDocumentExternal { pub url : :: mtproto :: string , pub caption : :: mtproto :: string , pub ttl_seconds : Option < :: mtproto :: int > , } impl :: BareSerialize for inputMediaDocumentExternal { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputMediaDocumentExternal { 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 inputMediaDocumentExternal { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( inputMediaDocumentExternal { 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 inputMediaDocumentExternal { type Boxed = InputMedia ; fn into_boxed ( self ) -> InputMedia { InputMedia :: inputMediaDocumentExternal ( self ) } } # [ derive ( Debug , Clone ) ] pub struct inputMediaGame { pub id : :: mtproto :: InputGame , } impl :: BareSerialize for inputMediaGame { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputMediaGame { ref id } = self ; _ser . write_boxed :: < :: mtproto :: InputGame > ( id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for inputMediaGame { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( inputMediaGame { id : _de . read_boxed :: < :: mtproto :: InputGame > ( ) ? , } ) } } impl :: IntoBoxed for inputMediaGame { type Boxed = InputMedia ; fn into_boxed ( self ) -> InputMedia { InputMedia :: inputMediaGame ( self ) } } # [ derive ( Debug , Clone ) ] pub struct inputMediaInvoice { 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 inputMediaInvoice { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputMediaInvoice { 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 inputMediaInvoice { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( inputMediaInvoice { 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 inputMediaInvoice { type Boxed = InputMedia ; fn into_boxed ( self ) -> InputMedia { InputMedia :: inputMediaInvoice ( self ) } } # [ derive ( Debug , Clone ) ] pub struct inputMediaGeoLive { pub geo_point : :: mtproto :: InputGeoPoint , pub period : :: mtproto :: int , } impl :: BareSerialize for inputMediaGeoLive { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputMediaGeoLive { ref geo_point , ref period } = self ; _ser . write_boxed :: < :: mtproto :: InputGeoPoint > ( geo_point ) ? ; _ser . write_bare :: < :: mtproto :: int > ( period ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for inputMediaGeoLive { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( inputMediaGeoLive { geo_point : _de . read_boxed :: < :: mtproto :: InputGeoPoint > ( ) ? , period : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for inputMediaGeoLive { type Boxed = InputMedia ; fn into_boxed ( self ) -> InputMedia { InputMedia :: inputMediaGeoLive ( self ) } } # [ derive ( Debug , Clone ) ] pub enum InputNotifyPeer { inputNotifyPeer ( inputNotifyPeer ) , inputNotifyUsers , inputNotifyChats , inputNotifyAll , } impl :: BoxedSerialize for InputNotifyPeer { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputNotifyPeer :: inputNotifyPeer ( ref x ) => ( :: ConstructorNumber ( 0xb8bc5b0c ) , x ) , & InputNotifyPeer :: inputNotifyUsers => ( :: ConstructorNumber ( 0x193b4417 ) , & ( ) ) , & InputNotifyPeer :: inputNotifyChats => ( :: ConstructorNumber ( 0x4a95e84e ) , & ( ) ) , & InputNotifyPeer :: inputNotifyAll => ( :: 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 :: inputNotifyPeer ( _de . read_bare :: < :: mtproto :: inputNotifyPeer > ( ) ? ) ) , :: ConstructorNumber ( 0x193b4417 ) => Ok ( InputNotifyPeer :: inputNotifyUsers ) , :: ConstructorNumber ( 0x4a95e84e ) => Ok ( InputNotifyPeer :: inputNotifyChats ) , :: ConstructorNumber ( 0xa429b886 ) => Ok ( InputNotifyPeer :: inputNotifyAll ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct inputNotifyPeer { pub peer : :: mtproto :: InputPeer , } impl :: BareSerialize for inputNotifyPeer { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputNotifyPeer { ref peer } = self ; _ser . write_boxed :: < :: mtproto :: InputPeer > ( peer ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for inputNotifyPeer { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( inputNotifyPeer { peer : _de . read_boxed :: < :: mtproto :: InputPeer > ( ) ? , } ) } } impl :: IntoBoxed for inputNotifyPeer { type Boxed = InputNotifyPeer ; fn into_boxed ( self ) -> InputNotifyPeer { InputNotifyPeer :: inputNotifyPeer ( self ) } } # [ derive ( Debug , Clone ) ] pub enum InputPaymentCredentials { inputPaymentCredentialsSaved ( inputPaymentCredentialsSaved ) , inputPaymentCredentials ( inputPaymentCredentials ) , inputPaymentCredentialsApplePay ( inputPaymentCredentialsApplePay ) , inputPaymentCredentialsAndroidPay ( inputPaymentCredentialsAndroidPay ) , } impl :: BoxedSerialize for InputPaymentCredentials { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputPaymentCredentials :: inputPaymentCredentialsSaved ( ref x ) => ( :: ConstructorNumber ( 0xc10eb2cf ) , x ) , & InputPaymentCredentials :: inputPaymentCredentials ( ref x ) => ( :: ConstructorNumber ( 0x3417d728 ) , x ) , & InputPaymentCredentials :: inputPaymentCredentialsApplePay ( ref x ) => ( :: ConstructorNumber ( 0x0aa1c39f ) , x ) , & InputPaymentCredentials :: inputPaymentCredentialsAndroidPay ( 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 :: inputPaymentCredentialsSaved ( _de . read_bare :: < :: mtproto :: inputPaymentCredentialsSaved > ( ) ? ) ) , :: ConstructorNumber ( 0x3417d728 ) => Ok ( InputPaymentCredentials :: inputPaymentCredentials ( _de . read_bare :: < :: mtproto :: inputPaymentCredentials > ( ) ? ) ) , :: ConstructorNumber ( 0x0aa1c39f ) => Ok ( InputPaymentCredentials :: inputPaymentCredentialsApplePay ( _de . read_bare :: < :: mtproto :: inputPaymentCredentialsApplePay > ( ) ? ) ) , :: ConstructorNumber ( 0x795667a6 ) => Ok ( InputPaymentCredentials :: inputPaymentCredentialsAndroidPay ( _de . read_bare :: < :: mtproto :: inputPaymentCredentialsAndroidPay > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct inputPaymentCredentialsSaved { pub id : :: mtproto :: string , pub tmp_password : :: mtproto :: bytes , } impl :: BareSerialize for inputPaymentCredentialsSaved { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputPaymentCredentialsSaved { ref id , ref tmp_password } = self ; _ser . write_bare :: < :: mtproto :: string > ( id ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( tmp_password ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for inputPaymentCredentialsSaved { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( inputPaymentCredentialsSaved { id : _de . read_bare :: < :: mtproto :: string > ( ) ? , tmp_password : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , } ) } } impl :: IntoBoxed for inputPaymentCredentialsSaved { type Boxed = InputPaymentCredentials ; fn into_boxed ( self ) -> InputPaymentCredentials { InputPaymentCredentials :: inputPaymentCredentialsSaved ( self ) } } # [ derive ( Debug , Clone ) ] 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 = InputPaymentCredentials ; fn into_boxed ( self ) -> InputPaymentCredentials { InputPaymentCredentials :: inputPaymentCredentials ( self ) } } # [ derive ( Debug , Clone ) ] pub struct inputPaymentCredentialsApplePay { pub payment_data : :: mtproto :: DataJSON , } impl :: BareSerialize for inputPaymentCredentialsApplePay { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputPaymentCredentialsApplePay { ref payment_data } = self ; _ser . write_boxed :: < :: mtproto :: DataJSON > ( payment_data ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for inputPaymentCredentialsApplePay { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( inputPaymentCredentialsApplePay { payment_data : _de . read_boxed :: < :: mtproto :: DataJSON > ( ) ? , } ) } } impl :: IntoBoxed for inputPaymentCredentialsApplePay { type Boxed = InputPaymentCredentials ; fn into_boxed ( self ) -> InputPaymentCredentials { InputPaymentCredentials :: inputPaymentCredentialsApplePay ( self ) } } # [ derive ( Debug , Clone ) ] pub struct inputPaymentCredentialsAndroidPay { pub payment_token : :: mtproto :: DataJSON , } impl :: BareSerialize for inputPaymentCredentialsAndroidPay { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputPaymentCredentialsAndroidPay { ref payment_token } = self ; _ser . write_boxed :: < :: mtproto :: DataJSON > ( payment_token ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for inputPaymentCredentialsAndroidPay { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( inputPaymentCredentialsAndroidPay { payment_token : _de . read_boxed :: < :: mtproto :: DataJSON > ( ) ? , } ) } } impl :: IntoBoxed for inputPaymentCredentialsAndroidPay { type Boxed = InputPaymentCredentials ; fn into_boxed ( self ) -> InputPaymentCredentials { InputPaymentCredentials :: inputPaymentCredentialsAndroidPay ( self ) } } # [ derive ( Debug , Clone ) ] pub enum InputPeer { inputPeerEmpty , inputPeerSelf , inputPeerChat ( inputPeerChat ) , inputPeerUser ( inputPeerUser ) , inputPeerChannel ( inputPeerChannel ) , } impl :: BoxedSerialize for InputPeer { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputPeer :: inputPeerEmpty => ( :: ConstructorNumber ( 0x7f3b18ea ) , & ( ) ) , & InputPeer :: inputPeerSelf => ( :: ConstructorNumber ( 0x7da07ec9 ) , & ( ) ) , & InputPeer :: inputPeerChat ( ref x ) => ( :: ConstructorNumber ( 0x179be863 ) , x ) , & InputPeer :: inputPeerUser ( ref x ) => ( :: ConstructorNumber ( 0x7b8e7de6 ) , x ) , & InputPeer :: inputPeerChannel ( 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 :: inputPeerEmpty ) , :: ConstructorNumber ( 0x7da07ec9 ) => Ok ( InputPeer :: inputPeerSelf ) , :: ConstructorNumber ( 0x179be863 ) => Ok ( InputPeer :: inputPeerChat ( _de . read_bare :: < :: mtproto :: inputPeerChat > ( ) ? ) ) , :: ConstructorNumber ( 0x7b8e7de6 ) => Ok ( InputPeer :: inputPeerUser ( _de . read_bare :: < :: mtproto :: inputPeerUser > ( ) ? ) ) , :: ConstructorNumber ( 0x20adaef8 ) => Ok ( InputPeer :: inputPeerChannel ( _de . read_bare :: < :: mtproto :: inputPeerChannel > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct inputPeerChat { pub chat_id : :: mtproto :: int , } impl :: BareSerialize for inputPeerChat { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputPeerChat { ref chat_id } = self ; _ser . write_bare :: < :: mtproto :: int > ( chat_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for inputPeerChat { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( inputPeerChat { chat_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for inputPeerChat { type Boxed = InputPeer ; fn into_boxed ( self ) -> InputPeer { InputPeer :: inputPeerChat ( self ) } } # [ derive ( Debug , Clone ) ] pub struct inputPeerUser { pub user_id : :: mtproto :: int , pub access_hash : :: mtproto :: long , } impl :: BareSerialize for inputPeerUser { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputPeerUser { 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 inputPeerUser { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( inputPeerUser { user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , access_hash : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for inputPeerUser { type Boxed = InputPeer ; fn into_boxed ( self ) -> InputPeer { InputPeer :: inputPeerUser ( self ) } } # [ derive ( Debug , Clone ) ] pub struct inputPeerChannel { pub channel_id : :: mtproto :: int , pub access_hash : :: mtproto :: long , } impl :: BareSerialize for inputPeerChannel { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputPeerChannel { 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 inputPeerChannel { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( inputPeerChannel { channel_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , access_hash : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for inputPeerChannel { type Boxed = InputPeer ; fn into_boxed ( self ) -> InputPeer { InputPeer :: inputPeerChannel ( self ) } } # [ derive ( Debug , Clone ) ] pub enum InputPeerNotifyEvents { inputPeerNotifyEventsEmpty , inputPeerNotifyEventsAll , } impl :: BoxedSerialize for InputPeerNotifyEvents { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputPeerNotifyEvents :: inputPeerNotifyEventsEmpty => ( :: ConstructorNumber ( 0xf03064d8 ) , & ( ) ) , & InputPeerNotifyEvents :: inputPeerNotifyEventsAll => ( :: 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 :: inputPeerNotifyEventsEmpty ) , :: ConstructorNumber ( 0xe86a2c74 ) => Ok ( InputPeerNotifyEvents :: inputPeerNotifyEventsAll ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub enum InputPeerNotifySettings { inputPeerNotifySettings ( inputPeerNotifySettings ) , } 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 :: inputPeerNotifySettings > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = InputPeerNotifySettings ; fn into_boxed ( self ) -> InputPeerNotifySettings { InputPeerNotifySettings :: inputPeerNotifySettings ( self ) } } # [ derive ( Debug , Clone ) ] pub enum InputPhoneCall { inputPhoneCall ( inputPhoneCall ) , } 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 :: inputPhoneCall > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = InputPhoneCall ; fn into_boxed ( self ) -> InputPhoneCall { InputPhoneCall :: inputPhoneCall ( self ) } } # [ derive ( Debug , Clone ) ] pub enum InputPhoto { inputPhotoEmpty , inputPhoto ( inputPhoto ) , } impl :: BoxedSerialize for InputPhoto { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputPhoto :: inputPhotoEmpty => ( :: 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 :: inputPhotoEmpty ) , :: ConstructorNumber ( 0xfb95c6c4 ) => Ok ( InputPhoto :: inputPhoto ( _de . read_bare :: < :: mtproto :: inputPhoto > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = InputPhoto ; fn into_boxed ( self ) -> InputPhoto { InputPhoto :: inputPhoto ( self ) } } # [ derive ( Debug , Clone ) ] pub enum InputPrivacyKey { inputPrivacyKeyStatusTimestamp , inputPrivacyKeyChatInvite , inputPrivacyKeyPhoneCall , } impl :: BoxedSerialize for InputPrivacyKey { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputPrivacyKey :: inputPrivacyKeyStatusTimestamp => ( :: ConstructorNumber ( 0x4f96cb18 ) , & ( ) ) , & InputPrivacyKey :: inputPrivacyKeyChatInvite => ( :: ConstructorNumber ( 0xbdfb0426 ) , & ( ) ) , & InputPrivacyKey :: inputPrivacyKeyPhoneCall => ( :: 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 :: inputPrivacyKeyStatusTimestamp ) , :: ConstructorNumber ( 0xbdfb0426 ) => Ok ( InputPrivacyKey :: inputPrivacyKeyChatInvite ) , :: ConstructorNumber ( 0xfabadc5f ) => Ok ( InputPrivacyKey :: inputPrivacyKeyPhoneCall ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub enum InputPrivacyRule { inputPrivacyValueAllowContacts , inputPrivacyValueAllowAll , inputPrivacyValueAllowUsers ( inputPrivacyValueAllowUsers ) , inputPrivacyValueDisallowContacts , inputPrivacyValueDisallowAll , inputPrivacyValueDisallowUsers ( inputPrivacyValueDisallowUsers ) , } impl :: BoxedSerialize for InputPrivacyRule { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputPrivacyRule :: inputPrivacyValueAllowContacts => ( :: ConstructorNumber ( 0x0d09e07b ) , & ( ) ) , & InputPrivacyRule :: inputPrivacyValueAllowAll => ( :: ConstructorNumber ( 0x184b35ce ) , & ( ) ) , & InputPrivacyRule :: inputPrivacyValueAllowUsers ( ref x ) => ( :: ConstructorNumber ( 0x131cc67f ) , x ) , & InputPrivacyRule :: inputPrivacyValueDisallowContacts => ( :: ConstructorNumber ( 0x0ba52007 ) , & ( ) ) , & InputPrivacyRule :: inputPrivacyValueDisallowAll => ( :: ConstructorNumber ( 0xd66b66c9 ) , & ( ) ) , & InputPrivacyRule :: inputPrivacyValueDisallowUsers ( 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 :: inputPrivacyValueAllowContacts ) , :: ConstructorNumber ( 0x184b35ce ) => Ok ( InputPrivacyRule :: inputPrivacyValueAllowAll ) , :: ConstructorNumber ( 0x131cc67f ) => Ok ( InputPrivacyRule :: inputPrivacyValueAllowUsers ( _de . read_bare :: < :: mtproto :: inputPrivacyValueAllowUsers > ( ) ? ) ) , :: ConstructorNumber ( 0x0ba52007 ) => Ok ( InputPrivacyRule :: inputPrivacyValueDisallowContacts ) , :: ConstructorNumber ( 0xd66b66c9 ) => Ok ( InputPrivacyRule :: inputPrivacyValueDisallowAll ) , :: ConstructorNumber ( 0x90110467 ) => Ok ( InputPrivacyRule :: inputPrivacyValueDisallowUsers ( _de . read_bare :: < :: mtproto :: inputPrivacyValueDisallowUsers > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct inputPrivacyValueAllowUsers { pub users : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputUser > , } impl :: BareSerialize for inputPrivacyValueAllowUsers { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputPrivacyValueAllowUsers { ref users } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputUser > > ( users ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for inputPrivacyValueAllowUsers { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( inputPrivacyValueAllowUsers { users : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputUser > > ( ) ? , } ) } } impl :: IntoBoxed for inputPrivacyValueAllowUsers { type Boxed = InputPrivacyRule ; fn into_boxed ( self ) -> InputPrivacyRule { InputPrivacyRule :: inputPrivacyValueAllowUsers ( self ) } } # [ derive ( Debug , Clone ) ] pub struct inputPrivacyValueDisallowUsers { pub users : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputUser > , } impl :: BareSerialize for inputPrivacyValueDisallowUsers { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputPrivacyValueDisallowUsers { ref users } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputUser > > ( users ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for inputPrivacyValueDisallowUsers { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( inputPrivacyValueDisallowUsers { users : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputUser > > ( ) ? , } ) } } impl :: IntoBoxed for inputPrivacyValueDisallowUsers { type Boxed = InputPrivacyRule ; fn into_boxed ( self ) -> InputPrivacyRule { InputPrivacyRule :: inputPrivacyValueDisallowUsers ( self ) } } # [ derive ( Debug , Clone ) ] pub enum InputSingleMedia { inputSingleMedia ( inputSingleMedia ) , } 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 :: inputSingleMedia > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = InputSingleMedia ; fn into_boxed ( self ) -> InputSingleMedia { InputSingleMedia :: inputSingleMedia ( self ) } } # [ derive ( Debug , Clone ) ] pub enum InputStickerSet { inputStickerSetEmpty , inputStickerSetID ( inputStickerSetID ) , inputStickerSetShortName ( inputStickerSetShortName ) , } impl :: BoxedSerialize for InputStickerSet { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputStickerSet :: inputStickerSetEmpty => ( :: ConstructorNumber ( 0xffb62b95 ) , & ( ) ) , & InputStickerSet :: inputStickerSetID ( ref x ) => ( :: ConstructorNumber ( 0x9de7a269 ) , x ) , & InputStickerSet :: inputStickerSetShortName ( 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 :: inputStickerSetEmpty ) , :: ConstructorNumber ( 0x9de7a269 ) => Ok ( InputStickerSet :: inputStickerSetID ( _de . read_bare :: < :: mtproto :: inputStickerSetID > ( ) ? ) ) , :: ConstructorNumber ( 0x861cc8a0 ) => Ok ( InputStickerSet :: inputStickerSetShortName ( _de . read_bare :: < :: mtproto :: inputStickerSetShortName > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct inputStickerSetID { pub id : :: mtproto :: long , pub access_hash : :: mtproto :: long , } impl :: BareSerialize for inputStickerSetID { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputStickerSetID { ref id , ref access_hash } = self ; _ser . write_bare :: < :: mtproto :: long > ( id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( access_hash ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for inputStickerSetID { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( inputStickerSetID { id : _de . read_bare :: < :: mtproto :: long > ( ) ? , access_hash : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for inputStickerSetID { type Boxed = InputStickerSet ; fn into_boxed ( self ) -> InputStickerSet { InputStickerSet :: inputStickerSetID ( self ) } } # [ derive ( Debug , Clone ) ] pub struct inputStickerSetShortName { pub short_name : :: mtproto :: string , } impl :: BareSerialize for inputStickerSetShortName { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputStickerSetShortName { ref short_name } = self ; _ser . write_bare :: < :: mtproto :: string > ( short_name ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for inputStickerSetShortName { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( inputStickerSetShortName { short_name : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for inputStickerSetShortName { type Boxed = InputStickerSet ; fn into_boxed ( self ) -> InputStickerSet { InputStickerSet :: inputStickerSetShortName ( self ) } } # [ derive ( Debug , Clone ) ] pub enum InputStickerSetItem { inputStickerSetItem ( inputStickerSetItem ) , } 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 :: inputStickerSetItem > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = InputStickerSetItem ; fn into_boxed ( self ) -> InputStickerSetItem { InputStickerSetItem :: inputStickerSetItem ( self ) } } # [ derive ( Debug , Clone ) ] pub enum InputStickeredMedia { inputStickeredMediaPhoto ( inputStickeredMediaPhoto ) , inputStickeredMediaDocument ( inputStickeredMediaDocument ) , } impl :: BoxedSerialize for InputStickeredMedia { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputStickeredMedia :: inputStickeredMediaPhoto ( ref x ) => ( :: ConstructorNumber ( 0x4a992157 ) , x ) , & InputStickeredMedia :: inputStickeredMediaDocument ( 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 :: inputStickeredMediaPhoto ( _de . read_bare :: < :: mtproto :: inputStickeredMediaPhoto > ( ) ? ) ) , :: ConstructorNumber ( 0x0438865b ) => Ok ( InputStickeredMedia :: inputStickeredMediaDocument ( _de . read_bare :: < :: mtproto :: inputStickeredMediaDocument > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct inputStickeredMediaPhoto { pub id : :: mtproto :: InputPhoto , } impl :: BareSerialize for inputStickeredMediaPhoto { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputStickeredMediaPhoto { ref id } = self ; _ser . write_boxed :: < :: mtproto :: InputPhoto > ( id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for inputStickeredMediaPhoto { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( inputStickeredMediaPhoto { id : _de . read_boxed :: < :: mtproto :: InputPhoto > ( ) ? , } ) } } impl :: IntoBoxed for inputStickeredMediaPhoto { type Boxed = InputStickeredMedia ; fn into_boxed ( self ) -> InputStickeredMedia { InputStickeredMedia :: inputStickeredMediaPhoto ( self ) } } # [ derive ( Debug , Clone ) ] pub struct inputStickeredMediaDocument { pub id : :: mtproto :: InputDocument , } impl :: BareSerialize for inputStickeredMediaDocument { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputStickeredMediaDocument { ref id } = self ; _ser . write_boxed :: < :: mtproto :: InputDocument > ( id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for inputStickeredMediaDocument { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( inputStickeredMediaDocument { id : _de . read_boxed :: < :: mtproto :: InputDocument > ( ) ? , } ) } } impl :: IntoBoxed for inputStickeredMediaDocument { type Boxed = InputStickeredMedia ; fn into_boxed ( self ) -> InputStickeredMedia { InputStickeredMedia :: inputStickeredMediaDocument ( self ) } } # [ derive ( Debug , Clone ) ] pub enum InputUser { inputUserEmpty , inputUserSelf , inputUser ( inputUser ) , } impl :: BoxedSerialize for InputUser { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & InputUser :: inputUserEmpty => ( :: ConstructorNumber ( 0xb98886cf ) , & ( ) ) , & InputUser :: inputUserSelf => ( :: 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 :: inputUserEmpty ) , :: ConstructorNumber ( 0xf7c1b13f ) => Ok ( InputUser :: inputUserSelf ) , :: ConstructorNumber ( 0xd8292816 ) => Ok ( InputUser :: inputUser ( _de . read_bare :: < :: mtproto :: inputUser > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = InputUser ; fn into_boxed ( self ) -> InputUser { InputUser :: inputUser ( self ) } } # [ derive ( Debug , Clone ) ] pub enum InputWebDocument { inputWebDocument ( inputWebDocument ) , } 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 :: inputWebDocument > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = InputWebDocument ; fn into_boxed ( self ) -> InputWebDocument { InputWebDocument :: inputWebDocument ( self ) } } # [ derive ( Debug , Clone ) ] pub enum InputWebFileLocation { inputWebFileLocation ( inputWebFileLocation ) , } 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 :: inputWebFileLocation > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = InputWebFileLocation ; fn into_boxed ( self ) -> InputWebFileLocation { InputWebFileLocation :: inputWebFileLocation ( self ) } } # [ derive ( Debug , Clone ) ] pub enum Invoice { invoice ( invoice ) , } 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 > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = Invoice ; fn into_boxed ( self ) -> Invoice { Invoice :: invoice ( self ) } } # [ derive ( Debug , Clone ) ] 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 > ( ) ? , } ) } } # [ derive ( Debug , Clone ) ] pub enum KeyboardButton { keyboardButton ( keyboardButton ) , keyboardButtonUrl ( keyboardButtonUrl ) , keyboardButtonCallback ( keyboardButtonCallback ) , keyboardButtonRequestPhone ( keyboardButtonRequestPhone ) , keyboardButtonRequestGeoLocation ( keyboardButtonRequestGeoLocation ) , keyboardButtonSwitchInline ( keyboardButtonSwitchInline ) , keyboardButtonGame ( keyboardButtonGame ) , keyboardButtonBuy ( keyboardButtonBuy ) , } impl :: BoxedSerialize for KeyboardButton { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & KeyboardButton :: keyboardButton ( ref x ) => ( :: ConstructorNumber ( 0xa2fa4880 ) , x ) , & KeyboardButton :: keyboardButtonUrl ( ref x ) => ( :: ConstructorNumber ( 0x258aff05 ) , x ) , & KeyboardButton :: keyboardButtonCallback ( ref x ) => ( :: ConstructorNumber ( 0x683a5e46 ) , x ) , & KeyboardButton :: keyboardButtonRequestPhone ( ref x ) => ( :: ConstructorNumber ( 0xb16a6c29 ) , x ) , & KeyboardButton :: keyboardButtonRequestGeoLocation ( ref x ) => ( :: ConstructorNumber ( 0xfc796b3f ) , x ) , & KeyboardButton :: keyboardButtonSwitchInline ( ref x ) => ( :: ConstructorNumber ( 0x0568a748 ) , x ) , & KeyboardButton :: keyboardButtonGame ( ref x ) => ( :: ConstructorNumber ( 0x50f41ccf ) , x ) , & KeyboardButton :: keyboardButtonBuy ( 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 :: keyboardButton > ( ) ? ) ) , :: ConstructorNumber ( 0x258aff05 ) => Ok ( KeyboardButton :: keyboardButtonUrl ( _de . read_bare :: < :: mtproto :: keyboardButtonUrl > ( ) ? ) ) , :: ConstructorNumber ( 0x683a5e46 ) => Ok ( KeyboardButton :: keyboardButtonCallback ( _de . read_bare :: < :: mtproto :: keyboardButtonCallback > ( ) ? ) ) , :: ConstructorNumber ( 0xb16a6c29 ) => Ok ( KeyboardButton :: keyboardButtonRequestPhone ( _de . read_bare :: < :: mtproto :: keyboardButtonRequestPhone > ( ) ? ) ) , :: ConstructorNumber ( 0xfc796b3f ) => Ok ( KeyboardButton :: keyboardButtonRequestGeoLocation ( _de . read_bare :: < :: mtproto :: keyboardButtonRequestGeoLocation > ( ) ? ) ) , :: ConstructorNumber ( 0x0568a748 ) => Ok ( KeyboardButton :: keyboardButtonSwitchInline ( _de . read_bare :: < :: mtproto :: keyboardButtonSwitchInline > ( ) ? ) ) , :: ConstructorNumber ( 0x50f41ccf ) => Ok ( KeyboardButton :: keyboardButtonGame ( _de . read_bare :: < :: mtproto :: keyboardButtonGame > ( ) ? ) ) , :: ConstructorNumber ( 0xafd93fbb ) => Ok ( KeyboardButton :: keyboardButtonBuy ( _de . read_bare :: < :: mtproto :: keyboardButtonBuy > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = KeyboardButton ; fn into_boxed ( self ) -> KeyboardButton { KeyboardButton :: keyboardButton ( self ) } } # [ derive ( Debug , Clone ) ] pub struct keyboardButtonUrl { pub text : :: mtproto :: string , pub url : :: mtproto :: string , } impl :: BareSerialize for keyboardButtonUrl { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & keyboardButtonUrl { ref text , ref url } = self ; _ser . write_bare :: < :: mtproto :: string > ( text ) ? ; _ser . write_bare :: < :: mtproto :: string > ( url ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for keyboardButtonUrl { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( keyboardButtonUrl { text : _de . read_bare :: < :: mtproto :: string > ( ) ? , url : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for keyboardButtonUrl { type Boxed = KeyboardButton ; fn into_boxed ( self ) -> KeyboardButton { KeyboardButton :: keyboardButtonUrl ( self ) } } # [ derive ( Debug , Clone ) ] pub struct keyboardButtonCallback { pub text : :: mtproto :: string , pub data : :: mtproto :: bytes , } impl :: BareSerialize for keyboardButtonCallback { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & keyboardButtonCallback { ref text , ref data } = self ; _ser . write_bare :: < :: mtproto :: string > ( text ) ? ; _ser . write_bare :: < :: mtproto :: bytes > ( data ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for keyboardButtonCallback { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( keyboardButtonCallback { text : _de . read_bare :: < :: mtproto :: string > ( ) ? , data : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , } ) } } impl :: IntoBoxed for keyboardButtonCallback { type Boxed = KeyboardButton ; fn into_boxed ( self ) -> KeyboardButton { KeyboardButton :: keyboardButtonCallback ( self ) } } # [ derive ( Debug , Clone ) ] pub struct keyboardButtonRequestPhone { pub text : :: mtproto :: string , } impl :: BareSerialize for keyboardButtonRequestPhone { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & keyboardButtonRequestPhone { ref text } = self ; _ser . write_bare :: < :: mtproto :: string > ( text ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for keyboardButtonRequestPhone { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( keyboardButtonRequestPhone { text : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for keyboardButtonRequestPhone { type Boxed = KeyboardButton ; fn into_boxed ( self ) -> KeyboardButton { KeyboardButton :: keyboardButtonRequestPhone ( self ) } } # [ derive ( Debug , Clone ) ] pub struct keyboardButtonRequestGeoLocation { pub text : :: mtproto :: string , } impl :: BareSerialize for keyboardButtonRequestGeoLocation { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & keyboardButtonRequestGeoLocation { ref text } = self ; _ser . write_bare :: < :: mtproto :: string > ( text ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for keyboardButtonRequestGeoLocation { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( keyboardButtonRequestGeoLocation { text : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for keyboardButtonRequestGeoLocation { type Boxed = KeyboardButton ; fn into_boxed ( self ) -> KeyboardButton { KeyboardButton :: keyboardButtonRequestGeoLocation ( self ) } } # [ derive ( Debug , Clone ) ] pub struct keyboardButtonSwitchInline { pub same_peer : bool , pub text : :: mtproto :: string , pub query : :: mtproto :: string , } impl :: BareSerialize for keyboardButtonSwitchInline { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & keyboardButtonSwitchInline { 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 keyboardButtonSwitchInline { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( keyboardButtonSwitchInline { 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 keyboardButtonSwitchInline { type Boxed = KeyboardButton ; fn into_boxed ( self ) -> KeyboardButton { KeyboardButton :: keyboardButtonSwitchInline ( self ) } } # [ derive ( Debug , Clone ) ] pub struct keyboardButtonGame { pub text : :: mtproto :: string , } impl :: BareSerialize for keyboardButtonGame { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & keyboardButtonGame { ref text } = self ; _ser . write_bare :: < :: mtproto :: string > ( text ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for keyboardButtonGame { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( keyboardButtonGame { text : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for keyboardButtonGame { type Boxed = KeyboardButton ; fn into_boxed ( self ) -> KeyboardButton { KeyboardButton :: keyboardButtonGame ( self ) } } # [ derive ( Debug , Clone ) ] pub struct keyboardButtonBuy { pub text : :: mtproto :: string , } impl :: BareSerialize for keyboardButtonBuy { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & keyboardButtonBuy { ref text } = self ; _ser . write_bare :: < :: mtproto :: string > ( text ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for keyboardButtonBuy { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( keyboardButtonBuy { text : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for keyboardButtonBuy { type Boxed = KeyboardButton ; fn into_boxed ( self ) -> KeyboardButton { KeyboardButton :: keyboardButtonBuy ( self ) } } # [ derive ( Debug , Clone ) ] pub enum KeyboardButtonRow { keyboardButtonRow ( keyboardButtonRow ) , } 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 :: keyboardButtonRow > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = KeyboardButtonRow ; fn into_boxed ( self ) -> KeyboardButtonRow { KeyboardButtonRow :: keyboardButtonRow ( self ) } } # [ derive ( Debug , Clone ) ] pub enum LabeledPrice { labeledPrice ( labeledPrice ) , } 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 :: labeledPrice > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = LabeledPrice ; fn into_boxed ( self ) -> LabeledPrice { LabeledPrice :: labeledPrice ( self ) } } # [ derive ( Debug , Clone ) ] pub enum LangPackDifference { langPackDifference ( langPackDifference ) , } 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 :: langPackDifference > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = LangPackDifference ; fn into_boxed ( self ) -> LangPackDifference { LangPackDifference :: langPackDifference ( self ) } } # [ derive ( Debug , Clone ) ] pub enum LangPackLanguage { langPackLanguage ( langPackLanguage ) , } 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 :: langPackLanguage > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = LangPackLanguage ; fn into_boxed ( self ) -> LangPackLanguage { LangPackLanguage :: langPackLanguage ( self ) } } # [ derive ( Debug , Clone ) ] pub enum LangPackString { langPackString ( langPackString ) , langPackStringPluralized ( langPackStringPluralized ) , langPackStringDeleted ( langPackStringDeleted ) , } impl :: BoxedSerialize for LangPackString { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & LangPackString :: langPackString ( ref x ) => ( :: ConstructorNumber ( 0xcad181f6 ) , x ) , & LangPackString :: langPackStringPluralized ( ref x ) => ( :: ConstructorNumber ( 0x6c47ac9f ) , x ) , & LangPackString :: langPackStringDeleted ( 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 :: langPackString > ( ) ? ) ) , :: ConstructorNumber ( 0x6c47ac9f ) => Ok ( LangPackString :: langPackStringPluralized ( _de . read_bare :: < :: mtproto :: langPackStringPluralized > ( ) ? ) ) , :: ConstructorNumber ( 0x2979eeb2 ) => Ok ( LangPackString :: langPackStringDeleted ( _de . read_bare :: < :: mtproto :: langPackStringDeleted > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = LangPackString ; fn into_boxed ( self ) -> LangPackString { LangPackString :: langPackString ( self ) } } # [ derive ( Debug , Clone ) ] pub struct langPackStringPluralized { 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 langPackStringPluralized { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & langPackStringPluralized { 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 langPackStringPluralized { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( langPackStringPluralized { 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 langPackStringPluralized { type Boxed = LangPackString ; fn into_boxed ( self ) -> LangPackString { LangPackString :: langPackStringPluralized ( self ) } } # [ derive ( Debug , Clone ) ] pub struct langPackStringDeleted { pub key : :: mtproto :: string , } impl :: BareSerialize for langPackStringDeleted { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & langPackStringDeleted { ref key } = self ; _ser . write_bare :: < :: mtproto :: string > ( key ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for langPackStringDeleted { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( langPackStringDeleted { key : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for langPackStringDeleted { type Boxed = LangPackString ; fn into_boxed ( self ) -> LangPackString { LangPackString :: langPackStringDeleted ( self ) } } # [ derive ( Debug , Clone ) ] pub enum MaskCoords { maskCoords ( maskCoords ) , } 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 :: maskCoords > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = MaskCoords ; fn into_boxed ( self ) -> MaskCoords { MaskCoords :: maskCoords ( self ) } } # [ derive ( Debug , Clone ) ] pub enum Message { messageEmpty ( messageEmpty ) , message ( message ) , messageService ( messageService ) , } impl :: BoxedSerialize for Message { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Message :: messageEmpty ( ref x ) => ( :: ConstructorNumber ( 0x83e5de54 ) , x ) , & Message :: message ( ref x ) => ( :: ConstructorNumber ( 0x44f9b43d ) , x ) , & Message :: messageService ( 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 :: messageEmpty ( _de . read_bare :: < :: mtproto :: messageEmpty > ( ) ? ) ) , :: ConstructorNumber ( 0x44f9b43d ) => Ok ( Message :: message ( _de . read_bare :: < :: mtproto :: message > ( ) ? ) ) , :: ConstructorNumber ( 0x9e19a1f6 ) => Ok ( Message :: messageService ( _de . read_bare :: < :: mtproto :: messageService > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct messageEmpty { pub id : :: mtproto :: int , } impl :: BareSerialize for messageEmpty { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & messageEmpty { ref id } = self ; _ser . write_bare :: < :: mtproto :: int > ( id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for messageEmpty { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( messageEmpty { id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for messageEmpty { type Boxed = Message ; fn into_boxed ( self ) -> Message { Message :: messageEmpty ( self ) } } # [ derive ( Debug , Clone ) ] 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 = Message ; fn into_boxed ( self ) -> Message { Message :: message ( self ) } } # [ derive ( Debug , Clone ) ] pub struct messageService { 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 messageService { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & messageService { 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 messageService { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( messageService { 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 messageService { type Boxed = Message ; fn into_boxed ( self ) -> Message { Message :: messageService ( self ) } } # [ derive ( Debug , Clone ) ] pub enum MessageAction { messageActionEmpty , messageActionChatCreate ( messageActionChatCreate ) , messageActionChatEditTitle ( messageActionChatEditTitle ) , messageActionChatEditPhoto ( messageActionChatEditPhoto ) , messageActionChatDeletePhoto , messageActionChatAddUser ( messageActionChatAddUser ) , messageActionChatDeleteUser ( messageActionChatDeleteUser ) , messageActionChatJoinedByLink ( messageActionChatJoinedByLink ) , messageActionChannelCreate ( messageActionChannelCreate ) , messageActionChatMigrateTo ( messageActionChatMigrateTo ) , messageActionChannelMigrateFrom ( messageActionChannelMigrateFrom ) , messageActionPinMessage , messageActionHistoryClear , messageActionGameScore ( messageActionGameScore ) , messageActionPaymentSentMe ( messageActionPaymentSentMe ) , messageActionPaymentSent ( messageActionPaymentSent ) , messageActionPhoneCall ( messageActionPhoneCall ) , messageActionScreenshotTaken , messageActionCustomAction ( messageActionCustomAction ) , } impl :: BoxedSerialize for MessageAction { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & MessageAction :: messageActionEmpty => ( :: ConstructorNumber ( 0xb6aef7b0 ) , & ( ) ) , & MessageAction :: messageActionChatCreate ( ref x ) => ( :: ConstructorNumber ( 0xa6638b9a ) , x ) , & MessageAction :: messageActionChatEditTitle ( ref x ) => ( :: ConstructorNumber ( 0xb5a1ce5a ) , x ) , & MessageAction :: messageActionChatEditPhoto ( ref x ) => ( :: ConstructorNumber ( 0x7fcb13a8 ) , x ) , & MessageAction :: messageActionChatDeletePhoto => ( :: ConstructorNumber ( 0x95e3fbef ) , & ( ) ) , & MessageAction :: messageActionChatAddUser ( ref x ) => ( :: ConstructorNumber ( 0x488a7337 ) , x ) , & MessageAction :: messageActionChatDeleteUser ( ref x ) => ( :: ConstructorNumber ( 0xb2ae9b0c ) , x ) , & MessageAction :: messageActionChatJoinedByLink ( ref x ) => ( :: ConstructorNumber ( 0xf89cf5e8 ) , x ) , & MessageAction :: messageActionChannelCreate ( ref x ) => ( :: ConstructorNumber ( 0x95d2ac92 ) , x ) , & MessageAction :: messageActionChatMigrateTo ( ref x ) => ( :: ConstructorNumber ( 0x51bdb021 ) , x ) , & MessageAction :: messageActionChannelMigrateFrom ( ref x ) => ( :: ConstructorNumber ( 0xb055eaee ) , x ) , & MessageAction :: messageActionPinMessage => ( :: ConstructorNumber ( 0x94bd38ed ) , & ( ) ) , & MessageAction :: messageActionHistoryClear => ( :: ConstructorNumber ( 0x9fbab604 ) , & ( ) ) , & MessageAction :: messageActionGameScore ( ref x ) => ( :: ConstructorNumber ( 0x92a72876 ) , x ) , & MessageAction :: messageActionPaymentSentMe ( ref x ) => ( :: ConstructorNumber ( 0x8f31b327 ) , x ) , & MessageAction :: messageActionPaymentSent ( ref x ) => ( :: ConstructorNumber ( 0x40699cd0 ) , x ) , & MessageAction :: messageActionPhoneCall ( ref x ) => ( :: ConstructorNumber ( 0x80e11a7f ) , x ) , & MessageAction :: messageActionScreenshotTaken => ( :: ConstructorNumber ( 0x4792929b ) , & ( ) ) , & MessageAction :: messageActionCustomAction ( 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 :: messageActionEmpty ) , :: ConstructorNumber ( 0xa6638b9a ) => Ok ( MessageAction :: messageActionChatCreate ( _de . read_bare :: < :: mtproto :: messageActionChatCreate > ( ) ? ) ) , :: ConstructorNumber ( 0xb5a1ce5a ) => Ok ( MessageAction :: messageActionChatEditTitle ( _de . read_bare :: < :: mtproto :: messageActionChatEditTitle > ( ) ? ) ) , :: ConstructorNumber ( 0x7fcb13a8 ) => Ok ( MessageAction :: messageActionChatEditPhoto ( _de . read_bare :: < :: mtproto :: messageActionChatEditPhoto > ( ) ? ) ) , :: ConstructorNumber ( 0x95e3fbef ) => Ok ( MessageAction :: messageActionChatDeletePhoto ) , :: ConstructorNumber ( 0x488a7337 ) => Ok ( MessageAction :: messageActionChatAddUser ( _de . read_bare :: < :: mtproto :: messageActionChatAddUser > ( ) ? ) ) , :: ConstructorNumber ( 0xb2ae9b0c ) => Ok ( MessageAction :: messageActionChatDeleteUser ( _de . read_bare :: < :: mtproto :: messageActionChatDeleteUser > ( ) ? ) ) , :: ConstructorNumber ( 0xf89cf5e8 ) => Ok ( MessageAction :: messageActionChatJoinedByLink ( _de . read_bare :: < :: mtproto :: messageActionChatJoinedByLink > ( ) ? ) ) , :: ConstructorNumber ( 0x95d2ac92 ) => Ok ( MessageAction :: messageActionChannelCreate ( _de . read_bare :: < :: mtproto :: messageActionChannelCreate > ( ) ? ) ) , :: ConstructorNumber ( 0x51bdb021 ) => Ok ( MessageAction :: messageActionChatMigrateTo ( _de . read_bare :: < :: mtproto :: messageActionChatMigrateTo > ( ) ? ) ) , :: ConstructorNumber ( 0xb055eaee ) => Ok ( MessageAction :: messageActionChannelMigrateFrom ( _de . read_bare :: < :: mtproto :: messageActionChannelMigrateFrom > ( ) ? ) ) , :: ConstructorNumber ( 0x94bd38ed ) => Ok ( MessageAction :: messageActionPinMessage ) , :: ConstructorNumber ( 0x9fbab604 ) => Ok ( MessageAction :: messageActionHistoryClear ) , :: ConstructorNumber ( 0x92a72876 ) => Ok ( MessageAction :: messageActionGameScore ( _de . read_bare :: < :: mtproto :: messageActionGameScore > ( ) ? ) ) , :: ConstructorNumber ( 0x8f31b327 ) => Ok ( MessageAction :: messageActionPaymentSentMe ( _de . read_bare :: < :: mtproto :: messageActionPaymentSentMe > ( ) ? ) ) , :: ConstructorNumber ( 0x40699cd0 ) => Ok ( MessageAction :: messageActionPaymentSent ( _de . read_bare :: < :: mtproto :: messageActionPaymentSent > ( ) ? ) ) , :: ConstructorNumber ( 0x80e11a7f ) => Ok ( MessageAction :: messageActionPhoneCall ( _de . read_bare :: < :: mtproto :: messageActionPhoneCall > ( ) ? ) ) , :: ConstructorNumber ( 0x4792929b ) => Ok ( MessageAction :: messageActionScreenshotTaken ) , :: ConstructorNumber ( 0xfae69f56 ) => Ok ( MessageAction :: messageActionCustomAction ( _de . read_bare :: < :: mtproto :: messageActionCustomAction > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct messageActionChatCreate { pub title : :: mtproto :: string , pub users : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > , } impl :: BareSerialize for messageActionChatCreate { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & messageActionChatCreate { 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 messageActionChatCreate { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( messageActionChatCreate { title : _de . read_bare :: < :: mtproto :: string > ( ) ? , users : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > > ( ) ? , } ) } } impl :: IntoBoxed for messageActionChatCreate { type Boxed = MessageAction ; fn into_boxed ( self ) -> MessageAction { MessageAction :: messageActionChatCreate ( self ) } } # [ derive ( Debug , Clone ) ] pub struct messageActionChatEditTitle { pub title : :: mtproto :: string , } impl :: BareSerialize for messageActionChatEditTitle { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & messageActionChatEditTitle { ref title } = self ; _ser . write_bare :: < :: mtproto :: string > ( title ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for messageActionChatEditTitle { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( messageActionChatEditTitle { title : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for messageActionChatEditTitle { type Boxed = MessageAction ; fn into_boxed ( self ) -> MessageAction { MessageAction :: messageActionChatEditTitle ( self ) } } # [ derive ( Debug , Clone ) ] pub struct messageActionChatEditPhoto { pub photo : :: mtproto :: Photo , } impl :: BareSerialize for messageActionChatEditPhoto { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & messageActionChatEditPhoto { ref photo } = self ; _ser . write_boxed :: < :: mtproto :: Photo > ( photo ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for messageActionChatEditPhoto { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( messageActionChatEditPhoto { photo : _de . read_boxed :: < :: mtproto :: Photo > ( ) ? , } ) } } impl :: IntoBoxed for messageActionChatEditPhoto { type Boxed = MessageAction ; fn into_boxed ( self ) -> MessageAction { MessageAction :: messageActionChatEditPhoto ( self ) } } # [ derive ( Debug , Clone ) ] pub struct messageActionChatAddUser { pub users : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > , } impl :: BareSerialize for messageActionChatAddUser { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & messageActionChatAddUser { ref users } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > > ( users ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for messageActionChatAddUser { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( messageActionChatAddUser { users : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > > ( ) ? , } ) } } impl :: IntoBoxed for messageActionChatAddUser { type Boxed = MessageAction ; fn into_boxed ( self ) -> MessageAction { MessageAction :: messageActionChatAddUser ( self ) } } # [ derive ( Debug , Clone ) ] pub struct messageActionChatDeleteUser { pub user_id : :: mtproto :: int , } impl :: BareSerialize for messageActionChatDeleteUser { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & messageActionChatDeleteUser { ref user_id } = self ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for messageActionChatDeleteUser { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( messageActionChatDeleteUser { user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for messageActionChatDeleteUser { type Boxed = MessageAction ; fn into_boxed ( self ) -> MessageAction { MessageAction :: messageActionChatDeleteUser ( self ) } } # [ derive ( Debug , Clone ) ] pub struct messageActionChatJoinedByLink { pub inviter_id : :: mtproto :: int , } impl :: BareSerialize for messageActionChatJoinedByLink { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & messageActionChatJoinedByLink { ref inviter_id } = self ; _ser . write_bare :: < :: mtproto :: int > ( inviter_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for messageActionChatJoinedByLink { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( messageActionChatJoinedByLink { inviter_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for messageActionChatJoinedByLink { type Boxed = MessageAction ; fn into_boxed ( self ) -> MessageAction { MessageAction :: messageActionChatJoinedByLink ( self ) } } # [ derive ( Debug , Clone ) ] pub struct messageActionChannelCreate { pub title : :: mtproto :: string , } impl :: BareSerialize for messageActionChannelCreate { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & messageActionChannelCreate { ref title } = self ; _ser . write_bare :: < :: mtproto :: string > ( title ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for messageActionChannelCreate { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( messageActionChannelCreate { title : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for messageActionChannelCreate { type Boxed = MessageAction ; fn into_boxed ( self ) -> MessageAction { MessageAction :: messageActionChannelCreate ( self ) } } # [ derive ( Debug , Clone ) ] pub struct messageActionChatMigrateTo { pub channel_id : :: mtproto :: int , } impl :: BareSerialize for messageActionChatMigrateTo { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & messageActionChatMigrateTo { ref channel_id } = self ; _ser . write_bare :: < :: mtproto :: int > ( channel_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for messageActionChatMigrateTo { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( messageActionChatMigrateTo { channel_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for messageActionChatMigrateTo { type Boxed = MessageAction ; fn into_boxed ( self ) -> MessageAction { MessageAction :: messageActionChatMigrateTo ( self ) } } # [ derive ( Debug , Clone ) ] pub struct messageActionChannelMigrateFrom { pub title : :: mtproto :: string , pub chat_id : :: mtproto :: int , } impl :: BareSerialize for messageActionChannelMigrateFrom { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & messageActionChannelMigrateFrom { ref title , ref chat_id } = self ; _ser . write_bare :: < :: mtproto :: string > ( title ) ? ; _ser . write_bare :: < :: mtproto :: int > ( chat_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for messageActionChannelMigrateFrom { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( messageActionChannelMigrateFrom { title : _de . read_bare :: < :: mtproto :: string > ( ) ? , chat_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for messageActionChannelMigrateFrom { type Boxed = MessageAction ; fn into_boxed ( self ) -> MessageAction { MessageAction :: messageActionChannelMigrateFrom ( self ) } } # [ derive ( Debug , Clone ) ] pub struct messageActionGameScore { pub game_id : :: mtproto :: long , pub score : :: mtproto :: int , } impl :: BareSerialize for messageActionGameScore { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & messageActionGameScore { ref game_id , ref score } = self ; _ser . write_bare :: < :: mtproto :: long > ( game_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( score ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for messageActionGameScore { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( messageActionGameScore { game_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , score : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for messageActionGameScore { type Boxed = MessageAction ; fn into_boxed ( self ) -> MessageAction { MessageAction :: messageActionGameScore ( self ) } } # [ derive ( Debug , Clone ) ] pub struct messageActionPaymentSentMe { 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 messageActionPaymentSentMe { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & messageActionPaymentSentMe { 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 messageActionPaymentSentMe { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( messageActionPaymentSentMe { 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 messageActionPaymentSentMe { type Boxed = MessageAction ; fn into_boxed ( self ) -> MessageAction { MessageAction :: messageActionPaymentSentMe ( self ) } } # [ derive ( Debug , Clone ) ] pub struct messageActionPaymentSent { pub currency : :: mtproto :: string , pub total_amount : :: mtproto :: long , } impl :: BareSerialize for messageActionPaymentSent { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & messageActionPaymentSent { ref currency , ref total_amount } = self ; _ser . write_bare :: < :: mtproto :: string > ( currency ) ? ; _ser . write_bare :: < :: mtproto :: long > ( total_amount ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for messageActionPaymentSent { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( messageActionPaymentSent { currency : _de . read_bare :: < :: mtproto :: string > ( ) ? , total_amount : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for messageActionPaymentSent { type Boxed = MessageAction ; fn into_boxed ( self ) -> MessageAction { MessageAction :: messageActionPaymentSent ( self ) } } # [ derive ( Debug , Clone ) ] pub struct messageActionPhoneCall { pub call_id : :: mtproto :: long , pub reason : Option < :: mtproto :: PhoneCallDiscardReason > , pub duration : Option < :: mtproto :: int > , } impl :: BareSerialize for messageActionPhoneCall { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & messageActionPhoneCall { 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 messageActionPhoneCall { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( messageActionPhoneCall { 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 messageActionPhoneCall { type Boxed = MessageAction ; fn into_boxed ( self ) -> MessageAction { MessageAction :: messageActionPhoneCall ( self ) } } # [ derive ( Debug , Clone ) ] pub struct messageActionCustomAction { pub message : :: mtproto :: string , } impl :: BareSerialize for messageActionCustomAction { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & messageActionCustomAction { ref message } = self ; _ser . write_bare :: < :: mtproto :: string > ( message ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for messageActionCustomAction { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( messageActionCustomAction { message : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for messageActionCustomAction { type Boxed = MessageAction ; fn into_boxed ( self ) -> MessageAction { MessageAction :: messageActionCustomAction ( self ) } } # [ derive ( Debug , Clone ) ] pub enum MessageEntity { messageEntityUnknown ( messageEntityUnknown ) , messageEntityMention ( messageEntityMention ) , messageEntityHashtag ( messageEntityHashtag ) , messageEntityBotCommand ( messageEntityBotCommand ) , messageEntityUrl ( messageEntityUrl ) , messageEntityEmail ( messageEntityEmail ) , messageEntityBold ( messageEntityBold ) , messageEntityItalic ( messageEntityItalic ) , messageEntityCode ( messageEntityCode ) , messageEntityPre ( messageEntityPre ) , messageEntityTextUrl ( messageEntityTextUrl ) , messageEntityMentionName ( messageEntityMentionName ) , inputMessageEntityMentionName ( inputMessageEntityMentionName ) , } 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 :: messageEntityUnknown > ( ) ? ) ) , :: ConstructorNumber ( 0xfa04579d ) => Ok ( MessageEntity :: messageEntityMention ( _de . read_bare :: < :: mtproto :: messageEntityMention > ( ) ? ) ) , :: ConstructorNumber ( 0x6f635b0d ) => Ok ( MessageEntity :: messageEntityHashtag ( _de . read_bare :: < :: mtproto :: messageEntityHashtag > ( ) ? ) ) , :: ConstructorNumber ( 0x6cef8ac7 ) => Ok ( MessageEntity :: messageEntityBotCommand ( _de . read_bare :: < :: mtproto :: messageEntityBotCommand > ( ) ? ) ) , :: ConstructorNumber ( 0x6ed02538 ) => Ok ( MessageEntity :: messageEntityUrl ( _de . read_bare :: < :: mtproto :: messageEntityUrl > ( ) ? ) ) , :: ConstructorNumber ( 0x64e475c2 ) => Ok ( MessageEntity :: messageEntityEmail ( _de . read_bare :: < :: mtproto :: messageEntityEmail > ( ) ? ) ) , :: ConstructorNumber ( 0xbd610bc9 ) => Ok ( MessageEntity :: messageEntityBold ( _de . read_bare :: < :: mtproto :: messageEntityBold > ( ) ? ) ) , :: ConstructorNumber ( 0x826f8b60 ) => Ok ( MessageEntity :: messageEntityItalic ( _de . read_bare :: < :: mtproto :: messageEntityItalic > ( ) ? ) ) , :: ConstructorNumber ( 0x28a20571 ) => Ok ( MessageEntity :: messageEntityCode ( _de . read_bare :: < :: mtproto :: messageEntityCode > ( ) ? ) ) , :: ConstructorNumber ( 0x73924be0 ) => Ok ( MessageEntity :: messageEntityPre ( _de . read_bare :: < :: mtproto :: messageEntityPre > ( ) ? ) ) , :: ConstructorNumber ( 0x76a6d327 ) => Ok ( MessageEntity :: messageEntityTextUrl ( _de . read_bare :: < :: mtproto :: messageEntityTextUrl > ( ) ? ) ) , :: ConstructorNumber ( 0x352dca58 ) => Ok ( MessageEntity :: messageEntityMentionName ( _de . read_bare :: < :: mtproto :: messageEntityMentionName > ( ) ? ) ) , :: ConstructorNumber ( 0x208e68c9 ) => Ok ( MessageEntity :: inputMessageEntityMentionName ( _de . read_bare :: < :: mtproto :: inputMessageEntityMentionName > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = MessageEntity ; fn into_boxed ( self ) -> MessageEntity { MessageEntity :: messageEntityUnknown ( self ) } } # [ derive ( Debug , Clone ) ] 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 = MessageEntity ; fn into_boxed ( self ) -> MessageEntity { MessageEntity :: messageEntityMention ( self ) } } # [ derive ( Debug , Clone ) ] 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 = MessageEntity ; fn into_boxed ( self ) -> MessageEntity { MessageEntity :: messageEntityHashtag ( self ) } } # [ derive ( Debug , Clone ) ] 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 = MessageEntity ; fn into_boxed ( self ) -> MessageEntity { MessageEntity :: messageEntityBotCommand ( self ) } } # [ derive ( Debug , Clone ) ] 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 = MessageEntity ; fn into_boxed ( self ) -> MessageEntity { MessageEntity :: messageEntityUrl ( self ) } } # [ derive ( Debug , Clone ) ] 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 = MessageEntity ; fn into_boxed ( self ) -> MessageEntity { MessageEntity :: messageEntityEmail ( self ) } } # [ derive ( Debug , Clone ) ] 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 = MessageEntity ; fn into_boxed ( self ) -> MessageEntity { MessageEntity :: messageEntityBold ( self ) } } # [ derive ( Debug , Clone ) ] 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 = MessageEntity ; fn into_boxed ( self ) -> MessageEntity { MessageEntity :: messageEntityItalic ( self ) } } # [ derive ( Debug , Clone ) ] 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 = MessageEntity ; fn into_boxed ( self ) -> MessageEntity { MessageEntity :: messageEntityCode ( self ) } } # [ derive ( Debug , Clone ) ] 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 = MessageEntity ; fn into_boxed ( self ) -> MessageEntity { MessageEntity :: messageEntityPre ( self ) } } # [ derive ( Debug , Clone ) ] 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 = MessageEntity ; fn into_boxed ( self ) -> MessageEntity { MessageEntity :: messageEntityTextUrl ( self ) } } # [ derive ( Debug , Clone ) ] 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 = MessageEntity ; fn into_boxed ( self ) -> MessageEntity { MessageEntity :: messageEntityMentionName ( self ) } } # [ derive ( Debug , Clone ) ] 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 = MessageEntity ; fn into_boxed ( self ) -> MessageEntity { MessageEntity :: inputMessageEntityMentionName ( self ) } } # [ derive ( Debug , Clone ) ] pub enum MessageFwdHeader { messageFwdHeader ( messageFwdHeader ) , } 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 :: messageFwdHeader > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = MessageFwdHeader ; fn into_boxed ( self ) -> MessageFwdHeader { MessageFwdHeader :: messageFwdHeader ( self ) } } # [ derive ( Debug , Clone ) ] pub enum MessageMedia { messageMediaEmpty , messageMediaPhoto ( messageMediaPhoto ) , messageMediaGeo ( messageMediaGeo ) , messageMediaContact ( messageMediaContact ) , messageMediaUnsupported , messageMediaDocument ( messageMediaDocument ) , messageMediaWebPage ( messageMediaWebPage ) , messageMediaVenue ( messageMediaVenue ) , messageMediaGame ( messageMediaGame ) , messageMediaInvoice ( messageMediaInvoice ) , messageMediaGeoLive ( messageMediaGeoLive ) , } impl :: BoxedSerialize for MessageMedia { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & MessageMedia :: messageMediaEmpty => ( :: ConstructorNumber ( 0x3ded6320 ) , & ( ) ) , & MessageMedia :: messageMediaPhoto ( ref x ) => ( :: ConstructorNumber ( 0xb5223b0f ) , x ) , & MessageMedia :: messageMediaGeo ( ref x ) => ( :: ConstructorNumber ( 0x56e0d474 ) , x ) , & MessageMedia :: messageMediaContact ( ref x ) => ( :: ConstructorNumber ( 0x5e7d2f39 ) , x ) , & MessageMedia :: messageMediaUnsupported => ( :: ConstructorNumber ( 0x9f84f49e ) , & ( ) ) , & MessageMedia :: messageMediaDocument ( ref x ) => ( :: ConstructorNumber ( 0x7c4414d3 ) , x ) , & MessageMedia :: messageMediaWebPage ( ref x ) => ( :: ConstructorNumber ( 0xa32dd600 ) , x ) , & MessageMedia :: messageMediaVenue ( ref x ) => ( :: ConstructorNumber ( 0x2ec0533f ) , x ) , & MessageMedia :: messageMediaGame ( ref x ) => ( :: ConstructorNumber ( 0xfdb19008 ) , x ) , & MessageMedia :: messageMediaInvoice ( ref x ) => ( :: ConstructorNumber ( 0x84551347 ) , x ) , & MessageMedia :: messageMediaGeoLive ( 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 :: messageMediaEmpty ) , :: ConstructorNumber ( 0xb5223b0f ) => Ok ( MessageMedia :: messageMediaPhoto ( _de . read_bare :: < :: mtproto :: messageMediaPhoto > ( ) ? ) ) , :: ConstructorNumber ( 0x56e0d474 ) => Ok ( MessageMedia :: messageMediaGeo ( _de . read_bare :: < :: mtproto :: messageMediaGeo > ( ) ? ) ) , :: ConstructorNumber ( 0x5e7d2f39 ) => Ok ( MessageMedia :: messageMediaContact ( _de . read_bare :: < :: mtproto :: messageMediaContact > ( ) ? ) ) , :: ConstructorNumber ( 0x9f84f49e ) => Ok ( MessageMedia :: messageMediaUnsupported ) , :: ConstructorNumber ( 0x7c4414d3 ) => Ok ( MessageMedia :: messageMediaDocument ( _de . read_bare :: < :: mtproto :: messageMediaDocument > ( ) ? ) ) , :: ConstructorNumber ( 0xa32dd600 ) => Ok ( MessageMedia :: messageMediaWebPage ( _de . read_bare :: < :: mtproto :: messageMediaWebPage > ( ) ? ) ) , :: ConstructorNumber ( 0x2ec0533f ) => Ok ( MessageMedia :: messageMediaVenue ( _de . read_bare :: < :: mtproto :: messageMediaVenue > ( ) ? ) ) , :: ConstructorNumber ( 0xfdb19008 ) => Ok ( MessageMedia :: messageMediaGame ( _de . read_bare :: < :: mtproto :: messageMediaGame > ( ) ? ) ) , :: ConstructorNumber ( 0x84551347 ) => Ok ( MessageMedia :: messageMediaInvoice ( _de . read_bare :: < :: mtproto :: messageMediaInvoice > ( ) ? ) ) , :: ConstructorNumber ( 0x7c3c2609 ) => Ok ( MessageMedia :: messageMediaGeoLive ( _de . read_bare :: < :: mtproto :: messageMediaGeoLive > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct messageMediaPhoto { pub photo : Option < :: mtproto :: Photo > , pub caption : Option < :: mtproto :: string > , pub ttl_seconds : Option < :: mtproto :: int > , } impl :: BareSerialize for messageMediaPhoto { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & messageMediaPhoto { 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 messageMediaPhoto { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( messageMediaPhoto { 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 messageMediaPhoto { type Boxed = MessageMedia ; fn into_boxed ( self ) -> MessageMedia { MessageMedia :: messageMediaPhoto ( self ) } } # [ derive ( Debug , Clone ) ] pub struct messageMediaGeo { pub geo : :: mtproto :: GeoPoint , } impl :: BareSerialize for messageMediaGeo { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & messageMediaGeo { ref geo } = self ; _ser . write_boxed :: < :: mtproto :: GeoPoint > ( geo ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for messageMediaGeo { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( messageMediaGeo { geo : _de . read_boxed :: < :: mtproto :: GeoPoint > ( ) ? , } ) } } impl :: IntoBoxed for messageMediaGeo { type Boxed = MessageMedia ; fn into_boxed ( self ) -> MessageMedia { MessageMedia :: messageMediaGeo ( self ) } } # [ derive ( Debug , Clone ) ] pub struct messageMediaContact { pub phone_number : :: mtproto :: string , pub first_name : :: mtproto :: string , pub last_name : :: mtproto :: string , pub user_id : :: mtproto :: int , } impl :: BareSerialize for messageMediaContact { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & messageMediaContact { 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 messageMediaContact { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( messageMediaContact { 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 messageMediaContact { type Boxed = MessageMedia ; fn into_boxed ( self ) -> MessageMedia { MessageMedia :: messageMediaContact ( self ) } } # [ derive ( Debug , Clone ) ] pub struct messageMediaDocument { pub document : Option < :: mtproto :: Document > , pub caption : Option < :: mtproto :: string > , pub ttl_seconds : Option < :: mtproto :: int > , } impl :: BareSerialize for messageMediaDocument { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & messageMediaDocument { 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 messageMediaDocument { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( messageMediaDocument { 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 messageMediaDocument { type Boxed = MessageMedia ; fn into_boxed ( self ) -> MessageMedia { MessageMedia :: messageMediaDocument ( self ) } } # [ derive ( Debug , Clone ) ] pub struct messageMediaWebPage { pub webpage : :: mtproto :: WebPage , } impl :: BareSerialize for messageMediaWebPage { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & messageMediaWebPage { ref webpage } = self ; _ser . write_boxed :: < :: mtproto :: WebPage > ( webpage ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for messageMediaWebPage { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( messageMediaWebPage { webpage : _de . read_boxed :: < :: mtproto :: WebPage > ( ) ? , } ) } } impl :: IntoBoxed for messageMediaWebPage { type Boxed = MessageMedia ; fn into_boxed ( self ) -> MessageMedia { MessageMedia :: messageMediaWebPage ( self ) } } # [ derive ( Debug , Clone ) ] pub struct messageMediaVenue { 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 messageMediaVenue { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & messageMediaVenue { 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 messageMediaVenue { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( messageMediaVenue { 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 messageMediaVenue { type Boxed = MessageMedia ; fn into_boxed ( self ) -> MessageMedia { MessageMedia :: messageMediaVenue ( self ) } } # [ derive ( Debug , Clone ) ] pub struct messageMediaGame { pub game : :: mtproto :: Game , } impl :: BareSerialize for messageMediaGame { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & messageMediaGame { ref game } = self ; _ser . write_boxed :: < :: mtproto :: Game > ( game ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for messageMediaGame { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( messageMediaGame { game : _de . read_boxed :: < :: mtproto :: Game > ( ) ? , } ) } } impl :: IntoBoxed for messageMediaGame { type Boxed = MessageMedia ; fn into_boxed ( self ) -> MessageMedia { MessageMedia :: messageMediaGame ( self ) } } # [ derive ( Debug , Clone ) ] pub struct messageMediaInvoice { 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 messageMediaInvoice { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & messageMediaInvoice { 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 messageMediaInvoice { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( messageMediaInvoice { 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 messageMediaInvoice { type Boxed = MessageMedia ; fn into_boxed ( self ) -> MessageMedia { MessageMedia :: messageMediaInvoice ( self ) } } # [ derive ( Debug , Clone ) ] pub struct messageMediaGeoLive { pub geo : :: mtproto :: GeoPoint , pub period : :: mtproto :: int , } impl :: BareSerialize for messageMediaGeoLive { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & messageMediaGeoLive { ref geo , ref period } = self ; _ser . write_boxed :: < :: mtproto :: GeoPoint > ( geo ) ? ; _ser . write_bare :: < :: mtproto :: int > ( period ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for messageMediaGeoLive { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( messageMediaGeoLive { geo : _de . read_boxed :: < :: mtproto :: GeoPoint > ( ) ? , period : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for messageMediaGeoLive { type Boxed = MessageMedia ; fn into_boxed ( self ) -> MessageMedia { MessageMedia :: messageMediaGeoLive ( self ) } } # [ derive ( Debug , Clone ) ] pub enum MessageRange { messageRange ( messageRange ) , } 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 :: messageRange > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = MessageRange ; fn into_boxed ( self ) -> MessageRange { MessageRange :: messageRange ( self ) } } # [ derive ( Debug , Clone ) ] pub enum MessagesFilter { inputMessagesFilterEmpty , inputMessagesFilterPhotos , inputMessagesFilterVideo , inputMessagesFilterPhotoVideo , inputMessagesFilterDocument , inputMessagesFilterUrl , inputMessagesFilterGif , inputMessagesFilterVoice , inputMessagesFilterMusic , inputMessagesFilterChatPhotos , inputMessagesFilterPhoneCalls ( inputMessagesFilterPhoneCalls ) , inputMessagesFilterRoundVoice , inputMessagesFilterRoundVideo , inputMessagesFilterMyMentions , inputMessagesFilterGeo , inputMessagesFilterContacts , } impl :: BoxedSerialize for MessagesFilter { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & MessagesFilter :: inputMessagesFilterEmpty => ( :: ConstructorNumber ( 0x57e2f66c ) , & ( ) ) , & MessagesFilter :: inputMessagesFilterPhotos => ( :: ConstructorNumber ( 0x9609a51c ) , & ( ) ) , & MessagesFilter :: inputMessagesFilterVideo => ( :: ConstructorNumber ( 0x9fc00e65 ) , & ( ) ) , & MessagesFilter :: inputMessagesFilterPhotoVideo => ( :: ConstructorNumber ( 0x56e9f0e4 ) , & ( ) ) , & MessagesFilter :: inputMessagesFilterDocument => ( :: ConstructorNumber ( 0x9eddf188 ) , & ( ) ) , & MessagesFilter :: inputMessagesFilterUrl => ( :: ConstructorNumber ( 0x7ef0dd87 ) , & ( ) ) , & MessagesFilter :: inputMessagesFilterGif => ( :: ConstructorNumber ( 0xffc86587 ) , & ( ) ) , & MessagesFilter :: inputMessagesFilterVoice => ( :: ConstructorNumber ( 0x50f5c392 ) , & ( ) ) , & MessagesFilter :: inputMessagesFilterMusic => ( :: ConstructorNumber ( 0x3751b49e ) , & ( ) ) , & MessagesFilter :: inputMessagesFilterChatPhotos => ( :: ConstructorNumber ( 0x3a20ecb8 ) , & ( ) ) , & MessagesFilter :: inputMessagesFilterPhoneCalls ( ref x ) => ( :: ConstructorNumber ( 0x80c99768 ) , x ) , & MessagesFilter :: inputMessagesFilterRoundVoice => ( :: ConstructorNumber ( 0x7a7c17a4 ) , & ( ) ) , & MessagesFilter :: inputMessagesFilterRoundVideo => ( :: ConstructorNumber ( 0xb549da53 ) , & ( ) ) , & MessagesFilter :: inputMessagesFilterMyMentions => ( :: ConstructorNumber ( 0xc1f8e69a ) , & ( ) ) , & MessagesFilter :: inputMessagesFilterGeo => ( :: ConstructorNumber ( 0xe7026d0d ) , & ( ) ) , & MessagesFilter :: inputMessagesFilterContacts => ( :: 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 :: inputMessagesFilterEmpty ) , :: ConstructorNumber ( 0x9609a51c ) => Ok ( MessagesFilter :: inputMessagesFilterPhotos ) , :: ConstructorNumber ( 0x9fc00e65 ) => Ok ( MessagesFilter :: inputMessagesFilterVideo ) , :: ConstructorNumber ( 0x56e9f0e4 ) => Ok ( MessagesFilter :: inputMessagesFilterPhotoVideo ) , :: ConstructorNumber ( 0x9eddf188 ) => Ok ( MessagesFilter :: inputMessagesFilterDocument ) , :: ConstructorNumber ( 0x7ef0dd87 ) => Ok ( MessagesFilter :: inputMessagesFilterUrl ) , :: ConstructorNumber ( 0xffc86587 ) => Ok ( MessagesFilter :: inputMessagesFilterGif ) , :: ConstructorNumber ( 0x50f5c392 ) => Ok ( MessagesFilter :: inputMessagesFilterVoice ) , :: ConstructorNumber ( 0x3751b49e ) => Ok ( MessagesFilter :: inputMessagesFilterMusic ) , :: ConstructorNumber ( 0x3a20ecb8 ) => Ok ( MessagesFilter :: inputMessagesFilterChatPhotos ) , :: ConstructorNumber ( 0x80c99768 ) => Ok ( MessagesFilter :: inputMessagesFilterPhoneCalls ( _de . read_bare :: < :: mtproto :: inputMessagesFilterPhoneCalls > ( ) ? ) ) , :: ConstructorNumber ( 0x7a7c17a4 ) => Ok ( MessagesFilter :: inputMessagesFilterRoundVoice ) , :: ConstructorNumber ( 0xb549da53 ) => Ok ( MessagesFilter :: inputMessagesFilterRoundVideo ) , :: ConstructorNumber ( 0xc1f8e69a ) => Ok ( MessagesFilter :: inputMessagesFilterMyMentions ) , :: ConstructorNumber ( 0xe7026d0d ) => Ok ( MessagesFilter :: inputMessagesFilterGeo ) , :: ConstructorNumber ( 0xe062db83 ) => Ok ( MessagesFilter :: inputMessagesFilterContacts ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct inputMessagesFilterPhoneCalls { pub missed : bool , } impl :: BareSerialize for inputMessagesFilterPhoneCalls { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputMessagesFilterPhoneCalls { missed } = self ; let mut flags = 0i32 ; if missed { flags |= 1 << 0u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & flags ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for inputMessagesFilterPhoneCalls { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( inputMessagesFilterPhoneCalls { missed : { flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; flags & ( 1 << 0u32 ) != 0 } , } ) } } impl :: IntoBoxed for inputMessagesFilterPhoneCalls { type Boxed = MessagesFilter ; fn into_boxed ( self ) -> MessagesFilter { MessagesFilter :: inputMessagesFilterPhoneCalls ( self ) } } # [ derive ( Debug , Clone ) ] pub enum MsgDetailedInfo { msg_detailed_info ( msg_detailed_info ) , msg_new_detailed_info ( msg_new_detailed_info ) , } impl :: BoxedSerialize for MsgDetailedInfo { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & MsgDetailedInfo :: msg_detailed_info ( ref x ) => ( :: ConstructorNumber ( 0x276d3ec6 ) , x ) , & MsgDetailedInfo :: msg_new_detailed_info ( 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 :: msg_detailed_info ( _de . read_bare :: < :: mtproto :: msg_detailed_info > ( ) ? ) ) , :: ConstructorNumber ( 0x809db6df ) => Ok ( MsgDetailedInfo :: msg_new_detailed_info ( _de . read_bare :: < :: mtproto :: msg_new_detailed_info > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct msg_detailed_info { pub msg_id : :: mtproto :: long , pub answer_msg_id : :: mtproto :: long , pub bytes : :: mtproto :: int , pub status : :: mtproto :: int , } impl :: BareSerialize for msg_detailed_info { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & msg_detailed_info { 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 msg_detailed_info { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( msg_detailed_info { 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 msg_detailed_info { type Boxed = MsgDetailedInfo ; fn into_boxed ( self ) -> MsgDetailedInfo { MsgDetailedInfo :: msg_detailed_info ( self ) } } # [ derive ( Debug , Clone ) ] pub struct msg_new_detailed_info { pub answer_msg_id : :: mtproto :: long , pub bytes : :: mtproto :: int , pub status : :: mtproto :: int , } impl :: BareSerialize for msg_new_detailed_info { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & msg_new_detailed_info { 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 msg_new_detailed_info { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( msg_new_detailed_info { answer_msg_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , bytes : _de . read_bare :: < :: mtproto :: int > ( ) ? , status : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for msg_new_detailed_info { type Boxed = MsgDetailedInfo ; fn into_boxed ( self ) -> MsgDetailedInfo { MsgDetailedInfo :: msg_new_detailed_info ( self ) } } # [ derive ( Debug , Clone ) ] pub enum MsgResendReq { msg_resend_req ( msg_resend_req ) , } impl :: BoxedSerialize for MsgResendReq { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & MsgResendReq :: msg_resend_req ( 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 :: msg_resend_req ( _de . read_bare :: < :: mtproto :: msg_resend_req > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct msg_resend_req { pub msg_ids : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > , } impl :: BareSerialize for msg_resend_req { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & msg_resend_req { ref msg_ids } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > > ( msg_ids ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for msg_resend_req { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( msg_resend_req { msg_ids : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > > ( ) ? , } ) } } impl :: IntoBoxed for msg_resend_req { type Boxed = MsgResendReq ; fn into_boxed ( self ) -> MsgResendReq { MsgResendReq :: msg_resend_req ( self ) } } # [ derive ( Debug , Clone ) ] pub enum MsgsAck { msgs_ack ( msgs_ack ) , } impl :: BoxedSerialize for MsgsAck { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & MsgsAck :: msgs_ack ( 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 :: msgs_ack ( _de . read_bare :: < :: mtproto :: msgs_ack > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct msgs_ack { pub msg_ids : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > , } impl :: BareSerialize for msgs_ack { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & msgs_ack { ref msg_ids } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > > ( msg_ids ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for msgs_ack { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( msgs_ack { msg_ids : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > > ( ) ? , } ) } } impl :: IntoBoxed for msgs_ack { type Boxed = MsgsAck ; fn into_boxed ( self ) -> MsgsAck { MsgsAck :: msgs_ack ( self ) } } # [ derive ( Debug , Clone ) ] pub enum MsgsAllInfo { msgs_all_info ( msgs_all_info ) , } impl :: BoxedSerialize for MsgsAllInfo { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & MsgsAllInfo :: msgs_all_info ( 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 :: msgs_all_info ( _de . read_bare :: < :: mtproto :: msgs_all_info > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct msgs_all_info { pub msg_ids : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > , pub info : :: mtproto :: string , } impl :: BareSerialize for msgs_all_info { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & msgs_all_info { 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 msgs_all_info { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( msgs_all_info { msg_ids : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > > ( ) ? , info : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for msgs_all_info { type Boxed = MsgsAllInfo ; fn into_boxed ( self ) -> MsgsAllInfo { MsgsAllInfo :: msgs_all_info ( self ) } } # [ derive ( Debug , Clone ) ] pub enum MsgsStateInfo { msgs_state_info ( msgs_state_info ) , } impl :: BoxedSerialize for MsgsStateInfo { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & MsgsStateInfo :: msgs_state_info ( 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 :: msgs_state_info ( _de . read_bare :: < :: mtproto :: msgs_state_info > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct msgs_state_info { pub req_msg_id : :: mtproto :: long , pub info : :: mtproto :: string , } impl :: BareSerialize for msgs_state_info { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & msgs_state_info { 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 msgs_state_info { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( msgs_state_info { req_msg_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , info : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for msgs_state_info { type Boxed = MsgsStateInfo ; fn into_boxed ( self ) -> MsgsStateInfo { MsgsStateInfo :: msgs_state_info ( self ) } } # [ derive ( Debug , Clone ) ] pub enum MsgsStateReq { msgs_state_req ( msgs_state_req ) , } impl :: BoxedSerialize for MsgsStateReq { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & MsgsStateReq :: msgs_state_req ( 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 :: msgs_state_req ( _de . read_bare :: < :: mtproto :: msgs_state_req > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct msgs_state_req { pub msg_ids : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > , } impl :: BareSerialize for msgs_state_req { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & msgs_state_req { ref msg_ids } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > > ( msg_ids ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for msgs_state_req { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( msgs_state_req { msg_ids : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > > ( ) ? , } ) } } impl :: IntoBoxed for msgs_state_req { type Boxed = MsgsStateReq ; fn into_boxed ( self ) -> MsgsStateReq { MsgsStateReq :: msgs_state_req ( self ) } } # [ derive ( Debug , Clone ) ] pub enum NearestDc { nearestDc ( nearestDc ) , } 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 :: nearestDc > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = NearestDc ; fn into_boxed ( self ) -> NearestDc { NearestDc :: nearestDc ( self ) } } # [ derive ( Debug , Clone ) ] pub enum NewSession { new_session_created ( new_session_created ) , } impl :: BoxedSerialize for NewSession { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & NewSession :: new_session_created ( 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 :: new_session_created ( _de . read_bare :: < :: mtproto :: new_session_created > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct new_session_created { pub first_msg_id : :: mtproto :: long , pub unique_id : :: mtproto :: long , pub server_salt : :: mtproto :: long , } impl :: BareSerialize for new_session_created { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & new_session_created { 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 new_session_created { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( new_session_created { 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 new_session_created { type Boxed = NewSession ; fn into_boxed ( self ) -> NewSession { NewSession :: new_session_created ( self ) } } # [ derive ( Debug , Clone ) ] pub enum NotifyPeer { notifyPeer ( notifyPeer ) , notifyUsers , notifyChats , notifyAll , } impl :: BoxedSerialize for NotifyPeer { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & NotifyPeer :: notifyPeer ( ref x ) => ( :: ConstructorNumber ( 0x9fd40bd8 ) , x ) , & NotifyPeer :: notifyUsers => ( :: ConstructorNumber ( 0xb4c83b4c ) , & ( ) ) , & NotifyPeer :: notifyChats => ( :: ConstructorNumber ( 0xc007cec3 ) , & ( ) ) , & NotifyPeer :: notifyAll => ( :: 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 :: notifyPeer ( _de . read_bare :: < :: mtproto :: notifyPeer > ( ) ? ) ) , :: ConstructorNumber ( 0xb4c83b4c ) => Ok ( NotifyPeer :: notifyUsers ) , :: ConstructorNumber ( 0xc007cec3 ) => Ok ( NotifyPeer :: notifyChats ) , :: ConstructorNumber ( 0x74d07c60 ) => Ok ( NotifyPeer :: notifyAll ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct notifyPeer { pub peer : :: mtproto :: Peer , } impl :: BareSerialize for notifyPeer { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & notifyPeer { ref peer } = self ; _ser . write_boxed :: < :: mtproto :: Peer > ( peer ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for notifyPeer { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( notifyPeer { peer : _de . read_boxed :: < :: mtproto :: Peer > ( ) ? , } ) } } impl :: IntoBoxed for notifyPeer { type Boxed = NotifyPeer ; fn into_boxed ( self ) -> NotifyPeer { NotifyPeer :: notifyPeer ( self ) } } # [ derive ( Debug , Clone ) ] 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 => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub enum P_Q_inner_data { p_q_inner_data ( p_q_inner_data ) , p_q_inner_data_temp ( p_q_inner_data_temp ) , } impl :: BoxedSerialize for P_Q_inner_data { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & P_Q_inner_data :: p_q_inner_data ( ref x ) => ( :: ConstructorNumber ( 0x83c95aec ) , x ) , & P_Q_inner_data :: p_q_inner_data_temp ( ref x ) => ( :: ConstructorNumber ( 0x3c6a84d4 ) , x ) , } } } impl :: BoxedDeserialize for P_Q_inner_data { 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 ( P_Q_inner_data :: p_q_inner_data ( _de . read_bare :: < :: mtproto :: p_q_inner_data > ( ) ? ) ) , :: ConstructorNumber ( 0x3c6a84d4 ) => Ok ( P_Q_inner_data :: p_q_inner_data_temp ( _de . read_bare :: < :: mtproto :: p_q_inner_data_temp > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct p_q_inner_data { 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 p_q_inner_data { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & p_q_inner_data { 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 p_q_inner_data { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( p_q_inner_data { 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 p_q_inner_data { type Boxed = P_Q_inner_data ; fn into_boxed ( self ) -> P_Q_inner_data { P_Q_inner_data :: p_q_inner_data ( self ) } } # [ derive ( Debug , Clone ) ] pub struct p_q_inner_data_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 p_q_inner_data_temp { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & p_q_inner_data_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 p_q_inner_data_temp { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( p_q_inner_data_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 p_q_inner_data_temp { type Boxed = P_Q_inner_data ; fn into_boxed ( self ) -> P_Q_inner_data { P_Q_inner_data :: p_q_inner_data_temp ( self ) } } # [ derive ( Debug , Clone ) ] pub enum Page { pagePart ( pagePart ) , pageFull ( pageFull ) , } impl :: BoxedSerialize for Page { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Page :: pagePart ( ref x ) => ( :: ConstructorNumber ( 0x8e3f9ebe ) , x ) , & Page :: pageFull ( 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 :: pagePart ( _de . read_bare :: < :: mtproto :: pagePart > ( ) ? ) ) , :: ConstructorNumber ( 0x556ec7aa ) => Ok ( Page :: pageFull ( _de . read_bare :: < :: mtproto :: pageFull > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct pagePart { 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 pagePart { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & pagePart { 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 pagePart { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( pagePart { 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 pagePart { type Boxed = Page ; fn into_boxed ( self ) -> Page { Page :: pagePart ( self ) } } # [ derive ( Debug , Clone ) ] pub struct pageFull { 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 pageFull { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & pageFull { 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 pageFull { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( pageFull { 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 pageFull { type Boxed = Page ; fn into_boxed ( self ) -> Page { Page :: pageFull ( self ) } } # [ derive ( Debug , Clone ) ] pub enum PageBlock { pageBlockUnsupported , pageBlockTitle ( pageBlockTitle ) , pageBlockSubtitle ( pageBlockSubtitle ) , pageBlockAuthorDate ( pageBlockAuthorDate ) , pageBlockHeader ( pageBlockHeader ) , pageBlockSubheader ( pageBlockSubheader ) , pageBlockParagraph ( pageBlockParagraph ) , pageBlockPreformatted ( pageBlockPreformatted ) , pageBlockFooter ( pageBlockFooter ) , pageBlockDivider , pageBlockAnchor ( pageBlockAnchor ) , pageBlockList ( pageBlockList ) , pageBlockBlockquote ( pageBlockBlockquote ) , pageBlockPullquote ( pageBlockPullquote ) , pageBlockPhoto ( pageBlockPhoto ) , pageBlockVideo ( pageBlockVideo ) , pageBlockCover ( pageBlockCover ) , pageBlockEmbed ( pageBlockEmbed ) , pageBlockEmbedPost ( pageBlockEmbedPost ) , pageBlockCollage ( pageBlockCollage ) , pageBlockSlideshow ( pageBlockSlideshow ) , pageBlockChannel ( pageBlockChannel ) , pageBlockAudio ( pageBlockAudio ) , } impl :: BoxedSerialize for PageBlock { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & PageBlock :: pageBlockUnsupported => ( :: ConstructorNumber ( 0x13567e8a ) , & ( ) ) , & PageBlock :: pageBlockTitle ( ref x ) => ( :: ConstructorNumber ( 0x70abc3fd ) , x ) , & PageBlock :: pageBlockSubtitle ( ref x ) => ( :: ConstructorNumber ( 0x8ffa9a1f ) , x ) , & PageBlock :: pageBlockAuthorDate ( ref x ) => ( :: ConstructorNumber ( 0xbaafe5e0 ) , x ) , & PageBlock :: pageBlockHeader ( ref x ) => ( :: ConstructorNumber ( 0xbfd064ec ) , x ) , & PageBlock :: pageBlockSubheader ( ref x ) => ( :: ConstructorNumber ( 0xf12bb6e1 ) , x ) , & PageBlock :: pageBlockParagraph ( ref x ) => ( :: ConstructorNumber ( 0x467a0766 ) , x ) , & PageBlock :: pageBlockPreformatted ( ref x ) => ( :: ConstructorNumber ( 0xc070d93e ) , x ) , & PageBlock :: pageBlockFooter ( ref x ) => ( :: ConstructorNumber ( 0x48870999 ) , x ) , & PageBlock :: pageBlockDivider => ( :: ConstructorNumber ( 0xdb20b188 ) , & ( ) ) , & PageBlock :: pageBlockAnchor ( ref x ) => ( :: ConstructorNumber ( 0xce0d37b0 ) , x ) , & PageBlock :: pageBlockList ( ref x ) => ( :: ConstructorNumber ( 0x3a58c7f4 ) , x ) , & PageBlock :: pageBlockBlockquote ( ref x ) => ( :: ConstructorNumber ( 0x263d7c26 ) , x ) , & PageBlock :: pageBlockPullquote ( ref x ) => ( :: ConstructorNumber ( 0x4f4456d3 ) , x ) , & PageBlock :: pageBlockPhoto ( ref x ) => ( :: ConstructorNumber ( 0xe9c69982 ) , x ) , & PageBlock :: pageBlockVideo ( ref x ) => ( :: ConstructorNumber ( 0xd9d71866 ) , x ) , & PageBlock :: pageBlockCover ( ref x ) => ( :: ConstructorNumber ( 0x39f23300 ) , x ) , & PageBlock :: pageBlockEmbed ( ref x ) => ( :: ConstructorNumber ( 0xcde200d1 ) , x ) , & PageBlock :: pageBlockEmbedPost ( ref x ) => ( :: ConstructorNumber ( 0x292c7be9 ) , x ) , & PageBlock :: pageBlockCollage ( ref x ) => ( :: ConstructorNumber ( 0x08b31c4f ) , x ) , & PageBlock :: pageBlockSlideshow ( ref x ) => ( :: ConstructorNumber ( 0x130c8963 ) , x ) , & PageBlock :: pageBlockChannel ( ref x ) => ( :: ConstructorNumber ( 0xef1751b5 ) , x ) , & PageBlock :: pageBlockAudio ( 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 :: pageBlockUnsupported ) , :: ConstructorNumber ( 0x70abc3fd ) => Ok ( PageBlock :: pageBlockTitle ( _de . read_bare :: < :: mtproto :: pageBlockTitle > ( ) ? ) ) , :: ConstructorNumber ( 0x8ffa9a1f ) => Ok ( PageBlock :: pageBlockSubtitle ( _de . read_bare :: < :: mtproto :: pageBlockSubtitle > ( ) ? ) ) , :: ConstructorNumber ( 0xbaafe5e0 ) => Ok ( PageBlock :: pageBlockAuthorDate ( _de . read_bare :: < :: mtproto :: pageBlockAuthorDate > ( ) ? ) ) , :: ConstructorNumber ( 0xbfd064ec ) => Ok ( PageBlock :: pageBlockHeader ( _de . read_bare :: < :: mtproto :: pageBlockHeader > ( ) ? ) ) , :: ConstructorNumber ( 0xf12bb6e1 ) => Ok ( PageBlock :: pageBlockSubheader ( _de . read_bare :: < :: mtproto :: pageBlockSubheader > ( ) ? ) ) , :: ConstructorNumber ( 0x467a0766 ) => Ok ( PageBlock :: pageBlockParagraph ( _de . read_bare :: < :: mtproto :: pageBlockParagraph > ( ) ? ) ) , :: ConstructorNumber ( 0xc070d93e ) => Ok ( PageBlock :: pageBlockPreformatted ( _de . read_bare :: < :: mtproto :: pageBlockPreformatted > ( ) ? ) ) , :: ConstructorNumber ( 0x48870999 ) => Ok ( PageBlock :: pageBlockFooter ( _de . read_bare :: < :: mtproto :: pageBlockFooter > ( ) ? ) ) , :: ConstructorNumber ( 0xdb20b188 ) => Ok ( PageBlock :: pageBlockDivider ) , :: ConstructorNumber ( 0xce0d37b0 ) => Ok ( PageBlock :: pageBlockAnchor ( _de . read_bare :: < :: mtproto :: pageBlockAnchor > ( ) ? ) ) , :: ConstructorNumber ( 0x3a58c7f4 ) => Ok ( PageBlock :: pageBlockList ( _de . read_bare :: < :: mtproto :: pageBlockList > ( ) ? ) ) , :: ConstructorNumber ( 0x263d7c26 ) => Ok ( PageBlock :: pageBlockBlockquote ( _de . read_bare :: < :: mtproto :: pageBlockBlockquote > ( ) ? ) ) , :: ConstructorNumber ( 0x4f4456d3 ) => Ok ( PageBlock :: pageBlockPullquote ( _de . read_bare :: < :: mtproto :: pageBlockPullquote > ( ) ? ) ) , :: ConstructorNumber ( 0xe9c69982 ) => Ok ( PageBlock :: pageBlockPhoto ( _de . read_bare :: < :: mtproto :: pageBlockPhoto > ( ) ? ) ) , :: ConstructorNumber ( 0xd9d71866 ) => Ok ( PageBlock :: pageBlockVideo ( _de . read_bare :: < :: mtproto :: pageBlockVideo > ( ) ? ) ) , :: ConstructorNumber ( 0x39f23300 ) => Ok ( PageBlock :: pageBlockCover ( _de . read_bare :: < :: mtproto :: pageBlockCover > ( ) ? ) ) , :: ConstructorNumber ( 0xcde200d1 ) => Ok ( PageBlock :: pageBlockEmbed ( _de . read_bare :: < :: mtproto :: pageBlockEmbed > ( ) ? ) ) , :: ConstructorNumber ( 0x292c7be9 ) => Ok ( PageBlock :: pageBlockEmbedPost ( _de . read_bare :: < :: mtproto :: pageBlockEmbedPost > ( ) ? ) ) , :: ConstructorNumber ( 0x08b31c4f ) => Ok ( PageBlock :: pageBlockCollage ( _de . read_bare :: < :: mtproto :: pageBlockCollage > ( ) ? ) ) , :: ConstructorNumber ( 0x130c8963 ) => Ok ( PageBlock :: pageBlockSlideshow ( _de . read_bare :: < :: mtproto :: pageBlockSlideshow > ( ) ? ) ) , :: ConstructorNumber ( 0xef1751b5 ) => Ok ( PageBlock :: pageBlockChannel ( _de . read_bare :: < :: mtproto :: pageBlockChannel > ( ) ? ) ) , :: ConstructorNumber ( 0x31b81a7f ) => Ok ( PageBlock :: pageBlockAudio ( _de . read_bare :: < :: mtproto :: pageBlockAudio > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct pageBlockTitle { pub text : Box < :: mtproto :: RichText > , } impl :: BareSerialize for pageBlockTitle { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & pageBlockTitle { ref text } = self ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( text ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for pageBlockTitle { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( pageBlockTitle { text : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , } ) } } impl :: IntoBoxed for pageBlockTitle { type Boxed = PageBlock ; fn into_boxed ( self ) -> PageBlock { PageBlock :: pageBlockTitle ( self ) } } # [ derive ( Debug , Clone ) ] pub struct pageBlockSubtitle { pub text : Box < :: mtproto :: RichText > , } impl :: BareSerialize for pageBlockSubtitle { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & pageBlockSubtitle { ref text } = self ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( text ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for pageBlockSubtitle { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( pageBlockSubtitle { text : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , } ) } } impl :: IntoBoxed for pageBlockSubtitle { type Boxed = PageBlock ; fn into_boxed ( self ) -> PageBlock { PageBlock :: pageBlockSubtitle ( self ) } } # [ derive ( Debug , Clone ) ] pub struct pageBlockAuthorDate { pub author : Box < :: mtproto :: RichText > , pub published_date : :: mtproto :: int , } impl :: BareSerialize for pageBlockAuthorDate { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & pageBlockAuthorDate { ref author , ref published_date } = self ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( author ) ? ; _ser . write_bare :: < :: mtproto :: int > ( published_date ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for pageBlockAuthorDate { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( pageBlockAuthorDate { author : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , published_date : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for pageBlockAuthorDate { type Boxed = PageBlock ; fn into_boxed ( self ) -> PageBlock { PageBlock :: pageBlockAuthorDate ( self ) } } # [ derive ( Debug , Clone ) ] pub struct pageBlockHeader { pub text : Box < :: mtproto :: RichText > , } impl :: BareSerialize for pageBlockHeader { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & pageBlockHeader { ref text } = self ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( text ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for pageBlockHeader { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( pageBlockHeader { text : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , } ) } } impl :: IntoBoxed for pageBlockHeader { type Boxed = PageBlock ; fn into_boxed ( self ) -> PageBlock { PageBlock :: pageBlockHeader ( self ) } } # [ derive ( Debug , Clone ) ] pub struct pageBlockSubheader { pub text : Box < :: mtproto :: RichText > , } impl :: BareSerialize for pageBlockSubheader { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & pageBlockSubheader { ref text } = self ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( text ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for pageBlockSubheader { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( pageBlockSubheader { text : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , } ) } } impl :: IntoBoxed for pageBlockSubheader { type Boxed = PageBlock ; fn into_boxed ( self ) -> PageBlock { PageBlock :: pageBlockSubheader ( self ) } } # [ derive ( Debug , Clone ) ] pub struct pageBlockParagraph { pub text : Box < :: mtproto :: RichText > , } impl :: BareSerialize for pageBlockParagraph { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & pageBlockParagraph { ref text } = self ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( text ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for pageBlockParagraph { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( pageBlockParagraph { text : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , } ) } } impl :: IntoBoxed for pageBlockParagraph { type Boxed = PageBlock ; fn into_boxed ( self ) -> PageBlock { PageBlock :: pageBlockParagraph ( self ) } } # [ derive ( Debug , Clone ) ] pub struct pageBlockPreformatted { pub text : Box < :: mtproto :: RichText > , pub language : :: mtproto :: string , } impl :: BareSerialize for pageBlockPreformatted { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & pageBlockPreformatted { ref text , ref language } = self ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( text ) ? ; _ser . write_bare :: < :: mtproto :: string > ( language ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for pageBlockPreformatted { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( pageBlockPreformatted { text : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , language : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for pageBlockPreformatted { type Boxed = PageBlock ; fn into_boxed ( self ) -> PageBlock { PageBlock :: pageBlockPreformatted ( self ) } } # [ derive ( Debug , Clone ) ] pub struct pageBlockFooter { pub text : Box < :: mtproto :: RichText > , } impl :: BareSerialize for pageBlockFooter { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & pageBlockFooter { ref text } = self ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( text ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for pageBlockFooter { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( pageBlockFooter { text : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , } ) } } impl :: IntoBoxed for pageBlockFooter { type Boxed = PageBlock ; fn into_boxed ( self ) -> PageBlock { PageBlock :: pageBlockFooter ( self ) } } # [ derive ( Debug , Clone ) ] pub struct pageBlockAnchor { pub name : :: mtproto :: string , } impl :: BareSerialize for pageBlockAnchor { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & pageBlockAnchor { ref name } = self ; _ser . write_bare :: < :: mtproto :: string > ( name ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for pageBlockAnchor { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( pageBlockAnchor { name : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for pageBlockAnchor { type Boxed = PageBlock ; fn into_boxed ( self ) -> PageBlock { PageBlock :: pageBlockAnchor ( self ) } } # [ derive ( Debug , Clone ) ] pub struct pageBlockList { pub ordered : :: mtproto :: Bool , pub items : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: RichText > , } impl :: BareSerialize for pageBlockList { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & pageBlockList { 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 pageBlockList { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( pageBlockList { ordered : _de . read_boxed :: < :: mtproto :: Bool > ( ) ? , items : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: RichText > > ( ) ? , } ) } } impl :: IntoBoxed for pageBlockList { type Boxed = PageBlock ; fn into_boxed ( self ) -> PageBlock { PageBlock :: pageBlockList ( self ) } } # [ derive ( Debug , Clone ) ] pub struct pageBlockBlockquote { pub text : Box < :: mtproto :: RichText > , pub caption : Box < :: mtproto :: RichText > , } impl :: BareSerialize for pageBlockBlockquote { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & pageBlockBlockquote { ref text , ref caption } = self ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( text ) ? ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( caption ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for pageBlockBlockquote { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( pageBlockBlockquote { text : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , caption : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , } ) } } impl :: IntoBoxed for pageBlockBlockquote { type Boxed = PageBlock ; fn into_boxed ( self ) -> PageBlock { PageBlock :: pageBlockBlockquote ( self ) } } # [ derive ( Debug , Clone ) ] pub struct pageBlockPullquote { pub text : Box < :: mtproto :: RichText > , pub caption : Box < :: mtproto :: RichText > , } impl :: BareSerialize for pageBlockPullquote { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & pageBlockPullquote { ref text , ref caption } = self ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( text ) ? ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( caption ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for pageBlockPullquote { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( pageBlockPullquote { text : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , caption : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , } ) } } impl :: IntoBoxed for pageBlockPullquote { type Boxed = PageBlock ; fn into_boxed ( self ) -> PageBlock { PageBlock :: pageBlockPullquote ( self ) } } # [ derive ( Debug , Clone ) ] pub struct pageBlockPhoto { pub photo_id : :: mtproto :: long , pub caption : Box < :: mtproto :: RichText > , } impl :: BareSerialize for pageBlockPhoto { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & pageBlockPhoto { ref photo_id , ref caption } = self ; _ser . write_bare :: < :: mtproto :: long > ( photo_id ) ? ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( caption ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for pageBlockPhoto { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( pageBlockPhoto { photo_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , caption : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , } ) } } impl :: IntoBoxed for pageBlockPhoto { type Boxed = PageBlock ; fn into_boxed ( self ) -> PageBlock { PageBlock :: pageBlockPhoto ( self ) } } # [ derive ( Debug , Clone ) ] pub struct pageBlockVideo { pub autoplay : bool , pub loop_ : bool , pub video_id : :: mtproto :: long , pub caption : Box < :: mtproto :: RichText > , } impl :: BareSerialize for pageBlockVideo { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & pageBlockVideo { 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 pageBlockVideo { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( pageBlockVideo { 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 pageBlockVideo { type Boxed = PageBlock ; fn into_boxed ( self ) -> PageBlock { PageBlock :: pageBlockVideo ( self ) } } # [ derive ( Debug , Clone ) ] pub struct pageBlockCover { pub cover : Box < :: mtproto :: PageBlock > , } impl :: BareSerialize for pageBlockCover { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & pageBlockCover { ref cover } = self ; _ser . write_boxed :: < Box < :: mtproto :: PageBlock > > ( cover ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for pageBlockCover { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( pageBlockCover { cover : _de . read_boxed :: < Box < :: mtproto :: PageBlock > > ( ) ? , } ) } } impl :: IntoBoxed for pageBlockCover { type Boxed = PageBlock ; fn into_boxed ( self ) -> PageBlock { PageBlock :: pageBlockCover ( self ) } } # [ derive ( Debug , Clone ) ] pub struct pageBlockEmbed { 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 pageBlockEmbed { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & pageBlockEmbed { 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 pageBlockEmbed { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( pageBlockEmbed { 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 pageBlockEmbed { type Boxed = PageBlock ; fn into_boxed ( self ) -> PageBlock { PageBlock :: pageBlockEmbed ( self ) } } # [ derive ( Debug , Clone ) ] pub struct pageBlockEmbedPost { 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 pageBlockEmbedPost { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & pageBlockEmbedPost { 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 pageBlockEmbedPost { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( pageBlockEmbedPost { 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 pageBlockEmbedPost { type Boxed = PageBlock ; fn into_boxed ( self ) -> PageBlock { PageBlock :: pageBlockEmbedPost ( self ) } } # [ derive ( Debug , Clone ) ] pub struct pageBlockCollage { pub items : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PageBlock > , pub caption : Box < :: mtproto :: RichText > , } impl :: BareSerialize for pageBlockCollage { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & pageBlockCollage { 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 pageBlockCollage { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( pageBlockCollage { items : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PageBlock > > ( ) ? , caption : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , } ) } } impl :: IntoBoxed for pageBlockCollage { type Boxed = PageBlock ; fn into_boxed ( self ) -> PageBlock { PageBlock :: pageBlockCollage ( self ) } } # [ derive ( Debug , Clone ) ] pub struct pageBlockSlideshow { pub items : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PageBlock > , pub caption : Box < :: mtproto :: RichText > , } impl :: BareSerialize for pageBlockSlideshow { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & pageBlockSlideshow { 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 pageBlockSlideshow { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( pageBlockSlideshow { items : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PageBlock > > ( ) ? , caption : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , } ) } } impl :: IntoBoxed for pageBlockSlideshow { type Boxed = PageBlock ; fn into_boxed ( self ) -> PageBlock { PageBlock :: pageBlockSlideshow ( self ) } } # [ derive ( Debug , Clone ) ] pub struct pageBlockChannel { pub channel : :: mtproto :: Chat , } impl :: BareSerialize for pageBlockChannel { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & pageBlockChannel { ref channel } = self ; _ser . write_boxed :: < :: mtproto :: Chat > ( channel ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for pageBlockChannel { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( pageBlockChannel { channel : _de . read_boxed :: < :: mtproto :: Chat > ( ) ? , } ) } } impl :: IntoBoxed for pageBlockChannel { type Boxed = PageBlock ; fn into_boxed ( self ) -> PageBlock { PageBlock :: pageBlockChannel ( self ) } } # [ derive ( Debug , Clone ) ] pub struct pageBlockAudio { pub audio_id : :: mtproto :: long , pub caption : Box < :: mtproto :: RichText > , } impl :: BareSerialize for pageBlockAudio { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & pageBlockAudio { ref audio_id , ref caption } = self ; _ser . write_bare :: < :: mtproto :: long > ( audio_id ) ? ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( caption ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for pageBlockAudio { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( pageBlockAudio { audio_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , caption : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , } ) } } impl :: IntoBoxed for pageBlockAudio { type Boxed = PageBlock ; fn into_boxed ( self ) -> PageBlock { PageBlock :: pageBlockAudio ( self ) } } # [ derive ( Debug , Clone ) ] pub enum PaymentCharge { paymentCharge ( paymentCharge ) , } 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 :: paymentCharge > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = PaymentCharge ; fn into_boxed ( self ) -> PaymentCharge { PaymentCharge :: paymentCharge ( self ) } } # [ derive ( Debug , Clone ) ] pub enum PaymentRequestedInfo { paymentRequestedInfo ( paymentRequestedInfo ) , } 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 :: paymentRequestedInfo > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = PaymentRequestedInfo ; fn into_boxed ( self ) -> PaymentRequestedInfo { PaymentRequestedInfo :: paymentRequestedInfo ( self ) } } # [ derive ( Debug , Clone ) ] pub enum PaymentSavedCredentials { paymentSavedCredentialsCard ( paymentSavedCredentialsCard ) , } 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 :: paymentSavedCredentialsCard > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = PaymentSavedCredentials ; fn into_boxed ( self ) -> PaymentSavedCredentials { PaymentSavedCredentials :: paymentSavedCredentialsCard ( self ) } } # [ derive ( Debug , Clone ) ] pub enum Peer { peerUser ( peerUser ) , peerChat ( peerChat ) , peerChannel ( peerChannel ) , } impl :: BoxedSerialize for Peer { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Peer :: peerUser ( ref x ) => ( :: ConstructorNumber ( 0x9db1bc6d ) , x ) , & Peer :: peerChat ( ref x ) => ( :: ConstructorNumber ( 0xbad0e5bb ) , x ) , & Peer :: peerChannel ( 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 :: peerUser ( _de . read_bare :: < :: mtproto :: peerUser > ( ) ? ) ) , :: ConstructorNumber ( 0xbad0e5bb ) => Ok ( Peer :: peerChat ( _de . read_bare :: < :: mtproto :: peerChat > ( ) ? ) ) , :: ConstructorNumber ( 0xbddde532 ) => Ok ( Peer :: peerChannel ( _de . read_bare :: < :: mtproto :: peerChannel > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct peerUser { pub user_id : :: mtproto :: int , } impl :: BareSerialize for peerUser { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & peerUser { ref user_id } = self ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for peerUser { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( peerUser { user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for peerUser { type Boxed = Peer ; fn into_boxed ( self ) -> Peer { Peer :: peerUser ( self ) } } # [ derive ( Debug , Clone ) ] pub struct peerChat { pub chat_id : :: mtproto :: int , } impl :: BareSerialize for peerChat { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & peerChat { ref chat_id } = self ; _ser . write_bare :: < :: mtproto :: int > ( chat_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for peerChat { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( peerChat { chat_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for peerChat { type Boxed = Peer ; fn into_boxed ( self ) -> Peer { Peer :: peerChat ( self ) } } # [ derive ( Debug , Clone ) ] pub struct peerChannel { pub channel_id : :: mtproto :: int , } impl :: BareSerialize for peerChannel { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & peerChannel { ref channel_id } = self ; _ser . write_bare :: < :: mtproto :: int > ( channel_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for peerChannel { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( peerChannel { channel_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for peerChannel { type Boxed = Peer ; fn into_boxed ( self ) -> Peer { Peer :: peerChannel ( self ) } } # [ derive ( Debug , Clone ) ] pub enum PeerNotifyEvents { peerNotifyEventsEmpty , peerNotifyEventsAll , } impl :: BoxedSerialize for PeerNotifyEvents { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & PeerNotifyEvents :: peerNotifyEventsEmpty => ( :: ConstructorNumber ( 0xadd53cb3 ) , & ( ) ) , & PeerNotifyEvents :: peerNotifyEventsAll => ( :: 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 :: peerNotifyEventsEmpty ) , :: ConstructorNumber ( 0x6d1ded88 ) => Ok ( PeerNotifyEvents :: peerNotifyEventsAll ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub enum PeerNotifySettings { peerNotifySettingsEmpty , peerNotifySettings ( peerNotifySettings ) , } impl :: BoxedSerialize for PeerNotifySettings { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & PeerNotifySettings :: peerNotifySettingsEmpty => ( :: 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 :: peerNotifySettingsEmpty ) , :: ConstructorNumber ( 0x9acda4c0 ) => Ok ( PeerNotifySettings :: peerNotifySettings ( _de . read_bare :: < :: mtproto :: peerNotifySettings > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = PeerNotifySettings ; fn into_boxed ( self ) -> PeerNotifySettings { PeerNotifySettings :: peerNotifySettings ( self ) } } # [ derive ( Debug , Clone ) ] pub enum PeerSettings { peerSettings ( peerSettings ) , } 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 :: peerSettings > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = PeerSettings ; fn into_boxed ( self ) -> PeerSettings { PeerSettings :: peerSettings ( self ) } } # [ derive ( Debug , Clone ) ] pub enum PhoneCall { phoneCallEmpty ( phoneCallEmpty ) , phoneCallWaiting ( phoneCallWaiting ) , phoneCallRequested ( phoneCallRequested ) , phoneCallAccepted ( phoneCallAccepted ) , phoneCall ( phoneCall ) , phoneCallDiscarded ( phoneCallDiscarded ) , } impl :: BoxedSerialize for PhoneCall { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & PhoneCall :: phoneCallEmpty ( ref x ) => ( :: ConstructorNumber ( 0x5366c915 ) , x ) , & PhoneCall :: phoneCallWaiting ( ref x ) => ( :: ConstructorNumber ( 0x1b8f4ad1 ) , x ) , & PhoneCall :: phoneCallRequested ( ref x ) => ( :: ConstructorNumber ( 0x83761ce4 ) , x ) , & PhoneCall :: phoneCallAccepted ( ref x ) => ( :: ConstructorNumber ( 0x6d003d3f ) , x ) , & PhoneCall :: phoneCall ( ref x ) => ( :: ConstructorNumber ( 0xffe6ab67 ) , x ) , & PhoneCall :: phoneCallDiscarded ( 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 :: phoneCallEmpty ( _de . read_bare :: < :: mtproto :: phoneCallEmpty > ( ) ? ) ) , :: ConstructorNumber ( 0x1b8f4ad1 ) => Ok ( PhoneCall :: phoneCallWaiting ( _de . read_bare :: < :: mtproto :: phoneCallWaiting > ( ) ? ) ) , :: ConstructorNumber ( 0x83761ce4 ) => Ok ( PhoneCall :: phoneCallRequested ( _de . read_bare :: < :: mtproto :: phoneCallRequested > ( ) ? ) ) , :: ConstructorNumber ( 0x6d003d3f ) => Ok ( PhoneCall :: phoneCallAccepted ( _de . read_bare :: < :: mtproto :: phoneCallAccepted > ( ) ? ) ) , :: ConstructorNumber ( 0xffe6ab67 ) => Ok ( PhoneCall :: phoneCall ( _de . read_bare :: < :: mtproto :: phoneCall > ( ) ? ) ) , :: ConstructorNumber ( 0x50ca4de1 ) => Ok ( PhoneCall :: phoneCallDiscarded ( _de . read_bare :: < :: mtproto :: phoneCallDiscarded > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct phoneCallEmpty { pub id : :: mtproto :: long , } impl :: BareSerialize for phoneCallEmpty { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & phoneCallEmpty { ref id } = self ; _ser . write_bare :: < :: mtproto :: long > ( id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for phoneCallEmpty { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( phoneCallEmpty { id : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for phoneCallEmpty { type Boxed = PhoneCall ; fn into_boxed ( self ) -> PhoneCall { PhoneCall :: phoneCallEmpty ( self ) } } # [ derive ( Debug , Clone ) ] pub struct phoneCallWaiting { 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 phoneCallWaiting { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & phoneCallWaiting { 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 phoneCallWaiting { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( phoneCallWaiting { 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 phoneCallWaiting { type Boxed = PhoneCall ; fn into_boxed ( self ) -> PhoneCall { PhoneCall :: phoneCallWaiting ( self ) } } # [ derive ( Debug , Clone ) ] pub struct phoneCallRequested { 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 phoneCallRequested { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & phoneCallRequested { 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 phoneCallRequested { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( phoneCallRequested { 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 phoneCallRequested { type Boxed = PhoneCall ; fn into_boxed ( self ) -> PhoneCall { PhoneCall :: phoneCallRequested ( self ) } } # [ derive ( Debug , Clone ) ] pub struct phoneCallAccepted { 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 phoneCallAccepted { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & phoneCallAccepted { 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 phoneCallAccepted { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( phoneCallAccepted { 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 phoneCallAccepted { type Boxed = PhoneCall ; fn into_boxed ( self ) -> PhoneCall { PhoneCall :: phoneCallAccepted ( self ) } } # [ derive ( Debug , Clone ) ] 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 = PhoneCall ; fn into_boxed ( self ) -> PhoneCall { PhoneCall :: phoneCall ( self ) } } # [ derive ( Debug , Clone ) ] pub struct phoneCallDiscarded { 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 phoneCallDiscarded { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & phoneCallDiscarded { 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 phoneCallDiscarded { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( phoneCallDiscarded { 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 phoneCallDiscarded { type Boxed = PhoneCall ; fn into_boxed ( self ) -> PhoneCall { PhoneCall :: phoneCallDiscarded ( self ) } } # [ derive ( Debug , Clone ) ] pub enum PhoneCallDiscardReason { phoneCallDiscardReasonMissed , phoneCallDiscardReasonDisconnect , phoneCallDiscardReasonHangup , phoneCallDiscardReasonBusy , } impl :: BoxedSerialize for PhoneCallDiscardReason { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & PhoneCallDiscardReason :: phoneCallDiscardReasonMissed => ( :: ConstructorNumber ( 0x85e42301 ) , & ( ) ) , & PhoneCallDiscardReason :: phoneCallDiscardReasonDisconnect => ( :: ConstructorNumber ( 0xe095c1a0 ) , & ( ) ) , & PhoneCallDiscardReason :: phoneCallDiscardReasonHangup => ( :: ConstructorNumber ( 0x57adc690 ) , & ( ) ) , & PhoneCallDiscardReason :: phoneCallDiscardReasonBusy => ( :: 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 :: phoneCallDiscardReasonMissed ) , :: ConstructorNumber ( 0xe095c1a0 ) => Ok ( PhoneCallDiscardReason :: phoneCallDiscardReasonDisconnect ) , :: ConstructorNumber ( 0x57adc690 ) => Ok ( PhoneCallDiscardReason :: phoneCallDiscardReasonHangup ) , :: ConstructorNumber ( 0xfaf7e8c9 ) => Ok ( PhoneCallDiscardReason :: phoneCallDiscardReasonBusy ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub enum PhoneCallProtocol { phoneCallProtocol ( phoneCallProtocol ) , } 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 :: phoneCallProtocol > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = PhoneCallProtocol ; fn into_boxed ( self ) -> PhoneCallProtocol { PhoneCallProtocol :: phoneCallProtocol ( self ) } } # [ derive ( Debug , Clone ) ] pub enum PhoneConnection { phoneConnection ( phoneConnection ) , } 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 :: phoneConnection > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = PhoneConnection ; fn into_boxed ( self ) -> PhoneConnection { PhoneConnection :: phoneConnection ( self ) } } # [ derive ( Debug , Clone ) ] pub enum Photo { photoEmpty ( photoEmpty ) , photo ( photo ) , } impl :: BoxedSerialize for Photo { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Photo :: photoEmpty ( 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 :: photoEmpty ( _de . read_bare :: < :: mtproto :: photoEmpty > ( ) ? ) ) , :: ConstructorNumber ( 0x9288dd29 ) => Ok ( Photo :: photo ( _de . read_bare :: < :: mtproto :: photo > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct photoEmpty { pub id : :: mtproto :: long , } impl :: BareSerialize for photoEmpty { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & photoEmpty { ref id } = self ; _ser . write_bare :: < :: mtproto :: long > ( id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for photoEmpty { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( photoEmpty { id : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for photoEmpty { type Boxed = Photo ; fn into_boxed ( self ) -> Photo { Photo :: photoEmpty ( self ) } } # [ derive ( Debug , Clone ) ] 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 = Photo ; fn into_boxed ( self ) -> Photo { Photo :: photo ( self ) } } # [ derive ( Debug , Clone ) ] pub enum PhotoSize { photoSizeEmpty ( photoSizeEmpty ) , photoSize ( photoSize ) , photoCachedSize ( photoCachedSize ) , } impl :: BoxedSerialize for PhotoSize { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & PhotoSize :: photoSizeEmpty ( ref x ) => ( :: ConstructorNumber ( 0x0e17e23c ) , x ) , & PhotoSize :: photoSize ( ref x ) => ( :: ConstructorNumber ( 0x77bfb61b ) , x ) , & PhotoSize :: photoCachedSize ( 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 :: photoSizeEmpty ( _de . read_bare :: < :: mtproto :: photoSizeEmpty > ( ) ? ) ) , :: ConstructorNumber ( 0x77bfb61b ) => Ok ( PhotoSize :: photoSize ( _de . read_bare :: < :: mtproto :: photoSize > ( ) ? ) ) , :: ConstructorNumber ( 0xe9a734fa ) => Ok ( PhotoSize :: photoCachedSize ( _de . read_bare :: < :: mtproto :: photoCachedSize > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct photoSizeEmpty { pub type_ : :: mtproto :: string , } impl :: BareSerialize for photoSizeEmpty { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & photoSizeEmpty { ref type_ } = self ; _ser . write_bare :: < :: mtproto :: string > ( type_ ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for photoSizeEmpty { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( photoSizeEmpty { type_ : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for photoSizeEmpty { type Boxed = PhotoSize ; fn into_boxed ( self ) -> PhotoSize { PhotoSize :: photoSizeEmpty ( self ) } } # [ derive ( Debug , Clone ) ] pub struct photoSize { pub type_ : :: mtproto :: string , pub location : :: mtproto :: FileLocation , pub w : :: mtproto :: int , pub h : :: mtproto :: int , pub size : :: mtproto :: int , } impl :: BareSerialize for photoSize { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & photoSize { 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 photoSize { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( photoSize { 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 photoSize { type Boxed = PhotoSize ; fn into_boxed ( self ) -> PhotoSize { PhotoSize :: photoSize ( self ) } } # [ derive ( Debug , Clone ) ] pub struct photoCachedSize { pub type_ : :: mtproto :: string , pub location : :: mtproto :: FileLocation , pub w : :: mtproto :: int , pub h : :: mtproto :: int , pub bytes : :: mtproto :: bytes , } impl :: BareSerialize for photoCachedSize { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & photoCachedSize { 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 photoCachedSize { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( photoCachedSize { 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 photoCachedSize { type Boxed = PhotoSize ; fn into_boxed ( self ) -> PhotoSize { PhotoSize :: photoCachedSize ( self ) } } # [ derive ( Debug , Clone ) ] pub enum Pong { pong ( pong ) , } 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 > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = Pong ; fn into_boxed ( self ) -> Pong { Pong :: pong ( self ) } } # [ derive ( Debug , Clone ) ] pub enum PopularContact { popularContact ( popularContact ) , } 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 :: popularContact > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = PopularContact ; fn into_boxed ( self ) -> PopularContact { PopularContact :: popularContact ( self ) } } # [ derive ( Debug , Clone ) ] pub enum PostAddress { postAddress ( postAddress ) , } 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 :: postAddress > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = PostAddress ; fn into_boxed ( self ) -> PostAddress { PostAddress :: postAddress ( self ) } } # [ derive ( Debug , Clone ) ] pub enum PrivacyKey { privacyKeyStatusTimestamp , privacyKeyChatInvite , privacyKeyPhoneCall , } impl :: BoxedSerialize for PrivacyKey { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & PrivacyKey :: privacyKeyStatusTimestamp => ( :: ConstructorNumber ( 0xbc2eab30 ) , & ( ) ) , & PrivacyKey :: privacyKeyChatInvite => ( :: ConstructorNumber ( 0x500e6dfa ) , & ( ) ) , & PrivacyKey :: privacyKeyPhoneCall => ( :: 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 :: privacyKeyStatusTimestamp ) , :: ConstructorNumber ( 0x500e6dfa ) => Ok ( PrivacyKey :: privacyKeyChatInvite ) , :: ConstructorNumber ( 0x3d662b7b ) => Ok ( PrivacyKey :: privacyKeyPhoneCall ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub enum PrivacyRule { privacyValueAllowContacts , privacyValueAllowAll , privacyValueAllowUsers ( privacyValueAllowUsers ) , privacyValueDisallowContacts , privacyValueDisallowAll , privacyValueDisallowUsers ( privacyValueDisallowUsers ) , } impl :: BoxedSerialize for PrivacyRule { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & PrivacyRule :: privacyValueAllowContacts => ( :: ConstructorNumber ( 0xfffe1bac ) , & ( ) ) , & PrivacyRule :: privacyValueAllowAll => ( :: ConstructorNumber ( 0x65427b82 ) , & ( ) ) , & PrivacyRule :: privacyValueAllowUsers ( ref x ) => ( :: ConstructorNumber ( 0x4d5bbe0c ) , x ) , & PrivacyRule :: privacyValueDisallowContacts => ( :: ConstructorNumber ( 0xf888fa1a ) , & ( ) ) , & PrivacyRule :: privacyValueDisallowAll => ( :: ConstructorNumber ( 0x8b73e763 ) , & ( ) ) , & PrivacyRule :: privacyValueDisallowUsers ( 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 :: privacyValueAllowContacts ) , :: ConstructorNumber ( 0x65427b82 ) => Ok ( PrivacyRule :: privacyValueAllowAll ) , :: ConstructorNumber ( 0x4d5bbe0c ) => Ok ( PrivacyRule :: privacyValueAllowUsers ( _de . read_bare :: < :: mtproto :: privacyValueAllowUsers > ( ) ? ) ) , :: ConstructorNumber ( 0xf888fa1a ) => Ok ( PrivacyRule :: privacyValueDisallowContacts ) , :: ConstructorNumber ( 0x8b73e763 ) => Ok ( PrivacyRule :: privacyValueDisallowAll ) , :: ConstructorNumber ( 0x0c7f49b7 ) => Ok ( PrivacyRule :: privacyValueDisallowUsers ( _de . read_bare :: < :: mtproto :: privacyValueDisallowUsers > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct privacyValueAllowUsers { pub users : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > , } impl :: BareSerialize for privacyValueAllowUsers { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & privacyValueAllowUsers { ref users } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > > ( users ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for privacyValueAllowUsers { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( privacyValueAllowUsers { users : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > > ( ) ? , } ) } } impl :: IntoBoxed for privacyValueAllowUsers { type Boxed = PrivacyRule ; fn into_boxed ( self ) -> PrivacyRule { PrivacyRule :: privacyValueAllowUsers ( self ) } } # [ derive ( Debug , Clone ) ] pub struct privacyValueDisallowUsers { pub users : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > , } impl :: BareSerialize for privacyValueDisallowUsers { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & privacyValueDisallowUsers { ref users } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > > ( users ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for privacyValueDisallowUsers { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( privacyValueDisallowUsers { users : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > > ( ) ? , } ) } } impl :: IntoBoxed for privacyValueDisallowUsers { type Boxed = PrivacyRule ; fn into_boxed ( self ) -> PrivacyRule { PrivacyRule :: privacyValueDisallowUsers ( self ) } } # [ derive ( Debug , Clone ) ] pub enum ReceivedNotifyMessage { receivedNotifyMessage ( receivedNotifyMessage ) , } 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 :: receivedNotifyMessage > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = ReceivedNotifyMessage ; fn into_boxed ( self ) -> ReceivedNotifyMessage { ReceivedNotifyMessage :: receivedNotifyMessage ( self ) } } # [ derive ( Debug , Clone ) ] pub enum RecentMeUrl { recentMeUrlUnknown ( recentMeUrlUnknown ) , recentMeUrlUser ( recentMeUrlUser ) , recentMeUrlChat ( recentMeUrlChat ) , recentMeUrlChatInvite ( recentMeUrlChatInvite ) , recentMeUrlStickerSet ( recentMeUrlStickerSet ) , } impl :: BoxedSerialize for RecentMeUrl { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & RecentMeUrl :: recentMeUrlUnknown ( ref x ) => ( :: ConstructorNumber ( 0x46e1d13d ) , x ) , & RecentMeUrl :: recentMeUrlUser ( ref x ) => ( :: ConstructorNumber ( 0x8dbc3336 ) , x ) , & RecentMeUrl :: recentMeUrlChat ( ref x ) => ( :: ConstructorNumber ( 0xa01b22f9 ) , x ) , & RecentMeUrl :: recentMeUrlChatInvite ( ref x ) => ( :: ConstructorNumber ( 0xeb49081d ) , x ) , & RecentMeUrl :: recentMeUrlStickerSet ( 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 :: recentMeUrlUnknown ( _de . read_bare :: < :: mtproto :: recentMeUrlUnknown > ( ) ? ) ) , :: ConstructorNumber ( 0x8dbc3336 ) => Ok ( RecentMeUrl :: recentMeUrlUser ( _de . read_bare :: < :: mtproto :: recentMeUrlUser > ( ) ? ) ) , :: ConstructorNumber ( 0xa01b22f9 ) => Ok ( RecentMeUrl :: recentMeUrlChat ( _de . read_bare :: < :: mtproto :: recentMeUrlChat > ( ) ? ) ) , :: ConstructorNumber ( 0xeb49081d ) => Ok ( RecentMeUrl :: recentMeUrlChatInvite ( _de . read_bare :: < :: mtproto :: recentMeUrlChatInvite > ( ) ? ) ) , :: ConstructorNumber ( 0xbc0a57dc ) => Ok ( RecentMeUrl :: recentMeUrlStickerSet ( _de . read_bare :: < :: mtproto :: recentMeUrlStickerSet > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct recentMeUrlUnknown { pub url : :: mtproto :: string , } impl :: BareSerialize for recentMeUrlUnknown { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & recentMeUrlUnknown { ref url } = self ; _ser . write_bare :: < :: mtproto :: string > ( url ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for recentMeUrlUnknown { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( recentMeUrlUnknown { url : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for recentMeUrlUnknown { type Boxed = RecentMeUrl ; fn into_boxed ( self ) -> RecentMeUrl { RecentMeUrl :: recentMeUrlUnknown ( self ) } } # [ derive ( Debug , Clone ) ] pub struct recentMeUrlUser { pub url : :: mtproto :: string , pub user_id : :: mtproto :: int , } impl :: BareSerialize for recentMeUrlUser { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & recentMeUrlUser { ref url , ref user_id } = self ; _ser . write_bare :: < :: mtproto :: string > ( url ) ? ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for recentMeUrlUser { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( recentMeUrlUser { url : _de . read_bare :: < :: mtproto :: string > ( ) ? , user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for recentMeUrlUser { type Boxed = RecentMeUrl ; fn into_boxed ( self ) -> RecentMeUrl { RecentMeUrl :: recentMeUrlUser ( self ) } } # [ derive ( Debug , Clone ) ] pub struct recentMeUrlChat { pub url : :: mtproto :: string , pub chat_id : :: mtproto :: int , } impl :: BareSerialize for recentMeUrlChat { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & recentMeUrlChat { ref url , ref chat_id } = self ; _ser . write_bare :: < :: mtproto :: string > ( url ) ? ; _ser . write_bare :: < :: mtproto :: int > ( chat_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for recentMeUrlChat { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( recentMeUrlChat { url : _de . read_bare :: < :: mtproto :: string > ( ) ? , chat_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for recentMeUrlChat { type Boxed = RecentMeUrl ; fn into_boxed ( self ) -> RecentMeUrl { RecentMeUrl :: recentMeUrlChat ( self ) } } # [ derive ( Debug , Clone ) ] pub struct recentMeUrlChatInvite { pub url : :: mtproto :: string , pub chat_invite : :: mtproto :: ChatInvite , } impl :: BareSerialize for recentMeUrlChatInvite { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & recentMeUrlChatInvite { ref url , ref chat_invite } = self ; _ser . write_bare :: < :: mtproto :: string > ( url ) ? ; _ser . write_boxed :: < :: mtproto :: ChatInvite > ( chat_invite ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for recentMeUrlChatInvite { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( recentMeUrlChatInvite { url : _de . read_bare :: < :: mtproto :: string > ( ) ? , chat_invite : _de . read_boxed :: < :: mtproto :: ChatInvite > ( ) ? , } ) } } impl :: IntoBoxed for recentMeUrlChatInvite { type Boxed = RecentMeUrl ; fn into_boxed ( self ) -> RecentMeUrl { RecentMeUrl :: recentMeUrlChatInvite ( self ) } } # [ derive ( Debug , Clone ) ] pub struct recentMeUrlStickerSet { pub url : :: mtproto :: string , pub set : :: mtproto :: StickerSetCovered , } impl :: BareSerialize for recentMeUrlStickerSet { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & recentMeUrlStickerSet { ref url , ref set } = self ; _ser . write_bare :: < :: mtproto :: string > ( url ) ? ; _ser . write_boxed :: < :: mtproto :: StickerSetCovered > ( set ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for recentMeUrlStickerSet { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( recentMeUrlStickerSet { url : _de . read_bare :: < :: mtproto :: string > ( ) ? , set : _de . read_boxed :: < :: mtproto :: StickerSetCovered > ( ) ? , } ) } } impl :: IntoBoxed for recentMeUrlStickerSet { type Boxed = RecentMeUrl ; fn into_boxed ( self ) -> RecentMeUrl { RecentMeUrl :: recentMeUrlStickerSet ( self ) } } # [ derive ( Debug , Clone ) ] pub enum ReplyMarkup { replyKeyboardHide ( replyKeyboardHide ) , replyKeyboardForceReply ( replyKeyboardForceReply ) , replyKeyboardMarkup ( replyKeyboardMarkup ) , replyInlineMarkup ( replyInlineMarkup ) , } impl :: BoxedSerialize for ReplyMarkup { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ReplyMarkup :: replyKeyboardHide ( ref x ) => ( :: ConstructorNumber ( 0xa03e5b85 ) , x ) , & ReplyMarkup :: replyKeyboardForceReply ( ref x ) => ( :: ConstructorNumber ( 0xf4108aa0 ) , x ) , & ReplyMarkup :: replyKeyboardMarkup ( ref x ) => ( :: ConstructorNumber ( 0x3502758c ) , x ) , & ReplyMarkup :: replyInlineMarkup ( 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 :: replyKeyboardHide ( _de . read_bare :: < :: mtproto :: replyKeyboardHide > ( ) ? ) ) , :: ConstructorNumber ( 0xf4108aa0 ) => Ok ( ReplyMarkup :: replyKeyboardForceReply ( _de . read_bare :: < :: mtproto :: replyKeyboardForceReply > ( ) ? ) ) , :: ConstructorNumber ( 0x3502758c ) => Ok ( ReplyMarkup :: replyKeyboardMarkup ( _de . read_bare :: < :: mtproto :: replyKeyboardMarkup > ( ) ? ) ) , :: ConstructorNumber ( 0x48a30254 ) => Ok ( ReplyMarkup :: replyInlineMarkup ( _de . read_bare :: < :: mtproto :: replyInlineMarkup > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct replyKeyboardHide { pub selective : bool , } impl :: BareSerialize for replyKeyboardHide { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & replyKeyboardHide { selective } = self ; let mut flags = 0i32 ; if selective { flags |= 1 << 2u32 ; } _ser . write_bare :: < :: mtproto :: Flags > ( & flags ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for replyKeyboardHide { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( replyKeyboardHide { selective : { flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; flags & ( 1 << 2u32 ) != 0 } , } ) } } impl :: IntoBoxed for replyKeyboardHide { type Boxed = ReplyMarkup ; fn into_boxed ( self ) -> ReplyMarkup { ReplyMarkup :: replyKeyboardHide ( self ) } } # [ derive ( Debug , Clone ) ] pub struct replyKeyboardForceReply { pub single_use : bool , pub selective : bool , } impl :: BareSerialize for replyKeyboardForceReply { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & replyKeyboardForceReply { 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 replyKeyboardForceReply { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( replyKeyboardForceReply { single_use : { flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; flags & ( 1 << 1u32 ) != 0 } , selective : flags & ( 1 << 2u32 ) != 0 , } ) } } impl :: IntoBoxed for replyKeyboardForceReply { type Boxed = ReplyMarkup ; fn into_boxed ( self ) -> ReplyMarkup { ReplyMarkup :: replyKeyboardForceReply ( self ) } } # [ derive ( Debug , Clone ) ] pub struct replyKeyboardMarkup { pub resize : bool , pub single_use : bool , pub selective : bool , pub rows : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: KeyboardButtonRow > , } impl :: BareSerialize for replyKeyboardMarkup { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & replyKeyboardMarkup { 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 replyKeyboardMarkup { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( replyKeyboardMarkup { 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 replyKeyboardMarkup { type Boxed = ReplyMarkup ; fn into_boxed ( self ) -> ReplyMarkup { ReplyMarkup :: replyKeyboardMarkup ( self ) } } # [ derive ( Debug , Clone ) ] pub struct replyInlineMarkup { pub rows : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: KeyboardButtonRow > , } impl :: BareSerialize for replyInlineMarkup { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & replyInlineMarkup { ref rows } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: KeyboardButtonRow > > ( rows ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for replyInlineMarkup { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( replyInlineMarkup { rows : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: KeyboardButtonRow > > ( ) ? , } ) } } impl :: IntoBoxed for replyInlineMarkup { type Boxed = ReplyMarkup ; fn into_boxed ( self ) -> ReplyMarkup { ReplyMarkup :: replyInlineMarkup ( self ) } } # [ derive ( Debug , Clone ) ] pub enum ReportReason { inputReportReasonSpam , inputReportReasonViolence , inputReportReasonPornography , inputReportReasonOther ( inputReportReasonOther ) , } impl :: BoxedSerialize for ReportReason { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ReportReason :: inputReportReasonSpam => ( :: ConstructorNumber ( 0x58dbcab8 ) , & ( ) ) , & ReportReason :: inputReportReasonViolence => ( :: ConstructorNumber ( 0x1e22c78d ) , & ( ) ) , & ReportReason :: inputReportReasonPornography => ( :: ConstructorNumber ( 0x2e59d922 ) , & ( ) ) , & ReportReason :: inputReportReasonOther ( 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 :: inputReportReasonSpam ) , :: ConstructorNumber ( 0x1e22c78d ) => Ok ( ReportReason :: inputReportReasonViolence ) , :: ConstructorNumber ( 0x2e59d922 ) => Ok ( ReportReason :: inputReportReasonPornography ) , :: ConstructorNumber ( 0xe1746d0a ) => Ok ( ReportReason :: inputReportReasonOther ( _de . read_bare :: < :: mtproto :: inputReportReasonOther > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct inputReportReasonOther { pub text : :: mtproto :: string , } impl :: BareSerialize for inputReportReasonOther { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & inputReportReasonOther { ref text } = self ; _ser . write_bare :: < :: mtproto :: string > ( text ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for inputReportReasonOther { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( inputReportReasonOther { text : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for inputReportReasonOther { type Boxed = ReportReason ; fn into_boxed ( self ) -> ReportReason { ReportReason :: inputReportReasonOther ( self ) } } # [ derive ( Debug , Clone ) ] pub enum ResPQ { resPQ ( resPQ ) , } 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 :: resPQ > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = ResPQ ; fn into_boxed ( self ) -> ResPQ { ResPQ :: resPQ ( self ) } } # [ derive ( Debug , Clone ) ] pub enum RichText { textEmpty , textPlain ( textPlain ) , textBold ( textBold ) , textItalic ( textItalic ) , textUnderline ( textUnderline ) , textStrike ( textStrike ) , textFixed ( textFixed ) , textUrl ( textUrl ) , textEmail ( textEmail ) , textConcat ( textConcat ) , } impl :: BoxedSerialize for RichText { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & RichText :: textEmpty => ( :: ConstructorNumber ( 0xdc3d824f ) , & ( ) ) , & RichText :: textPlain ( ref x ) => ( :: ConstructorNumber ( 0x744694e0 ) , x ) , & RichText :: textBold ( ref x ) => ( :: ConstructorNumber ( 0x6724abc4 ) , x ) , & RichText :: textItalic ( ref x ) => ( :: ConstructorNumber ( 0xd912a59c ) , x ) , & RichText :: textUnderline ( ref x ) => ( :: ConstructorNumber ( 0xc12622c4 ) , x ) , & RichText :: textStrike ( ref x ) => ( :: ConstructorNumber ( 0x9bf8bb95 ) , x ) , & RichText :: textFixed ( ref x ) => ( :: ConstructorNumber ( 0x6c3f19b9 ) , x ) , & RichText :: textUrl ( ref x ) => ( :: ConstructorNumber ( 0x3c2884c1 ) , x ) , & RichText :: textEmail ( ref x ) => ( :: ConstructorNumber ( 0xde5a0dd6 ) , x ) , & RichText :: textConcat ( 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 :: textEmpty ) , :: ConstructorNumber ( 0x744694e0 ) => Ok ( RichText :: textPlain ( _de . read_bare :: < :: mtproto :: textPlain > ( ) ? ) ) , :: ConstructorNumber ( 0x6724abc4 ) => Ok ( RichText :: textBold ( _de . read_bare :: < :: mtproto :: textBold > ( ) ? ) ) , :: ConstructorNumber ( 0xd912a59c ) => Ok ( RichText :: textItalic ( _de . read_bare :: < :: mtproto :: textItalic > ( ) ? ) ) , :: ConstructorNumber ( 0xc12622c4 ) => Ok ( RichText :: textUnderline ( _de . read_bare :: < :: mtproto :: textUnderline > ( ) ? ) ) , :: ConstructorNumber ( 0x9bf8bb95 ) => Ok ( RichText :: textStrike ( _de . read_bare :: < :: mtproto :: textStrike > ( ) ? ) ) , :: ConstructorNumber ( 0x6c3f19b9 ) => Ok ( RichText :: textFixed ( _de . read_bare :: < :: mtproto :: textFixed > ( ) ? ) ) , :: ConstructorNumber ( 0x3c2884c1 ) => Ok ( RichText :: textUrl ( _de . read_bare :: < :: mtproto :: textUrl > ( ) ? ) ) , :: ConstructorNumber ( 0xde5a0dd6 ) => Ok ( RichText :: textEmail ( _de . read_bare :: < :: mtproto :: textEmail > ( ) ? ) ) , :: ConstructorNumber ( 0x7e6260d7 ) => Ok ( RichText :: textConcat ( _de . read_bare :: < :: mtproto :: textConcat > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct textPlain { pub text : :: mtproto :: string , } impl :: BareSerialize for textPlain { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & textPlain { ref text } = self ; _ser . write_bare :: < :: mtproto :: string > ( text ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for textPlain { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( textPlain { text : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for textPlain { type Boxed = RichText ; fn into_boxed ( self ) -> RichText { RichText :: textPlain ( self ) } } # [ derive ( Debug , Clone ) ] pub struct textBold { pub text : Box < :: mtproto :: RichText > , } impl :: BareSerialize for textBold { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & textBold { ref text } = self ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( text ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for textBold { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( textBold { text : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , } ) } } impl :: IntoBoxed for textBold { type Boxed = RichText ; fn into_boxed ( self ) -> RichText { RichText :: textBold ( self ) } } # [ derive ( Debug , Clone ) ] pub struct textItalic { pub text : Box < :: mtproto :: RichText > , } impl :: BareSerialize for textItalic { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & textItalic { ref text } = self ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( text ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for textItalic { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( textItalic { text : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , } ) } } impl :: IntoBoxed for textItalic { type Boxed = RichText ; fn into_boxed ( self ) -> RichText { RichText :: textItalic ( self ) } } # [ derive ( Debug , Clone ) ] pub struct textUnderline { pub text : Box < :: mtproto :: RichText > , } impl :: BareSerialize for textUnderline { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & textUnderline { ref text } = self ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( text ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for textUnderline { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( textUnderline { text : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , } ) } } impl :: IntoBoxed for textUnderline { type Boxed = RichText ; fn into_boxed ( self ) -> RichText { RichText :: textUnderline ( self ) } } # [ derive ( Debug , Clone ) ] pub struct textStrike { pub text : Box < :: mtproto :: RichText > , } impl :: BareSerialize for textStrike { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & textStrike { ref text } = self ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( text ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for textStrike { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( textStrike { text : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , } ) } } impl :: IntoBoxed for textStrike { type Boxed = RichText ; fn into_boxed ( self ) -> RichText { RichText :: textStrike ( self ) } } # [ derive ( Debug , Clone ) ] pub struct textFixed { pub text : Box < :: mtproto :: RichText > , } impl :: BareSerialize for textFixed { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & textFixed { ref text } = self ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( text ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for textFixed { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( textFixed { text : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , } ) } } impl :: IntoBoxed for textFixed { type Boxed = RichText ; fn into_boxed ( self ) -> RichText { RichText :: textFixed ( self ) } } # [ derive ( Debug , Clone ) ] pub struct textUrl { pub text : Box < :: mtproto :: RichText > , pub url : :: mtproto :: string , pub webpage_id : :: mtproto :: long , } impl :: BareSerialize for textUrl { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & textUrl { 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 textUrl { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( textUrl { text : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , url : _de . read_bare :: < :: mtproto :: string > ( ) ? , webpage_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for textUrl { type Boxed = RichText ; fn into_boxed ( self ) -> RichText { RichText :: textUrl ( self ) } } # [ derive ( Debug , Clone ) ] pub struct textEmail { pub text : Box < :: mtproto :: RichText > , pub email : :: mtproto :: string , } impl :: BareSerialize for textEmail { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & textEmail { ref text , ref email } = self ; _ser . write_boxed :: < Box < :: mtproto :: RichText > > ( text ) ? ; _ser . write_bare :: < :: mtproto :: string > ( email ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for textEmail { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( textEmail { text : _de . read_boxed :: < Box < :: mtproto :: RichText > > ( ) ? , email : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for textEmail { type Boxed = RichText ; fn into_boxed ( self ) -> RichText { RichText :: textEmail ( self ) } } # [ derive ( Debug , Clone ) ] pub struct textConcat { pub texts : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: RichText > , } impl :: BareSerialize for textConcat { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & textConcat { ref texts } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: RichText > > ( texts ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for textConcat { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( textConcat { texts : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: RichText > > ( ) ? , } ) } } impl :: IntoBoxed for textConcat { type Boxed = RichText ; fn into_boxed ( self ) -> RichText { RichText :: textConcat ( self ) } } # [ derive ( Debug , Clone ) ] pub enum RpcDropAnswer { rpc_answer_unknown , rpc_answer_dropped_running , rpc_answer_dropped ( rpc_answer_dropped ) , } impl :: BoxedSerialize for RpcDropAnswer { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & RpcDropAnswer :: rpc_answer_unknown => ( :: ConstructorNumber ( 0x5e2ad36e ) , & ( ) ) , & RpcDropAnswer :: rpc_answer_dropped_running => ( :: ConstructorNumber ( 0xcd78e586 ) , & ( ) ) , & RpcDropAnswer :: rpc_answer_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 :: rpc_answer_unknown ) , :: ConstructorNumber ( 0xcd78e586 ) => Ok ( RpcDropAnswer :: rpc_answer_dropped_running ) , :: ConstructorNumber ( 0xa43ad8b7 ) => Ok ( RpcDropAnswer :: rpc_answer_dropped ( _de . read_bare :: < :: mtproto :: rpc_answer_dropped > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct rpc_answer_dropped { pub msg_id : :: mtproto :: long , pub seq_no : :: mtproto :: int , pub bytes : :: mtproto :: int , } impl :: BareSerialize for rpc_answer_dropped { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & rpc_answer_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 rpc_answer_dropped { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( rpc_answer_dropped { msg_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , seq_no : _de . read_bare :: < :: mtproto :: int > ( ) ? , bytes : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for rpc_answer_dropped { type Boxed = RpcDropAnswer ; fn into_boxed ( self ) -> RpcDropAnswer { RpcDropAnswer :: rpc_answer_dropped ( self ) } } # [ derive ( Debug , Clone ) ] pub enum RpcError { rpc_error ( rpc_error ) , } impl :: BoxedSerialize for RpcError { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & RpcError :: rpc_error ( 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 :: rpc_error ( _de . read_bare :: < :: mtproto :: rpc_error > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct rpc_error { pub error_code : :: mtproto :: int , pub error_message : :: mtproto :: string , } impl :: BareSerialize for rpc_error { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & rpc_error { 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 rpc_error { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( rpc_error { error_code : _de . read_bare :: < :: mtproto :: int > ( ) ? , error_message : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for rpc_error { type Boxed = RpcError ; fn into_boxed ( self ) -> RpcError { RpcError :: rpc_error ( self ) } } # [ derive ( Debug , Clone ) ] pub enum SendMessageAction { sendMessageTypingAction , sendMessageCancelAction , sendMessageRecordVideoAction , sendMessageUploadVideoAction ( sendMessageUploadVideoAction ) , sendMessageRecordAudioAction , sendMessageUploadAudioAction ( sendMessageUploadAudioAction ) , sendMessageUploadPhotoAction ( sendMessageUploadPhotoAction ) , sendMessageUploadDocumentAction ( sendMessageUploadDocumentAction ) , sendMessageGeoLocationAction , sendMessageChooseContactAction , sendMessageGamePlayAction , sendMessageRecordRoundAction , sendMessageUploadRoundAction ( sendMessageUploadRoundAction ) , } impl :: BoxedSerialize for SendMessageAction { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & SendMessageAction :: sendMessageTypingAction => ( :: ConstructorNumber ( 0x16bf744e ) , & ( ) ) , & SendMessageAction :: sendMessageCancelAction => ( :: ConstructorNumber ( 0xfd5ec8f5 ) , & ( ) ) , & SendMessageAction :: sendMessageRecordVideoAction => ( :: ConstructorNumber ( 0xa187d66f ) , & ( ) ) , & SendMessageAction :: sendMessageUploadVideoAction ( ref x ) => ( :: ConstructorNumber ( 0xe9763aec ) , x ) , & SendMessageAction :: sendMessageRecordAudioAction => ( :: ConstructorNumber ( 0xd52f73f7 ) , & ( ) ) , & SendMessageAction :: sendMessageUploadAudioAction ( ref x ) => ( :: ConstructorNumber ( 0xf351d7ab ) , x ) , & SendMessageAction :: sendMessageUploadPhotoAction ( ref x ) => ( :: ConstructorNumber ( 0xd1d34a26 ) , x ) , & SendMessageAction :: sendMessageUploadDocumentAction ( ref x ) => ( :: ConstructorNumber ( 0xaa0cd9e4 ) , x ) , & SendMessageAction :: sendMessageGeoLocationAction => ( :: ConstructorNumber ( 0x176f8ba1 ) , & ( ) ) , & SendMessageAction :: sendMessageChooseContactAction => ( :: ConstructorNumber ( 0x628cbc6f ) , & ( ) ) , & SendMessageAction :: sendMessageGamePlayAction => ( :: ConstructorNumber ( 0xdd6a8f48 ) , & ( ) ) , & SendMessageAction :: sendMessageRecordRoundAction => ( :: ConstructorNumber ( 0x88f27fbc ) , & ( ) ) , & SendMessageAction :: sendMessageUploadRoundAction ( 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 :: sendMessageTypingAction ) , :: ConstructorNumber ( 0xfd5ec8f5 ) => Ok ( SendMessageAction :: sendMessageCancelAction ) , :: ConstructorNumber ( 0xa187d66f ) => Ok ( SendMessageAction :: sendMessageRecordVideoAction ) , :: ConstructorNumber ( 0xe9763aec ) => Ok ( SendMessageAction :: sendMessageUploadVideoAction ( _de . read_bare :: < :: mtproto :: sendMessageUploadVideoAction > ( ) ? ) ) , :: ConstructorNumber ( 0xd52f73f7 ) => Ok ( SendMessageAction :: sendMessageRecordAudioAction ) , :: ConstructorNumber ( 0xf351d7ab ) => Ok ( SendMessageAction :: sendMessageUploadAudioAction ( _de . read_bare :: < :: mtproto :: sendMessageUploadAudioAction > ( ) ? ) ) , :: ConstructorNumber ( 0xd1d34a26 ) => Ok ( SendMessageAction :: sendMessageUploadPhotoAction ( _de . read_bare :: < :: mtproto :: sendMessageUploadPhotoAction > ( ) ? ) ) , :: ConstructorNumber ( 0xaa0cd9e4 ) => Ok ( SendMessageAction :: sendMessageUploadDocumentAction ( _de . read_bare :: < :: mtproto :: sendMessageUploadDocumentAction > ( ) ? ) ) , :: ConstructorNumber ( 0x176f8ba1 ) => Ok ( SendMessageAction :: sendMessageGeoLocationAction ) , :: ConstructorNumber ( 0x628cbc6f ) => Ok ( SendMessageAction :: sendMessageChooseContactAction ) , :: ConstructorNumber ( 0xdd6a8f48 ) => Ok ( SendMessageAction :: sendMessageGamePlayAction ) , :: ConstructorNumber ( 0x88f27fbc ) => Ok ( SendMessageAction :: sendMessageRecordRoundAction ) , :: ConstructorNumber ( 0x243e1c66 ) => Ok ( SendMessageAction :: sendMessageUploadRoundAction ( _de . read_bare :: < :: mtproto :: sendMessageUploadRoundAction > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct sendMessageUploadVideoAction { pub progress : :: mtproto :: int , } impl :: BareSerialize for sendMessageUploadVideoAction { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & sendMessageUploadVideoAction { ref progress } = self ; _ser . write_bare :: < :: mtproto :: int > ( progress ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for sendMessageUploadVideoAction { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( sendMessageUploadVideoAction { progress : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for sendMessageUploadVideoAction { type Boxed = SendMessageAction ; fn into_boxed ( self ) -> SendMessageAction { SendMessageAction :: sendMessageUploadVideoAction ( self ) } } # [ derive ( Debug , Clone ) ] pub struct sendMessageUploadAudioAction { pub progress : :: mtproto :: int , } impl :: BareSerialize for sendMessageUploadAudioAction { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & sendMessageUploadAudioAction { ref progress } = self ; _ser . write_bare :: < :: mtproto :: int > ( progress ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for sendMessageUploadAudioAction { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( sendMessageUploadAudioAction { progress : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for sendMessageUploadAudioAction { type Boxed = SendMessageAction ; fn into_boxed ( self ) -> SendMessageAction { SendMessageAction :: sendMessageUploadAudioAction ( self ) } } # [ derive ( Debug , Clone ) ] pub struct sendMessageUploadPhotoAction { pub progress : :: mtproto :: int , } impl :: BareSerialize for sendMessageUploadPhotoAction { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & sendMessageUploadPhotoAction { ref progress } = self ; _ser . write_bare :: < :: mtproto :: int > ( progress ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for sendMessageUploadPhotoAction { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( sendMessageUploadPhotoAction { progress : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for sendMessageUploadPhotoAction { type Boxed = SendMessageAction ; fn into_boxed ( self ) -> SendMessageAction { SendMessageAction :: sendMessageUploadPhotoAction ( self ) } } # [ derive ( Debug , Clone ) ] pub struct sendMessageUploadDocumentAction { pub progress : :: mtproto :: int , } impl :: BareSerialize for sendMessageUploadDocumentAction { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & sendMessageUploadDocumentAction { ref progress } = self ; _ser . write_bare :: < :: mtproto :: int > ( progress ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for sendMessageUploadDocumentAction { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( sendMessageUploadDocumentAction { progress : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for sendMessageUploadDocumentAction { type Boxed = SendMessageAction ; fn into_boxed ( self ) -> SendMessageAction { SendMessageAction :: sendMessageUploadDocumentAction ( self ) } } # [ derive ( Debug , Clone ) ] pub struct sendMessageUploadRoundAction { pub progress : :: mtproto :: int , } impl :: BareSerialize for sendMessageUploadRoundAction { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & sendMessageUploadRoundAction { ref progress } = self ; _ser . write_bare :: < :: mtproto :: int > ( progress ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for sendMessageUploadRoundAction { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( sendMessageUploadRoundAction { progress : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for sendMessageUploadRoundAction { type Boxed = SendMessageAction ; fn into_boxed ( self ) -> SendMessageAction { SendMessageAction :: sendMessageUploadRoundAction ( self ) } } # [ derive ( Debug , Clone ) ] pub enum Server_DH_Params { server_DH_params_fail ( server_DH_params_fail ) , server_DH_params_ok ( server_DH_params_ok ) , } impl :: BoxedSerialize for Server_DH_Params { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Server_DH_Params :: server_DH_params_fail ( ref x ) => ( :: ConstructorNumber ( 0x79cb045d ) , x ) , & Server_DH_Params :: server_DH_params_ok ( ref x ) => ( :: ConstructorNumber ( 0xd0e8075c ) , x ) , } } } impl :: BoxedDeserialize for Server_DH_Params { 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 ( Server_DH_Params :: server_DH_params_fail ( _de . read_bare :: < :: mtproto :: server_DH_params_fail > ( ) ? ) ) , :: ConstructorNumber ( 0xd0e8075c ) => Ok ( Server_DH_Params :: server_DH_params_ok ( _de . read_bare :: < :: mtproto :: server_DH_params_ok > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct server_DH_params_fail { pub nonce : :: mtproto :: int128 , pub server_nonce : :: mtproto :: int128 , pub new_nonce_hash : :: mtproto :: int128 , } impl :: BareSerialize for server_DH_params_fail { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & server_DH_params_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 server_DH_params_fail { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( server_DH_params_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 server_DH_params_fail { type Boxed = Server_DH_Params ; fn into_boxed ( self ) -> Server_DH_Params { Server_DH_Params :: server_DH_params_fail ( self ) } } # [ derive ( Debug , Clone ) ] pub struct server_DH_params_ok { pub nonce : :: mtproto :: int128 , pub server_nonce : :: mtproto :: int128 , pub encrypted_answer : :: mtproto :: bytes , } impl :: BareSerialize for server_DH_params_ok { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & server_DH_params_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 server_DH_params_ok { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( server_DH_params_ok { nonce : _de . read_bare :: < :: mtproto :: int128 > ( ) ? , server_nonce : _de . read_bare :: < :: mtproto :: int128 > ( ) ? , encrypted_answer : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , } ) } } impl :: IntoBoxed for server_DH_params_ok { type Boxed = Server_DH_Params ; fn into_boxed ( self ) -> Server_DH_Params { Server_DH_Params :: server_DH_params_ok ( self ) } } # [ derive ( Debug , Clone ) ] pub enum Server_DH_inner_data { server_DH_inner_data ( server_DH_inner_data ) , } impl :: BoxedSerialize for Server_DH_inner_data { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Server_DH_inner_data :: server_DH_inner_data ( ref x ) => ( :: ConstructorNumber ( 0xb5890dba ) , x ) , } } } impl :: BoxedDeserialize for Server_DH_inner_data { fn possible_constructors ( ) -> Vec < :: ConstructorNumber > { vec ! [ :: ConstructorNumber ( 0xb5890dba ) ] } fn deserialize_boxed ( _id : :: ConstructorNumber , _de : & mut :: Deserializer ) -> :: Result < Self > { match _id { :: ConstructorNumber ( 0xb5890dba ) => Ok ( Server_DH_inner_data :: server_DH_inner_data ( _de . read_bare :: < :: mtproto :: server_DH_inner_data > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct server_DH_inner_data { 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 server_DH_inner_data { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & server_DH_inner_data { 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 server_DH_inner_data { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( server_DH_inner_data { 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 server_DH_inner_data { type Boxed = Server_DH_inner_data ; fn into_boxed ( self ) -> Server_DH_inner_data { Server_DH_inner_data :: server_DH_inner_data ( self ) } } # [ derive ( Debug , Clone ) ] pub enum Set_client_DH_params_answer { dh_gen_ok ( dh_gen_ok ) , dh_gen_retry ( dh_gen_retry ) , dh_gen_fail ( dh_gen_fail ) , } impl :: BoxedSerialize for Set_client_DH_params_answer { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Set_client_DH_params_answer :: dh_gen_ok ( ref x ) => ( :: ConstructorNumber ( 0x3bcbf734 ) , x ) , & Set_client_DH_params_answer :: dh_gen_retry ( ref x ) => ( :: ConstructorNumber ( 0x46dc1fb9 ) , x ) , & Set_client_DH_params_answer :: dh_gen_fail ( ref x ) => ( :: ConstructorNumber ( 0xa69dae02 ) , x ) , } } } impl :: BoxedDeserialize for Set_client_DH_params_answer { 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 ( Set_client_DH_params_answer :: dh_gen_ok ( _de . read_bare :: < :: mtproto :: dh_gen_ok > ( ) ? ) ) , :: ConstructorNumber ( 0x46dc1fb9 ) => Ok ( Set_client_DH_params_answer :: dh_gen_retry ( _de . read_bare :: < :: mtproto :: dh_gen_retry > ( ) ? ) ) , :: ConstructorNumber ( 0xa69dae02 ) => Ok ( Set_client_DH_params_answer :: dh_gen_fail ( _de . read_bare :: < :: mtproto :: dh_gen_fail > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct dh_gen_ok { pub nonce : :: mtproto :: int128 , pub server_nonce : :: mtproto :: int128 , pub new_nonce_hash1 : :: mtproto :: int128 , } impl :: BareSerialize for dh_gen_ok { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & dh_gen_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 dh_gen_ok { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( dh_gen_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 dh_gen_ok { type Boxed = Set_client_DH_params_answer ; fn into_boxed ( self ) -> Set_client_DH_params_answer { Set_client_DH_params_answer :: dh_gen_ok ( self ) } } # [ derive ( Debug , Clone ) ] pub struct dh_gen_retry { pub nonce : :: mtproto :: int128 , pub server_nonce : :: mtproto :: int128 , pub new_nonce_hash2 : :: mtproto :: int128 , } impl :: BareSerialize for dh_gen_retry { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & dh_gen_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 dh_gen_retry { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( dh_gen_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 dh_gen_retry { type Boxed = Set_client_DH_params_answer ; fn into_boxed ( self ) -> Set_client_DH_params_answer { Set_client_DH_params_answer :: dh_gen_retry ( self ) } } # [ derive ( Debug , Clone ) ] pub struct dh_gen_fail { pub nonce : :: mtproto :: int128 , pub server_nonce : :: mtproto :: int128 , pub new_nonce_hash3 : :: mtproto :: int128 , } impl :: BareSerialize for dh_gen_fail { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & dh_gen_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 dh_gen_fail { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( dh_gen_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 dh_gen_fail { type Boxed = Set_client_DH_params_answer ; fn into_boxed ( self ) -> Set_client_DH_params_answer { Set_client_DH_params_answer :: dh_gen_fail ( self ) } } # [ derive ( Debug , Clone ) ] pub enum ShippingOption { shippingOption ( shippingOption ) , } 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 :: shippingOption > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = ShippingOption ; fn into_boxed ( self ) -> ShippingOption { ShippingOption :: shippingOption ( self ) } } # [ derive ( Debug , Clone ) ] pub enum StickerPack { stickerPack ( stickerPack ) , } 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 :: stickerPack > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = StickerPack ; fn into_boxed ( self ) -> StickerPack { StickerPack :: stickerPack ( self ) } } # [ derive ( Debug , Clone ) ] pub enum StickerSet { stickerSet ( stickerSet ) , } 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 :: stickerSet > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = StickerSet ; fn into_boxed ( self ) -> StickerSet { StickerSet :: stickerSet ( self ) } } # [ derive ( Debug , Clone ) ] pub enum StickerSetCovered { stickerSetCovered ( stickerSetCovered ) , stickerSetMultiCovered ( stickerSetMultiCovered ) , } impl :: BoxedSerialize for StickerSetCovered { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & StickerSetCovered :: stickerSetCovered ( ref x ) => ( :: ConstructorNumber ( 0x6410a5d2 ) , x ) , & StickerSetCovered :: stickerSetMultiCovered ( 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 :: stickerSetCovered ( _de . read_bare :: < :: mtproto :: stickerSetCovered > ( ) ? ) ) , :: ConstructorNumber ( 0x3407e51b ) => Ok ( StickerSetCovered :: stickerSetMultiCovered ( _de . read_bare :: < :: mtproto :: stickerSetMultiCovered > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct stickerSetCovered { pub set : :: mtproto :: StickerSet , pub cover : :: mtproto :: Document , } impl :: BareSerialize for stickerSetCovered { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & stickerSetCovered { ref set , ref cover } = self ; _ser . write_boxed :: < :: mtproto :: StickerSet > ( set ) ? ; _ser . write_boxed :: < :: mtproto :: Document > ( cover ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for stickerSetCovered { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( stickerSetCovered { set : _de . read_boxed :: < :: mtproto :: StickerSet > ( ) ? , cover : _de . read_boxed :: < :: mtproto :: Document > ( ) ? , } ) } } impl :: IntoBoxed for stickerSetCovered { type Boxed = StickerSetCovered ; fn into_boxed ( self ) -> StickerSetCovered { StickerSetCovered :: stickerSetCovered ( self ) } } # [ derive ( Debug , Clone ) ] pub struct stickerSetMultiCovered { pub set : :: mtproto :: StickerSet , pub covers : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Document > , } impl :: BareSerialize for stickerSetMultiCovered { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & stickerSetMultiCovered { 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 stickerSetMultiCovered { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( stickerSetMultiCovered { set : _de . read_boxed :: < :: mtproto :: StickerSet > ( ) ? , covers : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Document > > ( ) ? , } ) } } impl :: IntoBoxed for stickerSetMultiCovered { type Boxed = StickerSetCovered ; fn into_boxed ( self ) -> StickerSetCovered { StickerSetCovered :: stickerSetMultiCovered ( self ) } } # [ derive ( Debug , Clone ) ] pub enum TopPeer { topPeer ( topPeer ) , } 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 :: topPeer > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = TopPeer ; fn into_boxed ( self ) -> TopPeer { TopPeer :: topPeer ( self ) } } # [ derive ( Debug , Clone ) ] pub enum TopPeerCategory { topPeerCategoryBotsPM , topPeerCategoryBotsInline , topPeerCategoryCorrespondents , topPeerCategoryGroups , topPeerCategoryChannels , topPeerCategoryPhoneCalls , } impl :: BoxedSerialize for TopPeerCategory { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & TopPeerCategory :: topPeerCategoryBotsPM => ( :: ConstructorNumber ( 0xab661b5b ) , & ( ) ) , & TopPeerCategory :: topPeerCategoryBotsInline => ( :: ConstructorNumber ( 0x148677e2 ) , & ( ) ) , & TopPeerCategory :: topPeerCategoryCorrespondents => ( :: ConstructorNumber ( 0x0637b7ed ) , & ( ) ) , & TopPeerCategory :: topPeerCategoryGroups => ( :: ConstructorNumber ( 0xbd17a14a ) , & ( ) ) , & TopPeerCategory :: topPeerCategoryChannels => ( :: ConstructorNumber ( 0x161d9628 ) , & ( ) ) , & TopPeerCategory :: topPeerCategoryPhoneCalls => ( :: 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 :: topPeerCategoryBotsPM ) , :: ConstructorNumber ( 0x148677e2 ) => Ok ( TopPeerCategory :: topPeerCategoryBotsInline ) , :: ConstructorNumber ( 0x0637b7ed ) => Ok ( TopPeerCategory :: topPeerCategoryCorrespondents ) , :: ConstructorNumber ( 0xbd17a14a ) => Ok ( TopPeerCategory :: topPeerCategoryGroups ) , :: ConstructorNumber ( 0x161d9628 ) => Ok ( TopPeerCategory :: topPeerCategoryChannels ) , :: ConstructorNumber ( 0x1e76a78c ) => Ok ( TopPeerCategory :: topPeerCategoryPhoneCalls ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub enum TopPeerCategoryPeers { topPeerCategoryPeers ( topPeerCategoryPeers ) , } 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 :: topPeerCategoryPeers > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = TopPeerCategoryPeers ; fn into_boxed ( self ) -> TopPeerCategoryPeers { TopPeerCategoryPeers :: topPeerCategoryPeers ( self ) } } # [ derive ( Debug , Clone ) ] pub enum Update { updateNewMessage ( updateNewMessage ) , updateMessageID ( updateMessageID ) , updateDeleteMessages ( updateDeleteMessages ) , updateUserTyping ( updateUserTyping ) , updateChatUserTyping ( updateChatUserTyping ) , updateChatParticipants ( updateChatParticipants ) , updateUserStatus ( updateUserStatus ) , updateUserName ( updateUserName ) , updateUserPhoto ( updateUserPhoto ) , updateContactRegistered ( updateContactRegistered ) , updateContactLink ( updateContactLink ) , updateNewEncryptedMessage ( updateNewEncryptedMessage ) , updateEncryptedChatTyping ( updateEncryptedChatTyping ) , updateEncryption ( updateEncryption ) , updateEncryptedMessagesRead ( updateEncryptedMessagesRead ) , updateChatParticipantAdd ( updateChatParticipantAdd ) , updateChatParticipantDelete ( updateChatParticipantDelete ) , updateDcOptions ( updateDcOptions ) , updateUserBlocked ( updateUserBlocked ) , updateNotifySettings ( updateNotifySettings ) , updateServiceNotification ( updateServiceNotification ) , updatePrivacy ( updatePrivacy ) , updateUserPhone ( updateUserPhone ) , updateReadHistoryInbox ( updateReadHistoryInbox ) , updateReadHistoryOutbox ( updateReadHistoryOutbox ) , updateWebPage ( updateWebPage ) , updateReadMessagesContents ( updateReadMessagesContents ) , updateChannelTooLong ( updateChannelTooLong ) , updateChannel ( updateChannel ) , updateNewChannelMessage ( updateNewChannelMessage ) , updateReadChannelInbox ( updateReadChannelInbox ) , updateDeleteChannelMessages ( updateDeleteChannelMessages ) , updateChannelMessageViews ( updateChannelMessageViews ) , updateChatAdmins ( updateChatAdmins ) , updateChatParticipantAdmin ( updateChatParticipantAdmin ) , updateNewStickerSet ( updateNewStickerSet ) , updateStickerSetsOrder ( updateStickerSetsOrder ) , updateStickerSets , updateSavedGifs , updateBotInlineQuery ( updateBotInlineQuery ) , updateBotInlineSend ( updateBotInlineSend ) , updateEditChannelMessage ( updateEditChannelMessage ) , updateChannelPinnedMessage ( updateChannelPinnedMessage ) , updateBotCallbackQuery ( updateBotCallbackQuery ) , updateEditMessage ( updateEditMessage ) , updateInlineBotCallbackQuery ( updateInlineBotCallbackQuery ) , updateReadChannelOutbox ( updateReadChannelOutbox ) , updateDraftMessage ( updateDraftMessage ) , updateReadFeaturedStickers , updateRecentStickers , updateConfig , updatePtsChanged , updateChannelWebPage ( updateChannelWebPage ) , updateDialogPinned ( updateDialogPinned ) , updatePinnedDialogs ( updatePinnedDialogs ) , updateBotWebhookJSON ( updateBotWebhookJSON ) , updateBotWebhookJSONQuery ( updateBotWebhookJSONQuery ) , updateBotShippingQuery ( updateBotShippingQuery ) , updateBotPrecheckoutQuery ( updateBotPrecheckoutQuery ) , updatePhoneCall ( updatePhoneCall ) , updateLangPackTooLong , updateLangPack ( updateLangPack ) , updateFavedStickers , updateChannelReadMessagesContents ( updateChannelReadMessagesContents ) , updateContactsReset , updateChannelAvailableMessages ( updateChannelAvailableMessages ) , } impl :: BoxedSerialize for Update { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Update :: updateNewMessage ( ref x ) => ( :: ConstructorNumber ( 0x1f2b0afd ) , x ) , & Update :: updateMessageID ( ref x ) => ( :: ConstructorNumber ( 0x4e90bfd6 ) , x ) , & Update :: updateDeleteMessages ( ref x ) => ( :: ConstructorNumber ( 0xa20db0e5 ) , x ) , & Update :: updateUserTyping ( ref x ) => ( :: ConstructorNumber ( 0x5c486927 ) , x ) , & Update :: updateChatUserTyping ( ref x ) => ( :: ConstructorNumber ( 0x9a65ea1f ) , x ) , & Update :: updateChatParticipants ( ref x ) => ( :: ConstructorNumber ( 0x07761198 ) , x ) , & Update :: updateUserStatus ( ref x ) => ( :: ConstructorNumber ( 0x1bfbd823 ) , x ) , & Update :: updateUserName ( ref x ) => ( :: ConstructorNumber ( 0xa7332b73 ) , x ) , & Update :: updateUserPhoto ( ref x ) => ( :: ConstructorNumber ( 0x95313b0c ) , x ) , & Update :: updateContactRegistered ( ref x ) => ( :: ConstructorNumber ( 0x2575bbb9 ) , x ) , & Update :: updateContactLink ( ref x ) => ( :: ConstructorNumber ( 0x9d2e67c5 ) , x ) , & Update :: updateNewEncryptedMessage ( ref x ) => ( :: ConstructorNumber ( 0x12bcbd9a ) , x ) , & Update :: updateEncryptedChatTyping ( ref x ) => ( :: ConstructorNumber ( 0x1710f156 ) , x ) , & Update :: updateEncryption ( ref x ) => ( :: ConstructorNumber ( 0xb4a2e88d ) , x ) , & Update :: updateEncryptedMessagesRead ( ref x ) => ( :: ConstructorNumber ( 0x38fe25b7 ) , x ) , & Update :: updateChatParticipantAdd ( ref x ) => ( :: ConstructorNumber ( 0xea4b0e5c ) , x ) , & Update :: updateChatParticipantDelete ( ref x ) => ( :: ConstructorNumber ( 0x6e5f8c22 ) , x ) , & Update :: updateDcOptions ( ref x ) => ( :: ConstructorNumber ( 0x8e5e9873 ) , x ) , & Update :: updateUserBlocked ( ref x ) => ( :: ConstructorNumber ( 0x80ece81a ) , x ) , & Update :: updateNotifySettings ( ref x ) => ( :: ConstructorNumber ( 0xbec268ef ) , x ) , & Update :: updateServiceNotification ( ref x ) => ( :: ConstructorNumber ( 0xebe46819 ) , x ) , & Update :: updatePrivacy ( ref x ) => ( :: ConstructorNumber ( 0xee3b272a ) , x ) , & Update :: updateUserPhone ( ref x ) => ( :: ConstructorNumber ( 0x12b9417b ) , x ) , & Update :: updateReadHistoryInbox ( ref x ) => ( :: ConstructorNumber ( 0x9961fd5c ) , x ) , & Update :: updateReadHistoryOutbox ( ref x ) => ( :: ConstructorNumber ( 0x2f2f21bf ) , x ) , & Update :: updateWebPage ( ref x ) => ( :: ConstructorNumber ( 0x7f891213 ) , x ) , & Update :: updateReadMessagesContents ( ref x ) => ( :: ConstructorNumber ( 0x68c13933 ) , x ) , & Update :: updateChannelTooLong ( ref x ) => ( :: ConstructorNumber ( 0xeb0467fb ) , x ) , & Update :: updateChannel ( ref x ) => ( :: ConstructorNumber ( 0xb6d45656 ) , x ) , & Update :: updateNewChannelMessage ( ref x ) => ( :: ConstructorNumber ( 0x62ba04d9 ) , x ) , & Update :: updateReadChannelInbox ( ref x ) => ( :: ConstructorNumber ( 0x4214f37f ) , x ) , & Update :: updateDeleteChannelMessages ( ref x ) => ( :: ConstructorNumber ( 0xc37521c9 ) , x ) , & Update :: updateChannelMessageViews ( ref x ) => ( :: ConstructorNumber ( 0x98a12b4b ) , x ) , & Update :: updateChatAdmins ( ref x ) => ( :: ConstructorNumber ( 0x6e947941 ) , x ) , & Update :: updateChatParticipantAdmin ( ref x ) => ( :: ConstructorNumber ( 0xb6901959 ) , x ) , & Update :: updateNewStickerSet ( ref x ) => ( :: ConstructorNumber ( 0x688a30aa ) , x ) , & Update :: updateStickerSetsOrder ( ref x ) => ( :: ConstructorNumber ( 0x0bb2d201 ) , x ) , & Update :: updateStickerSets => ( :: ConstructorNumber ( 0x43ae3dec ) , & ( ) ) , & Update :: updateSavedGifs => ( :: ConstructorNumber ( 0x9375341e ) , & ( ) ) , & Update :: updateBotInlineQuery ( ref x ) => ( :: ConstructorNumber ( 0x54826690 ) , x ) , & Update :: updateBotInlineSend ( ref x ) => ( :: ConstructorNumber ( 0x0e48f964 ) , x ) , & Update :: updateEditChannelMessage ( ref x ) => ( :: ConstructorNumber ( 0x1b3f4df7 ) , x ) , & Update :: updateChannelPinnedMessage ( ref x ) => ( :: ConstructorNumber ( 0x98592475 ) , x ) , & Update :: updateBotCallbackQuery ( ref x ) => ( :: ConstructorNumber ( 0xe73547e1 ) , x ) , & Update :: updateEditMessage ( ref x ) => ( :: ConstructorNumber ( 0xe40370a3 ) , x ) , & Update :: updateInlineBotCallbackQuery ( ref x ) => ( :: ConstructorNumber ( 0xf9d27a5a ) , x ) , & Update :: updateReadChannelOutbox ( ref x ) => ( :: ConstructorNumber ( 0x25d6c9c7 ) , x ) , & Update :: updateDraftMessage ( ref x ) => ( :: ConstructorNumber ( 0xee2bb969 ) , x ) , & Update :: updateReadFeaturedStickers => ( :: ConstructorNumber ( 0x571d2742 ) , & ( ) ) , & Update :: updateRecentStickers => ( :: ConstructorNumber ( 0x9a422c20 ) , & ( ) ) , & Update :: updateConfig => ( :: ConstructorNumber ( 0xa229dd06 ) , & ( ) ) , & Update :: updatePtsChanged => ( :: ConstructorNumber ( 0x3354678f ) , & ( ) ) , & Update :: updateChannelWebPage ( ref x ) => ( :: ConstructorNumber ( 0x40771900 ) , x ) , & Update :: updateDialogPinned ( ref x ) => ( :: ConstructorNumber ( 0xd711a2cc ) , x ) , & Update :: updatePinnedDialogs ( ref x ) => ( :: ConstructorNumber ( 0xd8caf68d ) , x ) , & Update :: updateBotWebhookJSON ( ref x ) => ( :: ConstructorNumber ( 0x8317c0c3 ) , x ) , & Update :: updateBotWebhookJSONQuery ( ref x ) => ( :: ConstructorNumber ( 0x9b9240a6 ) , x ) , & Update :: updateBotShippingQuery ( ref x ) => ( :: ConstructorNumber ( 0xe0cdc940 ) , x ) , & Update :: updateBotPrecheckoutQuery ( ref x ) => ( :: ConstructorNumber ( 0x5d2f3aa9 ) , x ) , & Update :: updatePhoneCall ( ref x ) => ( :: ConstructorNumber ( 0xab0f6b1e ) , x ) , & Update :: updateLangPackTooLong => ( :: ConstructorNumber ( 0x10c2404b ) , & ( ) ) , & Update :: updateLangPack ( ref x ) => ( :: ConstructorNumber ( 0x56022f4d ) , x ) , & Update :: updateFavedStickers => ( :: ConstructorNumber ( 0xe511996d ) , & ( ) ) , & Update :: updateChannelReadMessagesContents ( ref x ) => ( :: ConstructorNumber ( 0x89893b45 ) , x ) , & Update :: updateContactsReset => ( :: ConstructorNumber ( 0x7084a7be ) , & ( ) ) , & Update :: updateChannelAvailableMessages ( 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 :: updateNewMessage ( _de . read_bare :: < :: mtproto :: updateNewMessage > ( ) ? ) ) , :: ConstructorNumber ( 0x4e90bfd6 ) => Ok ( Update :: updateMessageID ( _de . read_bare :: < :: mtproto :: updateMessageID > ( ) ? ) ) , :: ConstructorNumber ( 0xa20db0e5 ) => Ok ( Update :: updateDeleteMessages ( _de . read_bare :: < :: mtproto :: updateDeleteMessages > ( ) ? ) ) , :: ConstructorNumber ( 0x5c486927 ) => Ok ( Update :: updateUserTyping ( _de . read_bare :: < :: mtproto :: updateUserTyping > ( ) ? ) ) , :: ConstructorNumber ( 0x9a65ea1f ) => Ok ( Update :: updateChatUserTyping ( _de . read_bare :: < :: mtproto :: updateChatUserTyping > ( ) ? ) ) , :: ConstructorNumber ( 0x07761198 ) => Ok ( Update :: updateChatParticipants ( _de . read_bare :: < :: mtproto :: updateChatParticipants > ( ) ? ) ) , :: ConstructorNumber ( 0x1bfbd823 ) => Ok ( Update :: updateUserStatus ( _de . read_bare :: < :: mtproto :: updateUserStatus > ( ) ? ) ) , :: ConstructorNumber ( 0xa7332b73 ) => Ok ( Update :: updateUserName ( _de . read_bare :: < :: mtproto :: updateUserName > ( ) ? ) ) , :: ConstructorNumber ( 0x95313b0c ) => Ok ( Update :: updateUserPhoto ( _de . read_bare :: < :: mtproto :: updateUserPhoto > ( ) ? ) ) , :: ConstructorNumber ( 0x2575bbb9 ) => Ok ( Update :: updateContactRegistered ( _de . read_bare :: < :: mtproto :: updateContactRegistered > ( ) ? ) ) , :: ConstructorNumber ( 0x9d2e67c5 ) => Ok ( Update :: updateContactLink ( _de . read_bare :: < :: mtproto :: updateContactLink > ( ) ? ) ) , :: ConstructorNumber ( 0x12bcbd9a ) => Ok ( Update :: updateNewEncryptedMessage ( _de . read_bare :: < :: mtproto :: updateNewEncryptedMessage > ( ) ? ) ) , :: ConstructorNumber ( 0x1710f156 ) => Ok ( Update :: updateEncryptedChatTyping ( _de . read_bare :: < :: mtproto :: updateEncryptedChatTyping > ( ) ? ) ) , :: ConstructorNumber ( 0xb4a2e88d ) => Ok ( Update :: updateEncryption ( _de . read_bare :: < :: mtproto :: updateEncryption > ( ) ? ) ) , :: ConstructorNumber ( 0x38fe25b7 ) => Ok ( Update :: updateEncryptedMessagesRead ( _de . read_bare :: < :: mtproto :: updateEncryptedMessagesRead > ( ) ? ) ) , :: ConstructorNumber ( 0xea4b0e5c ) => Ok ( Update :: updateChatParticipantAdd ( _de . read_bare :: < :: mtproto :: updateChatParticipantAdd > ( ) ? ) ) , :: ConstructorNumber ( 0x6e5f8c22 ) => Ok ( Update :: updateChatParticipantDelete ( _de . read_bare :: < :: mtproto :: updateChatParticipantDelete > ( ) ? ) ) , :: ConstructorNumber ( 0x8e5e9873 ) => Ok ( Update :: updateDcOptions ( _de . read_bare :: < :: mtproto :: updateDcOptions > ( ) ? ) ) , :: ConstructorNumber ( 0x80ece81a ) => Ok ( Update :: updateUserBlocked ( _de . read_bare :: < :: mtproto :: updateUserBlocked > ( ) ? ) ) , :: ConstructorNumber ( 0xbec268ef ) => Ok ( Update :: updateNotifySettings ( _de . read_bare :: < :: mtproto :: updateNotifySettings > ( ) ? ) ) , :: ConstructorNumber ( 0xebe46819 ) => Ok ( Update :: updateServiceNotification ( _de . read_bare :: < :: mtproto :: updateServiceNotification > ( ) ? ) ) , :: ConstructorNumber ( 0xee3b272a ) => Ok ( Update :: updatePrivacy ( _de . read_bare :: < :: mtproto :: updatePrivacy > ( ) ? ) ) , :: ConstructorNumber ( 0x12b9417b ) => Ok ( Update :: updateUserPhone ( _de . read_bare :: < :: mtproto :: updateUserPhone > ( ) ? ) ) , :: ConstructorNumber ( 0x9961fd5c ) => Ok ( Update :: updateReadHistoryInbox ( _de . read_bare :: < :: mtproto :: updateReadHistoryInbox > ( ) ? ) ) , :: ConstructorNumber ( 0x2f2f21bf ) => Ok ( Update :: updateReadHistoryOutbox ( _de . read_bare :: < :: mtproto :: updateReadHistoryOutbox > ( ) ? ) ) , :: ConstructorNumber ( 0x7f891213 ) => Ok ( Update :: updateWebPage ( _de . read_bare :: < :: mtproto :: updateWebPage > ( ) ? ) ) , :: ConstructorNumber ( 0x68c13933 ) => Ok ( Update :: updateReadMessagesContents ( _de . read_bare :: < :: mtproto :: updateReadMessagesContents > ( ) ? ) ) , :: ConstructorNumber ( 0xeb0467fb ) => Ok ( Update :: updateChannelTooLong ( _de . read_bare :: < :: mtproto :: updateChannelTooLong > ( ) ? ) ) , :: ConstructorNumber ( 0xb6d45656 ) => Ok ( Update :: updateChannel ( _de . read_bare :: < :: mtproto :: updateChannel > ( ) ? ) ) , :: ConstructorNumber ( 0x62ba04d9 ) => Ok ( Update :: updateNewChannelMessage ( _de . read_bare :: < :: mtproto :: updateNewChannelMessage > ( ) ? ) ) , :: ConstructorNumber ( 0x4214f37f ) => Ok ( Update :: updateReadChannelInbox ( _de . read_bare :: < :: mtproto :: updateReadChannelInbox > ( ) ? ) ) , :: ConstructorNumber ( 0xc37521c9 ) => Ok ( Update :: updateDeleteChannelMessages ( _de . read_bare :: < :: mtproto :: updateDeleteChannelMessages > ( ) ? ) ) , :: ConstructorNumber ( 0x98a12b4b ) => Ok ( Update :: updateChannelMessageViews ( _de . read_bare :: < :: mtproto :: updateChannelMessageViews > ( ) ? ) ) , :: ConstructorNumber ( 0x6e947941 ) => Ok ( Update :: updateChatAdmins ( _de . read_bare :: < :: mtproto :: updateChatAdmins > ( ) ? ) ) , :: ConstructorNumber ( 0xb6901959 ) => Ok ( Update :: updateChatParticipantAdmin ( _de . read_bare :: < :: mtproto :: updateChatParticipantAdmin > ( ) ? ) ) , :: ConstructorNumber ( 0x688a30aa ) => Ok ( Update :: updateNewStickerSet ( _de . read_bare :: < :: mtproto :: updateNewStickerSet > ( ) ? ) ) , :: ConstructorNumber ( 0x0bb2d201 ) => Ok ( Update :: updateStickerSetsOrder ( _de . read_bare :: < :: mtproto :: updateStickerSetsOrder > ( ) ? ) ) , :: ConstructorNumber ( 0x43ae3dec ) => Ok ( Update :: updateStickerSets ) , :: ConstructorNumber ( 0x9375341e ) => Ok ( Update :: updateSavedGifs ) , :: ConstructorNumber ( 0x54826690 ) => Ok ( Update :: updateBotInlineQuery ( _de . read_bare :: < :: mtproto :: updateBotInlineQuery > ( ) ? ) ) , :: ConstructorNumber ( 0x0e48f964 ) => Ok ( Update :: updateBotInlineSend ( _de . read_bare :: < :: mtproto :: updateBotInlineSend > ( ) ? ) ) , :: ConstructorNumber ( 0x1b3f4df7 ) => Ok ( Update :: updateEditChannelMessage ( _de . read_bare :: < :: mtproto :: updateEditChannelMessage > ( ) ? ) ) , :: ConstructorNumber ( 0x98592475 ) => Ok ( Update :: updateChannelPinnedMessage ( _de . read_bare :: < :: mtproto :: updateChannelPinnedMessage > ( ) ? ) ) , :: ConstructorNumber ( 0xe73547e1 ) => Ok ( Update :: updateBotCallbackQuery ( _de . read_bare :: < :: mtproto :: updateBotCallbackQuery > ( ) ? ) ) , :: ConstructorNumber ( 0xe40370a3 ) => Ok ( Update :: updateEditMessage ( _de . read_bare :: < :: mtproto :: updateEditMessage > ( ) ? ) ) , :: ConstructorNumber ( 0xf9d27a5a ) => Ok ( Update :: updateInlineBotCallbackQuery ( _de . read_bare :: < :: mtproto :: updateInlineBotCallbackQuery > ( ) ? ) ) , :: ConstructorNumber ( 0x25d6c9c7 ) => Ok ( Update :: updateReadChannelOutbox ( _de . read_bare :: < :: mtproto :: updateReadChannelOutbox > ( ) ? ) ) , :: ConstructorNumber ( 0xee2bb969 ) => Ok ( Update :: updateDraftMessage ( _de . read_bare :: < :: mtproto :: updateDraftMessage > ( ) ? ) ) , :: ConstructorNumber ( 0x571d2742 ) => Ok ( Update :: updateReadFeaturedStickers ) , :: ConstructorNumber ( 0x9a422c20 ) => Ok ( Update :: updateRecentStickers ) , :: ConstructorNumber ( 0xa229dd06 ) => Ok ( Update :: updateConfig ) , :: ConstructorNumber ( 0x3354678f ) => Ok ( Update :: updatePtsChanged ) , :: ConstructorNumber ( 0x40771900 ) => Ok ( Update :: updateChannelWebPage ( _de . read_bare :: < :: mtproto :: updateChannelWebPage > ( ) ? ) ) , :: ConstructorNumber ( 0xd711a2cc ) => Ok ( Update :: updateDialogPinned ( _de . read_bare :: < :: mtproto :: updateDialogPinned > ( ) ? ) ) , :: ConstructorNumber ( 0xd8caf68d ) => Ok ( Update :: updatePinnedDialogs ( _de . read_bare :: < :: mtproto :: updatePinnedDialogs > ( ) ? ) ) , :: ConstructorNumber ( 0x8317c0c3 ) => Ok ( Update :: updateBotWebhookJSON ( _de . read_bare :: < :: mtproto :: updateBotWebhookJSON > ( ) ? ) ) , :: ConstructorNumber ( 0x9b9240a6 ) => Ok ( Update :: updateBotWebhookJSONQuery ( _de . read_bare :: < :: mtproto :: updateBotWebhookJSONQuery > ( ) ? ) ) , :: ConstructorNumber ( 0xe0cdc940 ) => Ok ( Update :: updateBotShippingQuery ( _de . read_bare :: < :: mtproto :: updateBotShippingQuery > ( ) ? ) ) , :: ConstructorNumber ( 0x5d2f3aa9 ) => Ok ( Update :: updateBotPrecheckoutQuery ( _de . read_bare :: < :: mtproto :: updateBotPrecheckoutQuery > ( ) ? ) ) , :: ConstructorNumber ( 0xab0f6b1e ) => Ok ( Update :: updatePhoneCall ( _de . read_bare :: < :: mtproto :: updatePhoneCall > ( ) ? ) ) , :: ConstructorNumber ( 0x10c2404b ) => Ok ( Update :: updateLangPackTooLong ) , :: ConstructorNumber ( 0x56022f4d ) => Ok ( Update :: updateLangPack ( _de . read_bare :: < :: mtproto :: updateLangPack > ( ) ? ) ) , :: ConstructorNumber ( 0xe511996d ) => Ok ( Update :: updateFavedStickers ) , :: ConstructorNumber ( 0x89893b45 ) => Ok ( Update :: updateChannelReadMessagesContents ( _de . read_bare :: < :: mtproto :: updateChannelReadMessagesContents > ( ) ? ) ) , :: ConstructorNumber ( 0x7084a7be ) => Ok ( Update :: updateContactsReset ) , :: ConstructorNumber ( 0x70db6837 ) => Ok ( Update :: updateChannelAvailableMessages ( _de . read_bare :: < :: mtproto :: updateChannelAvailableMessages > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct updateNewMessage { pub message : :: mtproto :: Message , pub pts : :: mtproto :: int , pub pts_count : :: mtproto :: int , } impl :: BareSerialize for updateNewMessage { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateNewMessage { 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 updateNewMessage { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updateNewMessage { message : _de . read_boxed :: < :: mtproto :: Message > ( ) ? , pts : _de . read_bare :: < :: mtproto :: int > ( ) ? , pts_count : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for updateNewMessage { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateNewMessage ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateMessageID { pub id : :: mtproto :: int , pub random_id : :: mtproto :: long , } impl :: BareSerialize for updateMessageID { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateMessageID { ref id , ref random_id } = self ; _ser . write_bare :: < :: mtproto :: int > ( id ) ? ; _ser . write_bare :: < :: mtproto :: long > ( random_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for updateMessageID { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updateMessageID { id : _de . read_bare :: < :: mtproto :: int > ( ) ? , random_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for updateMessageID { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateMessageID ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateDeleteMessages { pub messages : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > , pub pts : :: mtproto :: int , pub pts_count : :: mtproto :: int , } impl :: BareSerialize for updateDeleteMessages { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateDeleteMessages { 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 updateDeleteMessages { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updateDeleteMessages { 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 updateDeleteMessages { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateDeleteMessages ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateUserTyping { pub user_id : :: mtproto :: int , pub action : :: mtproto :: SendMessageAction , } impl :: BareSerialize for updateUserTyping { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateUserTyping { ref user_id , ref action } = self ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; _ser . write_boxed :: < :: mtproto :: SendMessageAction > ( action ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for updateUserTyping { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updateUserTyping { user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , action : _de . read_boxed :: < :: mtproto :: SendMessageAction > ( ) ? , } ) } } impl :: IntoBoxed for updateUserTyping { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateUserTyping ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateChatUserTyping { pub chat_id : :: mtproto :: int , pub user_id : :: mtproto :: int , pub action : :: mtproto :: SendMessageAction , } impl :: BareSerialize for updateChatUserTyping { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateChatUserTyping { 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 updateChatUserTyping { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updateChatUserTyping { chat_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , action : _de . read_boxed :: < :: mtproto :: SendMessageAction > ( ) ? , } ) } } impl :: IntoBoxed for updateChatUserTyping { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateChatUserTyping ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateChatParticipants { pub participants : :: mtproto :: ChatParticipants , } impl :: BareSerialize for updateChatParticipants { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateChatParticipants { ref participants } = self ; _ser . write_boxed :: < :: mtproto :: ChatParticipants > ( participants ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for updateChatParticipants { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updateChatParticipants { participants : _de . read_boxed :: < :: mtproto :: ChatParticipants > ( ) ? , } ) } } impl :: IntoBoxed for updateChatParticipants { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateChatParticipants ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateUserStatus { pub user_id : :: mtproto :: int , pub status : :: mtproto :: UserStatus , } impl :: BareSerialize for updateUserStatus { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateUserStatus { ref user_id , ref status } = self ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; _ser . write_boxed :: < :: mtproto :: UserStatus > ( status ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for updateUserStatus { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updateUserStatus { user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , status : _de . read_boxed :: < :: mtproto :: UserStatus > ( ) ? , } ) } } impl :: IntoBoxed for updateUserStatus { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateUserStatus ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateUserName { pub user_id : :: mtproto :: int , pub first_name : :: mtproto :: string , pub last_name : :: mtproto :: string , pub username : :: mtproto :: string , } impl :: BareSerialize for updateUserName { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateUserName { 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 updateUserName { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updateUserName { 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 updateUserName { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateUserName ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateUserPhoto { pub user_id : :: mtproto :: int , pub date : :: mtproto :: int , pub photo : :: mtproto :: UserProfilePhoto , pub previous : :: mtproto :: Bool , } impl :: BareSerialize for updateUserPhoto { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateUserPhoto { 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 updateUserPhoto { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updateUserPhoto { 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 updateUserPhoto { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateUserPhoto ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateContactRegistered { pub user_id : :: mtproto :: int , pub date : :: mtproto :: int , } impl :: BareSerialize for updateContactRegistered { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateContactRegistered { ref user_id , ref date } = self ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for updateContactRegistered { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updateContactRegistered { user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for updateContactRegistered { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateContactRegistered ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateContactLink { pub user_id : :: mtproto :: int , pub my_link : :: mtproto :: ContactLink , pub foreign_link : :: mtproto :: ContactLink , } impl :: BareSerialize for updateContactLink { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateContactLink { 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 updateContactLink { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updateContactLink { user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , my_link : _de . read_boxed :: < :: mtproto :: ContactLink > ( ) ? , foreign_link : _de . read_boxed :: < :: mtproto :: ContactLink > ( ) ? , } ) } } impl :: IntoBoxed for updateContactLink { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateContactLink ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateNewEncryptedMessage { pub message : :: mtproto :: EncryptedMessage , pub qts : :: mtproto :: int , } impl :: BareSerialize for updateNewEncryptedMessage { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateNewEncryptedMessage { ref message , ref qts } = self ; _ser . write_boxed :: < :: mtproto :: EncryptedMessage > ( message ) ? ; _ser . write_bare :: < :: mtproto :: int > ( qts ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for updateNewEncryptedMessage { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updateNewEncryptedMessage { message : _de . read_boxed :: < :: mtproto :: EncryptedMessage > ( ) ? , qts : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for updateNewEncryptedMessage { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateNewEncryptedMessage ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateEncryptedChatTyping { pub chat_id : :: mtproto :: int , } impl :: BareSerialize for updateEncryptedChatTyping { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateEncryptedChatTyping { ref chat_id } = self ; _ser . write_bare :: < :: mtproto :: int > ( chat_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for updateEncryptedChatTyping { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updateEncryptedChatTyping { chat_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for updateEncryptedChatTyping { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateEncryptedChatTyping ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateEncryption { pub chat : :: mtproto :: EncryptedChat , pub date : :: mtproto :: int , } impl :: BareSerialize for updateEncryption { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateEncryption { ref chat , ref date } = self ; _ser . write_boxed :: < :: mtproto :: EncryptedChat > ( chat ) ? ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for updateEncryption { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updateEncryption { chat : _de . read_boxed :: < :: mtproto :: EncryptedChat > ( ) ? , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for updateEncryption { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateEncryption ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateEncryptedMessagesRead { pub chat_id : :: mtproto :: int , pub max_date : :: mtproto :: int , pub date : :: mtproto :: int , } impl :: BareSerialize for updateEncryptedMessagesRead { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateEncryptedMessagesRead { 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 updateEncryptedMessagesRead { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updateEncryptedMessagesRead { chat_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , max_date : _de . read_bare :: < :: mtproto :: int > ( ) ? , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for updateEncryptedMessagesRead { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateEncryptedMessagesRead ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateChatParticipantAdd { 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 updateChatParticipantAdd { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateChatParticipantAdd { 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 updateChatParticipantAdd { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updateChatParticipantAdd { 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 updateChatParticipantAdd { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateChatParticipantAdd ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateChatParticipantDelete { pub chat_id : :: mtproto :: int , pub user_id : :: mtproto :: int , pub version : :: mtproto :: int , } impl :: BareSerialize for updateChatParticipantDelete { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateChatParticipantDelete { 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 updateChatParticipantDelete { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updateChatParticipantDelete { chat_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , version : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for updateChatParticipantDelete { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateChatParticipantDelete ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateDcOptions { pub dc_options : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: DcOption > , } impl :: BareSerialize for updateDcOptions { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateDcOptions { ref dc_options } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: DcOption > > ( dc_options ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for updateDcOptions { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updateDcOptions { dc_options : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: DcOption > > ( ) ? , } ) } } impl :: IntoBoxed for updateDcOptions { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateDcOptions ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateUserBlocked { pub user_id : :: mtproto :: int , pub blocked : :: mtproto :: Bool , } impl :: BareSerialize for updateUserBlocked { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateUserBlocked { ref user_id , ref blocked } = self ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; _ser . write_boxed :: < :: mtproto :: Bool > ( blocked ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for updateUserBlocked { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updateUserBlocked { user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , blocked : _de . read_boxed :: < :: mtproto :: Bool > ( ) ? , } ) } } impl :: IntoBoxed for updateUserBlocked { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateUserBlocked ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateNotifySettings { pub peer : :: mtproto :: NotifyPeer , pub notify_settings : :: mtproto :: PeerNotifySettings , } impl :: BareSerialize for updateNotifySettings { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateNotifySettings { ref peer , ref notify_settings } = self ; _ser . write_boxed :: < :: mtproto :: NotifyPeer > ( peer ) ? ; _ser . write_boxed :: < :: mtproto :: PeerNotifySettings > ( notify_settings ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for updateNotifySettings { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updateNotifySettings { peer : _de . read_boxed :: < :: mtproto :: NotifyPeer > ( ) ? , notify_settings : _de . read_boxed :: < :: mtproto :: PeerNotifySettings > ( ) ? , } ) } } impl :: IntoBoxed for updateNotifySettings { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateNotifySettings ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateServiceNotification { 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 updateServiceNotification { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateServiceNotification { 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 updateServiceNotification { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( updateServiceNotification { 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 updateServiceNotification { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateServiceNotification ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updatePrivacy { pub key : :: mtproto :: PrivacyKey , pub rules : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PrivacyRule > , } impl :: BareSerialize for updatePrivacy { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updatePrivacy { 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 updatePrivacy { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updatePrivacy { key : _de . read_boxed :: < :: mtproto :: PrivacyKey > ( ) ? , rules : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: PrivacyRule > > ( ) ? , } ) } } impl :: IntoBoxed for updatePrivacy { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updatePrivacy ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateUserPhone { pub user_id : :: mtproto :: int , pub phone : :: mtproto :: string , } impl :: BareSerialize for updateUserPhone { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateUserPhone { ref user_id , ref phone } = self ; _ser . write_bare :: < :: mtproto :: int > ( user_id ) ? ; _ser . write_bare :: < :: mtproto :: string > ( phone ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for updateUserPhone { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updateUserPhone { user_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , phone : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for updateUserPhone { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateUserPhone ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateReadHistoryInbox { pub peer : :: mtproto :: Peer , pub max_id : :: mtproto :: int , pub pts : :: mtproto :: int , pub pts_count : :: mtproto :: int , } impl :: BareSerialize for updateReadHistoryInbox { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateReadHistoryInbox { 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 updateReadHistoryInbox { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updateReadHistoryInbox { 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 updateReadHistoryInbox { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateReadHistoryInbox ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateReadHistoryOutbox { pub peer : :: mtproto :: Peer , pub max_id : :: mtproto :: int , pub pts : :: mtproto :: int , pub pts_count : :: mtproto :: int , } impl :: BareSerialize for updateReadHistoryOutbox { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateReadHistoryOutbox { 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 updateReadHistoryOutbox { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updateReadHistoryOutbox { 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 updateReadHistoryOutbox { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateReadHistoryOutbox ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateWebPage { pub webpage : :: mtproto :: WebPage , pub pts : :: mtproto :: int , pub pts_count : :: mtproto :: int , } impl :: BareSerialize for updateWebPage { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateWebPage { 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 updateWebPage { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updateWebPage { webpage : _de . read_boxed :: < :: mtproto :: WebPage > ( ) ? , pts : _de . read_bare :: < :: mtproto :: int > ( ) ? , pts_count : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for updateWebPage { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateWebPage ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateReadMessagesContents { pub messages : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > , pub pts : :: mtproto :: int , pub pts_count : :: mtproto :: int , } impl :: BareSerialize for updateReadMessagesContents { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateReadMessagesContents { 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 updateReadMessagesContents { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updateReadMessagesContents { 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 updateReadMessagesContents { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateReadMessagesContents ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateChannelTooLong { pub channel_id : :: mtproto :: int , pub pts : Option < :: mtproto :: int > , } impl :: BareSerialize for updateChannelTooLong { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateChannelTooLong { 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 updateChannelTooLong { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( updateChannelTooLong { 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 updateChannelTooLong { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateChannelTooLong ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateChannel { pub channel_id : :: mtproto :: int , } impl :: BareSerialize for updateChannel { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateChannel { ref channel_id } = self ; _ser . write_bare :: < :: mtproto :: int > ( channel_id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for updateChannel { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updateChannel { channel_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for updateChannel { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateChannel ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateNewChannelMessage { pub message : :: mtproto :: Message , pub pts : :: mtproto :: int , pub pts_count : :: mtproto :: int , } impl :: BareSerialize for updateNewChannelMessage { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateNewChannelMessage { 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 updateNewChannelMessage { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updateNewChannelMessage { message : _de . read_boxed :: < :: mtproto :: Message > ( ) ? , pts : _de . read_bare :: < :: mtproto :: int > ( ) ? , pts_count : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for updateNewChannelMessage { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateNewChannelMessage ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateReadChannelInbox { pub channel_id : :: mtproto :: int , pub max_id : :: mtproto :: int , } impl :: BareSerialize for updateReadChannelInbox { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateReadChannelInbox { 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 updateReadChannelInbox { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updateReadChannelInbox { channel_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , max_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for updateReadChannelInbox { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateReadChannelInbox ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateDeleteChannelMessages { 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 updateDeleteChannelMessages { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateDeleteChannelMessages { 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 updateDeleteChannelMessages { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updateDeleteChannelMessages { 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 updateDeleteChannelMessages { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateDeleteChannelMessages ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateChannelMessageViews { pub channel_id : :: mtproto :: int , pub id : :: mtproto :: int , pub views : :: mtproto :: int , } impl :: BareSerialize for updateChannelMessageViews { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateChannelMessageViews { 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 updateChannelMessageViews { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updateChannelMessageViews { channel_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , id : _de . read_bare :: < :: mtproto :: int > ( ) ? , views : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for updateChannelMessageViews { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateChannelMessageViews ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateChatAdmins { pub chat_id : :: mtproto :: int , pub enabled : :: mtproto :: Bool , pub version : :: mtproto :: int , } impl :: BareSerialize for updateChatAdmins { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateChatAdmins { 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 updateChatAdmins { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updateChatAdmins { chat_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , enabled : _de . read_boxed :: < :: mtproto :: Bool > ( ) ? , version : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for updateChatAdmins { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateChatAdmins ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateChatParticipantAdmin { pub chat_id : :: mtproto :: int , pub user_id : :: mtproto :: int , pub is_admin : :: mtproto :: Bool , pub version : :: mtproto :: int , } impl :: BareSerialize for updateChatParticipantAdmin { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateChatParticipantAdmin { 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 updateChatParticipantAdmin { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updateChatParticipantAdmin { 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 updateChatParticipantAdmin { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateChatParticipantAdmin ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateNewStickerSet { pub stickerset : :: mtproto :: messages :: StickerSet , } impl :: BareSerialize for updateNewStickerSet { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateNewStickerSet { ref stickerset } = self ; _ser . write_boxed :: < :: mtproto :: messages :: StickerSet > ( stickerset ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for updateNewStickerSet { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updateNewStickerSet { stickerset : _de . read_boxed :: < :: mtproto :: messages :: StickerSet > ( ) ? , } ) } } impl :: IntoBoxed for updateNewStickerSet { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateNewStickerSet ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateStickerSetsOrder { pub masks : bool , pub order : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > , } impl :: BareSerialize for updateStickerSetsOrder { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateStickerSetsOrder { 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 updateStickerSetsOrder { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( updateStickerSetsOrder { masks : { flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; flags & ( 1 << 0u32 ) != 0 } , order : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > > ( ) ? , } ) } } impl :: IntoBoxed for updateStickerSetsOrder { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateStickerSetsOrder ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateBotInlineQuery { 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 updateBotInlineQuery { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateBotInlineQuery { 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 updateBotInlineQuery { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( updateBotInlineQuery { 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 updateBotInlineQuery { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateBotInlineQuery ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateBotInlineSend { 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 updateBotInlineSend { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateBotInlineSend { 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 updateBotInlineSend { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( updateBotInlineSend { 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 updateBotInlineSend { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateBotInlineSend ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateEditChannelMessage { pub message : :: mtproto :: Message , pub pts : :: mtproto :: int , pub pts_count : :: mtproto :: int , } impl :: BareSerialize for updateEditChannelMessage { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateEditChannelMessage { 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 updateEditChannelMessage { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updateEditChannelMessage { message : _de . read_boxed :: < :: mtproto :: Message > ( ) ? , pts : _de . read_bare :: < :: mtproto :: int > ( ) ? , pts_count : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for updateEditChannelMessage { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateEditChannelMessage ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateChannelPinnedMessage { pub channel_id : :: mtproto :: int , pub id : :: mtproto :: int , } impl :: BareSerialize for updateChannelPinnedMessage { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateChannelPinnedMessage { ref channel_id , ref id } = self ; _ser . write_bare :: < :: mtproto :: int > ( channel_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for updateChannelPinnedMessage { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updateChannelPinnedMessage { channel_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for updateChannelPinnedMessage { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateChannelPinnedMessage ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateBotCallbackQuery { 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 updateBotCallbackQuery { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateBotCallbackQuery { 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 updateBotCallbackQuery { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( updateBotCallbackQuery { 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 updateBotCallbackQuery { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateBotCallbackQuery ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateEditMessage { pub message : :: mtproto :: Message , pub pts : :: mtproto :: int , pub pts_count : :: mtproto :: int , } impl :: BareSerialize for updateEditMessage { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateEditMessage { 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 updateEditMessage { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updateEditMessage { message : _de . read_boxed :: < :: mtproto :: Message > ( ) ? , pts : _de . read_bare :: < :: mtproto :: int > ( ) ? , pts_count : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for updateEditMessage { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateEditMessage ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateInlineBotCallbackQuery { 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 updateInlineBotCallbackQuery { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateInlineBotCallbackQuery { 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 updateInlineBotCallbackQuery { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( updateInlineBotCallbackQuery { 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 updateInlineBotCallbackQuery { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateInlineBotCallbackQuery ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateReadChannelOutbox { pub channel_id : :: mtproto :: int , pub max_id : :: mtproto :: int , } impl :: BareSerialize for updateReadChannelOutbox { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateReadChannelOutbox { 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 updateReadChannelOutbox { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updateReadChannelOutbox { channel_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , max_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for updateReadChannelOutbox { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateReadChannelOutbox ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateDraftMessage { pub peer : :: mtproto :: Peer , pub draft : :: mtproto :: DraftMessage , } impl :: BareSerialize for updateDraftMessage { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateDraftMessage { ref peer , ref draft } = self ; _ser . write_boxed :: < :: mtproto :: Peer > ( peer ) ? ; _ser . write_boxed :: < :: mtproto :: DraftMessage > ( draft ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for updateDraftMessage { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updateDraftMessage { peer : _de . read_boxed :: < :: mtproto :: Peer > ( ) ? , draft : _de . read_boxed :: < :: mtproto :: DraftMessage > ( ) ? , } ) } } impl :: IntoBoxed for updateDraftMessage { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateDraftMessage ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateChannelWebPage { pub channel_id : :: mtproto :: int , pub webpage : :: mtproto :: WebPage , pub pts : :: mtproto :: int , pub pts_count : :: mtproto :: int , } impl :: BareSerialize for updateChannelWebPage { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateChannelWebPage { 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 updateChannelWebPage { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updateChannelWebPage { 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 updateChannelWebPage { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateChannelWebPage ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateDialogPinned { pub pinned : bool , pub peer : :: mtproto :: Peer , } impl :: BareSerialize for updateDialogPinned { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateDialogPinned { 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 updateDialogPinned { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( updateDialogPinned { pinned : { flags = _de . read_bare :: < :: mtproto :: Flags > ( ) ? ; flags & ( 1 << 0u32 ) != 0 } , peer : _de . read_boxed :: < :: mtproto :: Peer > ( ) ? , } ) } } impl :: IntoBoxed for updateDialogPinned { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateDialogPinned ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updatePinnedDialogs { pub order : Option < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Peer > > , } impl :: BareSerialize for updatePinnedDialogs { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updatePinnedDialogs { 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 updatePinnedDialogs { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( updatePinnedDialogs { 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 updatePinnedDialogs { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updatePinnedDialogs ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateBotWebhookJSON { pub data : :: mtproto :: DataJSON , } impl :: BareSerialize for updateBotWebhookJSON { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateBotWebhookJSON { ref data } = self ; _ser . write_boxed :: < :: mtproto :: DataJSON > ( data ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for updateBotWebhookJSON { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updateBotWebhookJSON { data : _de . read_boxed :: < :: mtproto :: DataJSON > ( ) ? , } ) } } impl :: IntoBoxed for updateBotWebhookJSON { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateBotWebhookJSON ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateBotWebhookJSONQuery { pub query_id : :: mtproto :: long , pub data : :: mtproto :: DataJSON , pub timeout : :: mtproto :: int , } impl :: BareSerialize for updateBotWebhookJSONQuery { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateBotWebhookJSONQuery { 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 updateBotWebhookJSONQuery { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updateBotWebhookJSONQuery { query_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , data : _de . read_boxed :: < :: mtproto :: DataJSON > ( ) ? , timeout : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for updateBotWebhookJSONQuery { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateBotWebhookJSONQuery ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateBotShippingQuery { pub query_id : :: mtproto :: long , pub user_id : :: mtproto :: int , pub payload : :: mtproto :: bytes , pub shipping_address : :: mtproto :: PostAddress , } impl :: BareSerialize for updateBotShippingQuery { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateBotShippingQuery { 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 updateBotShippingQuery { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updateBotShippingQuery { 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 updateBotShippingQuery { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateBotShippingQuery ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateBotPrecheckoutQuery { 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 updateBotPrecheckoutQuery { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateBotPrecheckoutQuery { 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 updateBotPrecheckoutQuery { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( updateBotPrecheckoutQuery { 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 updateBotPrecheckoutQuery { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateBotPrecheckoutQuery ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updatePhoneCall { pub phone_call : :: mtproto :: PhoneCall , } impl :: BareSerialize for updatePhoneCall { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updatePhoneCall { ref phone_call } = self ; _ser . write_boxed :: < :: mtproto :: PhoneCall > ( phone_call ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for updatePhoneCall { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updatePhoneCall { phone_call : _de . read_boxed :: < :: mtproto :: PhoneCall > ( ) ? , } ) } } impl :: IntoBoxed for updatePhoneCall { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updatePhoneCall ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateLangPack { pub difference : :: mtproto :: LangPackDifference , } impl :: BareSerialize for updateLangPack { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateLangPack { ref difference } = self ; _ser . write_boxed :: < :: mtproto :: LangPackDifference > ( difference ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for updateLangPack { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updateLangPack { difference : _de . read_boxed :: < :: mtproto :: LangPackDifference > ( ) ? , } ) } } impl :: IntoBoxed for updateLangPack { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateLangPack ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateChannelReadMessagesContents { pub channel_id : :: mtproto :: int , pub messages : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > , } impl :: BareSerialize for updateChannelReadMessagesContents { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateChannelReadMessagesContents { 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 updateChannelReadMessagesContents { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updateChannelReadMessagesContents { channel_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , messages : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > > ( ) ? , } ) } } impl :: IntoBoxed for updateChannelReadMessagesContents { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateChannelReadMessagesContents ( self ) } } # [ derive ( Debug , Clone ) ] pub struct updateChannelAvailableMessages { pub channel_id : :: mtproto :: int , pub available_min_id : :: mtproto :: int , } impl :: BareSerialize for updateChannelAvailableMessages { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & updateChannelAvailableMessages { 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 updateChannelAvailableMessages { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( updateChannelAvailableMessages { channel_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , available_min_id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for updateChannelAvailableMessages { type Boxed = Update ; fn into_boxed ( self ) -> Update { Update :: updateChannelAvailableMessages ( self ) } } # [ derive ( Debug , Clone ) ] pub enum Updates { updatesTooLong , updateShortMessage ( updateShortMessage ) , updateShortChatMessage ( updateShortChatMessage ) , updateShort ( updateShort ) , updatesCombined ( updatesCombined ) , updates_ ( updates_ ) , updateShortSentMessage ( updateShortSentMessage ) , } 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 :: updateShortMessage > ( ) ? ) ) , :: ConstructorNumber ( 0x16812688 ) => Ok ( Updates :: updateShortChatMessage ( _de . read_bare :: < :: mtproto :: updateShortChatMessage > ( ) ? ) ) , :: ConstructorNumber ( 0x78d4dec1 ) => Ok ( Updates :: updateShort ( _de . read_bare :: < :: mtproto :: updateShort > ( ) ? ) ) , :: ConstructorNumber ( 0x725b04c3 ) => Ok ( Updates :: updatesCombined ( _de . read_bare :: < :: mtproto :: updatesCombined > ( ) ? ) ) , :: ConstructorNumber ( 0x74ae4240 ) => Ok ( Updates :: updates_ ( _de . read_bare :: < :: mtproto :: updates_ > ( ) ? ) ) , :: ConstructorNumber ( 0x11f1331c ) => Ok ( Updates :: updateShortSentMessage ( _de . read_bare :: < :: mtproto :: updateShortSentMessage > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = Updates ; fn into_boxed ( self ) -> Updates { Updates :: updateShortMessage ( self ) } } # [ derive ( Debug , Clone ) ] 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 = Updates ; fn into_boxed ( self ) -> Updates { Updates :: updateShortChatMessage ( self ) } } # [ derive ( Debug , Clone ) ] 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 = Updates ; fn into_boxed ( self ) -> Updates { Updates :: updateShort ( self ) } } # [ derive ( Debug , Clone ) ] 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 = Updates ; fn into_boxed ( self ) -> Updates { Updates :: updatesCombined ( self ) } } # [ derive ( Debug , Clone ) ] 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 = Updates ; fn into_boxed ( self ) -> Updates { Updates :: updates_ ( self ) } } # [ derive ( Debug , Clone ) ] 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 = Updates ; fn into_boxed ( self ) -> Updates { Updates :: updateShortSentMessage ( self ) } } # [ derive ( Debug , Clone ) ] pub enum User { userEmpty ( userEmpty ) , user ( user ) , } impl :: BoxedSerialize for User { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & User :: userEmpty ( 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 :: userEmpty ( _de . read_bare :: < :: mtproto :: userEmpty > ( ) ? ) ) , :: ConstructorNumber ( 0x2e13f4c3 ) => Ok ( User :: user ( _de . read_bare :: < :: mtproto :: user > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct userEmpty { pub id : :: mtproto :: int , } impl :: BareSerialize for userEmpty { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & userEmpty { ref id } = self ; _ser . write_bare :: < :: mtproto :: int > ( id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for userEmpty { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( userEmpty { id : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for userEmpty { type Boxed = User ; fn into_boxed ( self ) -> User { User :: userEmpty ( self ) } } # [ derive ( Debug , Clone ) ] 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 = User ; fn into_boxed ( self ) -> User { User :: user ( self ) } } # [ derive ( Debug , Clone ) ] pub enum UserFull { userFull ( userFull ) , } 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 :: userFull > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = UserFull ; fn into_boxed ( self ) -> UserFull { UserFull :: userFull ( self ) } } # [ derive ( Debug , Clone ) ] pub enum UserProfilePhoto { userProfilePhotoEmpty , userProfilePhoto ( userProfilePhoto ) , } impl :: BoxedSerialize for UserProfilePhoto { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & UserProfilePhoto :: userProfilePhotoEmpty => ( :: 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 :: userProfilePhotoEmpty ) , :: ConstructorNumber ( 0xd559d8c8 ) => Ok ( UserProfilePhoto :: userProfilePhoto ( _de . read_bare :: < :: mtproto :: userProfilePhoto > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = UserProfilePhoto ; fn into_boxed ( self ) -> UserProfilePhoto { UserProfilePhoto :: userProfilePhoto ( self ) } } # [ derive ( Debug , Clone ) ] pub enum UserStatus { userStatusEmpty , userStatusOnline ( userStatusOnline ) , userStatusOffline ( userStatusOffline ) , userStatusRecently , userStatusLastWeek , userStatusLastMonth , } impl :: BoxedSerialize for UserStatus { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & UserStatus :: userStatusEmpty => ( :: ConstructorNumber ( 0x09d05049 ) , & ( ) ) , & UserStatus :: userStatusOnline ( ref x ) => ( :: ConstructorNumber ( 0xedb93949 ) , x ) , & UserStatus :: userStatusOffline ( ref x ) => ( :: ConstructorNumber ( 0x008c703f ) , x ) , & UserStatus :: userStatusRecently => ( :: ConstructorNumber ( 0xe26f42f1 ) , & ( ) ) , & UserStatus :: userStatusLastWeek => ( :: ConstructorNumber ( 0x07bf09fc ) , & ( ) ) , & UserStatus :: userStatusLastMonth => ( :: 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 :: userStatusEmpty ) , :: ConstructorNumber ( 0xedb93949 ) => Ok ( UserStatus :: userStatusOnline ( _de . read_bare :: < :: mtproto :: userStatusOnline > ( ) ? ) ) , :: ConstructorNumber ( 0x008c703f ) => Ok ( UserStatus :: userStatusOffline ( _de . read_bare :: < :: mtproto :: userStatusOffline > ( ) ? ) ) , :: ConstructorNumber ( 0xe26f42f1 ) => Ok ( UserStatus :: userStatusRecently ) , :: ConstructorNumber ( 0x07bf09fc ) => Ok ( UserStatus :: userStatusLastWeek ) , :: ConstructorNumber ( 0x77ebc742 ) => Ok ( UserStatus :: userStatusLastMonth ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct userStatusOnline { pub expires : :: mtproto :: int , } impl :: BareSerialize for userStatusOnline { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & userStatusOnline { ref expires } = self ; _ser . write_bare :: < :: mtproto :: int > ( expires ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for userStatusOnline { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( userStatusOnline { expires : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for userStatusOnline { type Boxed = UserStatus ; fn into_boxed ( self ) -> UserStatus { UserStatus :: userStatusOnline ( self ) } } # [ derive ( Debug , Clone ) ] pub struct userStatusOffline { pub was_online : :: mtproto :: int , } impl :: BareSerialize for userStatusOffline { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & userStatusOffline { ref was_online } = self ; _ser . write_bare :: < :: mtproto :: int > ( was_online ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for userStatusOffline { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( userStatusOffline { was_online : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for userStatusOffline { type Boxed = UserStatus ; fn into_boxed ( self ) -> UserStatus { UserStatus :: userStatusOffline ( self ) } } # [ derive ( Debug , Clone ) ] pub enum WallPaper { wallPaper ( wallPaper ) , wallPaperSolid ( wallPaperSolid ) , } impl :: BoxedSerialize for WallPaper { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & WallPaper :: wallPaper ( ref x ) => ( :: ConstructorNumber ( 0xccb03657 ) , x ) , & WallPaper :: wallPaperSolid ( 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 :: wallPaper > ( ) ? ) ) , :: ConstructorNumber ( 0x63117f24 ) => Ok ( WallPaper :: wallPaperSolid ( _de . read_bare :: < :: mtproto :: wallPaperSolid > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = WallPaper ; fn into_boxed ( self ) -> WallPaper { WallPaper :: wallPaper ( self ) } } # [ derive ( Debug , Clone ) ] pub struct wallPaperSolid { pub id : :: mtproto :: int , pub title : :: mtproto :: string , pub bg_color : :: mtproto :: int , pub color : :: mtproto :: int , } impl :: BareSerialize for wallPaperSolid { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & wallPaperSolid { 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 wallPaperSolid { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( wallPaperSolid { 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 wallPaperSolid { type Boxed = WallPaper ; fn into_boxed ( self ) -> WallPaper { WallPaper :: wallPaperSolid ( self ) } } # [ derive ( Debug , Clone ) ] pub enum WebDocument { webDocument ( webDocument ) , } 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 :: webDocument > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = WebDocument ; fn into_boxed ( self ) -> WebDocument { WebDocument :: webDocument ( self ) } } # [ derive ( Debug , Clone ) ] pub enum WebPage { webPageEmpty ( webPageEmpty ) , webPagePending ( webPagePending ) , webPage ( webPage ) , webPageNotModified , } impl :: BoxedSerialize for WebPage { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & WebPage :: webPageEmpty ( ref x ) => ( :: ConstructorNumber ( 0xeb1477e8 ) , x ) , & WebPage :: webPagePending ( ref x ) => ( :: ConstructorNumber ( 0xc586da1c ) , x ) , & WebPage :: webPage ( ref x ) => ( :: ConstructorNumber ( 0x5f07b4bc ) , x ) , & WebPage :: webPageNotModified => ( :: 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 :: webPageEmpty ( _de . read_bare :: < :: mtproto :: webPageEmpty > ( ) ? ) ) , :: ConstructorNumber ( 0xc586da1c ) => Ok ( WebPage :: webPagePending ( _de . read_bare :: < :: mtproto :: webPagePending > ( ) ? ) ) , :: ConstructorNumber ( 0x5f07b4bc ) => Ok ( WebPage :: webPage ( _de . read_bare :: < :: mtproto :: webPage > ( ) ? ) ) , :: ConstructorNumber ( 0x85849473 ) => Ok ( WebPage :: webPageNotModified ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct webPageEmpty { pub id : :: mtproto :: long , } impl :: BareSerialize for webPageEmpty { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & webPageEmpty { ref id } = self ; _ser . write_bare :: < :: mtproto :: long > ( id ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for webPageEmpty { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( webPageEmpty { id : _de . read_bare :: < :: mtproto :: long > ( ) ? , } ) } } impl :: IntoBoxed for webPageEmpty { type Boxed = WebPage ; fn into_boxed ( self ) -> WebPage { WebPage :: webPageEmpty ( self ) } } # [ derive ( Debug , Clone ) ] pub struct webPagePending { pub id : :: mtproto :: long , pub date : :: mtproto :: int , } impl :: BareSerialize for webPagePending { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & webPagePending { ref id , ref date } = self ; _ser . write_bare :: < :: mtproto :: long > ( id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for webPagePending { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( webPagePending { id : _de . read_bare :: < :: mtproto :: long > ( ) ? , date : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for webPagePending { type Boxed = WebPage ; fn into_boxed ( self ) -> WebPage { WebPage :: webPagePending ( self ) } } # [ derive ( Debug , Clone ) ] 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 = WebPage ; fn into_boxed ( self ) -> WebPage { WebPage :: webPage ( self ) } } pub mod account { # [ derive ( Debug , Clone ) ] pub enum Authorizations { authorizations ( 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 > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = Authorizations ; fn into_boxed ( self ) -> Authorizations { Authorizations :: authorizations ( self ) } } # [ derive ( Debug , Clone ) ] pub enum Password { noPassword ( noPassword ) , password ( password ) , } 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 :: noPassword > ( ) ? ) ) , :: ConstructorNumber ( 0x7c18141c ) => Ok ( Password :: password ( _de . read_bare :: < :: mtproto :: account :: password > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = Password ; fn into_boxed ( self ) -> Password { Password :: noPassword ( self ) } } # [ derive ( Debug , Clone ) ] 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 = Password ; fn into_boxed ( self ) -> Password { Password :: password ( self ) } } # [ derive ( Debug , Clone ) ] pub enum PasswordInputSettings { passwordInputSettings ( passwordInputSettings ) , } 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 :: passwordInputSettings > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = PasswordInputSettings ; fn into_boxed ( self ) -> PasswordInputSettings { PasswordInputSettings :: passwordInputSettings ( self ) } } # [ derive ( Debug , Clone ) ] pub enum PasswordSettings { passwordSettings ( passwordSettings ) , } 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 :: passwordSettings > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = PasswordSettings ; fn into_boxed ( self ) -> PasswordSettings { PasswordSettings :: passwordSettings ( self ) } } # [ derive ( Debug , Clone ) ] pub enum PrivacyRules { privacyRules ( privacyRules ) , } 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 :: privacyRules > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = PrivacyRules ; fn into_boxed ( self ) -> PrivacyRules { PrivacyRules :: privacyRules ( self ) } } # [ derive ( Debug , Clone ) ] pub enum TmpPassword { tmpPassword ( tmpPassword ) , } 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 :: tmpPassword > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = TmpPassword ; fn into_boxed ( self ) -> TmpPassword { TmpPassword :: tmpPassword ( self ) } } } pub mod auth { # [ derive ( Debug , Clone ) ] pub enum Authorization { authorization ( authorization ) , } 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 > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = Authorization ; fn into_boxed ( self ) -> Authorization { Authorization :: authorization ( self ) } } # [ derive ( Debug , Clone ) ] pub enum CheckedPhone { checkedPhone ( checkedPhone ) , } 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 :: checkedPhone > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = CheckedPhone ; fn into_boxed ( self ) -> CheckedPhone { CheckedPhone :: checkedPhone ( self ) } } # [ derive ( Debug , Clone ) ] pub enum CodeType { codeTypeSms , codeTypeCall , codeTypeFlashCall , } impl :: BoxedSerialize for CodeType { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & CodeType :: codeTypeSms => ( :: ConstructorNumber ( 0x72a3158c ) , & ( ) ) , & CodeType :: codeTypeCall => ( :: ConstructorNumber ( 0x741cd3e3 ) , & ( ) ) , & CodeType :: codeTypeFlashCall => ( :: 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 :: codeTypeSms ) , :: ConstructorNumber ( 0x741cd3e3 ) => Ok ( CodeType :: codeTypeCall ) , :: ConstructorNumber ( 0x226ccefb ) => Ok ( CodeType :: codeTypeFlashCall ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub enum ExportedAuthorization { exportedAuthorization ( exportedAuthorization ) , } 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 :: exportedAuthorization > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = ExportedAuthorization ; fn into_boxed ( self ) -> ExportedAuthorization { ExportedAuthorization :: exportedAuthorization ( self ) } } # [ derive ( Debug , Clone ) ] pub enum PasswordRecovery { passwordRecovery ( passwordRecovery ) , } 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 :: passwordRecovery > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = PasswordRecovery ; fn into_boxed ( self ) -> PasswordRecovery { PasswordRecovery :: passwordRecovery ( self ) } } # [ derive ( Debug , Clone ) ] pub enum SentCode { sentCode ( sentCode ) , } 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 :: sentCode > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = SentCode ; fn into_boxed ( self ) -> SentCode { SentCode :: sentCode ( self ) } } # [ derive ( Debug , Clone ) ] pub enum SentCodeType { sentCodeTypeApp ( sentCodeTypeApp ) , sentCodeTypeSms ( sentCodeTypeSms ) , sentCodeTypeCall ( sentCodeTypeCall ) , sentCodeTypeFlashCall ( sentCodeTypeFlashCall ) , } impl :: BoxedSerialize for SentCodeType { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & SentCodeType :: sentCodeTypeApp ( ref x ) => ( :: ConstructorNumber ( 0x3dbb5986 ) , x ) , & SentCodeType :: sentCodeTypeSms ( ref x ) => ( :: ConstructorNumber ( 0xc000bba2 ) , x ) , & SentCodeType :: sentCodeTypeCall ( ref x ) => ( :: ConstructorNumber ( 0x5353e5a7 ) , x ) , & SentCodeType :: sentCodeTypeFlashCall ( 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 :: sentCodeTypeApp ( _de . read_bare :: < :: mtproto :: auth :: sentCodeTypeApp > ( ) ? ) ) , :: ConstructorNumber ( 0xc000bba2 ) => Ok ( SentCodeType :: sentCodeTypeSms ( _de . read_bare :: < :: mtproto :: auth :: sentCodeTypeSms > ( ) ? ) ) , :: ConstructorNumber ( 0x5353e5a7 ) => Ok ( SentCodeType :: sentCodeTypeCall ( _de . read_bare :: < :: mtproto :: auth :: sentCodeTypeCall > ( ) ? ) ) , :: ConstructorNumber ( 0xab03c6d9 ) => Ok ( SentCodeType :: sentCodeTypeFlashCall ( _de . read_bare :: < :: mtproto :: auth :: sentCodeTypeFlashCall > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct sentCodeTypeApp { pub length : :: mtproto :: int , } impl :: BareSerialize for sentCodeTypeApp { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & sentCodeTypeApp { ref length } = self ; _ser . write_bare :: < :: mtproto :: int > ( length ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for sentCodeTypeApp { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( sentCodeTypeApp { length : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for sentCodeTypeApp { type Boxed = SentCodeType ; fn into_boxed ( self ) -> SentCodeType { SentCodeType :: sentCodeTypeApp ( self ) } } # [ derive ( Debug , Clone ) ] pub struct sentCodeTypeSms { pub length : :: mtproto :: int , } impl :: BareSerialize for sentCodeTypeSms { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & sentCodeTypeSms { ref length } = self ; _ser . write_bare :: < :: mtproto :: int > ( length ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for sentCodeTypeSms { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( sentCodeTypeSms { length : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for sentCodeTypeSms { type Boxed = SentCodeType ; fn into_boxed ( self ) -> SentCodeType { SentCodeType :: sentCodeTypeSms ( self ) } } # [ derive ( Debug , Clone ) ] pub struct sentCodeTypeCall { pub length : :: mtproto :: int , } impl :: BareSerialize for sentCodeTypeCall { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & sentCodeTypeCall { ref length } = self ; _ser . write_bare :: < :: mtproto :: int > ( length ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for sentCodeTypeCall { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( sentCodeTypeCall { length : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for sentCodeTypeCall { type Boxed = SentCodeType ; fn into_boxed ( self ) -> SentCodeType { SentCodeType :: sentCodeTypeCall ( self ) } } # [ derive ( Debug , Clone ) ] pub struct sentCodeTypeFlashCall { pub pattern : :: mtproto :: string , } impl :: BareSerialize for sentCodeTypeFlashCall { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & sentCodeTypeFlashCall { ref pattern } = self ; _ser . write_bare :: < :: mtproto :: string > ( pattern ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for sentCodeTypeFlashCall { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( sentCodeTypeFlashCall { pattern : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for sentCodeTypeFlashCall { type Boxed = SentCodeType ; fn into_boxed ( self ) -> SentCodeType { SentCodeType :: sentCodeTypeFlashCall ( self ) } } } pub mod channels { # [ derive ( Debug , Clone ) ] pub enum AdminLogResults { adminLogResults ( adminLogResults ) , } 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 :: adminLogResults > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = AdminLogResults ; fn into_boxed ( self ) -> AdminLogResults { AdminLogResults :: adminLogResults ( self ) } } # [ derive ( Debug , Clone ) ] pub enum ChannelParticipant { channelParticipant ( channelParticipant ) , } 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 :: channelParticipant > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = ChannelParticipant ; fn into_boxed ( self ) -> ChannelParticipant { ChannelParticipant :: channelParticipant ( self ) } } # [ derive ( Debug , Clone ) ] pub enum ChannelParticipants { channelParticipants ( channelParticipants ) , channelParticipantsNotModified , } impl :: BoxedSerialize for ChannelParticipants { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ChannelParticipants :: channelParticipants ( ref x ) => ( :: ConstructorNumber ( 0xf56ee2a8 ) , x ) , & ChannelParticipants :: channelParticipantsNotModified => ( :: 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 :: channelParticipants > ( ) ? ) ) , :: ConstructorNumber ( 0xf0173fe9 ) => Ok ( ChannelParticipants :: channelParticipantsNotModified ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = ChannelParticipants ; fn into_boxed ( self ) -> ChannelParticipants { ChannelParticipants :: channelParticipants ( self ) } } } pub mod contacts { # [ derive ( Debug , Clone ) ] pub enum Blocked { blocked ( blocked ) , blockedSlice ( blockedSlice ) , } impl :: BoxedSerialize for Blocked { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Blocked :: blocked ( ref x ) => ( :: ConstructorNumber ( 0x1c138d15 ) , x ) , & Blocked :: blockedSlice ( 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 > ( ) ? ) ) , :: ConstructorNumber ( 0x900802a1 ) => Ok ( Blocked :: blockedSlice ( _de . read_bare :: < :: mtproto :: contacts :: blockedSlice > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = Blocked ; fn into_boxed ( self ) -> Blocked { Blocked :: blocked ( self ) } } # [ derive ( Debug , Clone ) ] pub struct blockedSlice { pub count : :: mtproto :: int , pub blocked : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: ContactBlocked > , pub users : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > , } impl :: BareSerialize for blockedSlice { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & blockedSlice { 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 blockedSlice { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( blockedSlice { 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 blockedSlice { type Boxed = Blocked ; fn into_boxed ( self ) -> Blocked { Blocked :: blockedSlice ( self ) } } # [ derive ( Debug , Clone ) ] pub enum Contacts { contactsNotModified , contacts ( contacts ) , } impl :: BoxedSerialize for Contacts { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Contacts :: contactsNotModified => ( :: 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 :: contactsNotModified ) , :: ConstructorNumber ( 0xeae87e42 ) => Ok ( Contacts :: contacts ( _de . read_bare :: < :: mtproto :: contacts :: contacts > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = Contacts ; fn into_boxed ( self ) -> Contacts { Contacts :: contacts ( self ) } } # [ derive ( Debug , Clone ) ] pub enum Found { found ( found ) , } 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 > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = Found ; fn into_boxed ( self ) -> Found { Found :: found ( self ) } } # [ derive ( Debug , Clone ) ] pub enum ImportedContacts { importedContacts ( importedContacts ) , } 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 :: importedContacts > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = ImportedContacts ; fn into_boxed ( self ) -> ImportedContacts { ImportedContacts :: importedContacts ( self ) } } # [ derive ( Debug , Clone ) ] pub enum Link { link ( link ) , } 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 > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = Link ; fn into_boxed ( self ) -> Link { Link :: link ( self ) } } # [ derive ( Debug , Clone ) ] pub enum ResolvedPeer { resolvedPeer ( resolvedPeer ) , } 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 :: resolvedPeer > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = ResolvedPeer ; fn into_boxed ( self ) -> ResolvedPeer { ResolvedPeer :: resolvedPeer ( self ) } } # [ derive ( Debug , Clone ) ] pub enum TopPeers { topPeersNotModified , topPeers ( topPeers ) , } impl :: BoxedSerialize for TopPeers { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & TopPeers :: topPeersNotModified => ( :: 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 :: topPeersNotModified ) , :: ConstructorNumber ( 0x70b772a8 ) => Ok ( TopPeers :: topPeers ( _de . read_bare :: < :: mtproto :: contacts :: topPeers > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = TopPeers ; fn into_boxed ( self ) -> TopPeers { TopPeers :: topPeers ( self ) } } } pub mod help { # [ derive ( Debug , Clone ) ] pub enum AppUpdate { appUpdate ( appUpdate ) , noAppUpdate , } 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 :: appUpdate > ( ) ? ) ) , :: ConstructorNumber ( 0xc45a6536 ) => Ok ( AppUpdate :: noAppUpdate ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = AppUpdate ; fn into_boxed ( self ) -> AppUpdate { AppUpdate :: appUpdate ( self ) } } # [ derive ( Debug , Clone ) ] pub enum ConfigSimple { configSimple ( configSimple ) , } 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 :: configSimple > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 :: 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 :: 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 :: ipPort > > ( ) ? , } ) } } impl :: IntoBoxed for configSimple { type Boxed = ConfigSimple ; fn into_boxed ( self ) -> ConfigSimple { ConfigSimple :: configSimple ( self ) } } # [ derive ( Debug , Clone ) ] pub enum InviteText { inviteText ( inviteText ) , } 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 :: inviteText > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = InviteText ; fn into_boxed ( self ) -> InviteText { InviteText :: inviteText ( self ) } } # [ derive ( Debug , Clone ) ] pub enum RecentMeUrls { recentMeUrls ( recentMeUrls ) , } 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 :: recentMeUrls > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = RecentMeUrls ; fn into_boxed ( self ) -> RecentMeUrls { RecentMeUrls :: recentMeUrls ( self ) } } # [ derive ( Debug , Clone ) ] pub enum Support { support ( support ) , } 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 > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = Support ; fn into_boxed ( self ) -> Support { Support :: support ( self ) } } # [ derive ( Debug , Clone ) ] pub enum TermsOfService { termsOfService ( termsOfService ) , } 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 :: termsOfService > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = TermsOfService ; fn into_boxed ( self ) -> TermsOfService { TermsOfService :: termsOfService ( self ) } } } pub mod manual { # [ derive ( Debug , Clone ) ] pub enum BindAuthKeyInner { bind_auth_key_inner ( bind_auth_key_inner ) , } impl :: BoxedSerialize for BindAuthKeyInner { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & BindAuthKeyInner :: bind_auth_key_inner ( 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 :: bind_auth_key_inner ( _de . read_bare :: < :: mtproto :: manual :: bind_auth_key_inner > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct bind_auth_key_inner { 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 bind_auth_key_inner { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & bind_auth_key_inner { 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 bind_auth_key_inner { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( bind_auth_key_inner { 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 bind_auth_key_inner { type Boxed = BindAuthKeyInner ; fn into_boxed ( self ) -> BindAuthKeyInner { BindAuthKeyInner :: bind_auth_key_inner ( self ) } } # [ derive ( Debug , Clone ) ] pub struct encrypted { 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 encrypted { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & encrypted { 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_boxed :: < :: mtproto :: LengthPrefixedTypedObject > ( payload ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for encrypted { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( encrypted { 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_boxed :: < :: mtproto :: LengthPrefixedTypedObject > ( ) ? , } ) } } # [ derive ( Debug , Clone ) ] pub enum GzipPacked { gzip_packed ( gzip_packed ) , } impl :: BoxedSerialize for GzipPacked { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & GzipPacked :: gzip_packed ( 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 :: gzip_packed ( _de . read_bare :: < :: mtproto :: manual :: gzip_packed > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct gzip_packed { pub packed_data : :: mtproto :: bytes , } impl :: BareSerialize for gzip_packed { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & gzip_packed { ref packed_data } = self ; _ser . write_bare :: < :: mtproto :: bytes > ( packed_data ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for gzip_packed { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( gzip_packed { packed_data : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , } ) } } impl :: IntoBoxed for gzip_packed { type Boxed = GzipPacked ; fn into_boxed ( self ) -> GzipPacked { GzipPacked :: gzip_packed ( self ) } } # [ derive ( Debug , Clone ) ] pub struct ll_message { pub msg_id : :: mtproto :: long , pub seqno : :: mtproto :: int , pub body : :: mtproto :: LengthPrefixedTypedObject , } impl :: BareSerialize for ll_message { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ll_message { ref msg_id , ref seqno , ref body } = self ; _ser . write_bare :: < :: mtproto :: long > ( msg_id ) ? ; _ser . write_bare :: < :: mtproto :: int > ( seqno ) ? ; _ser . write_boxed :: < :: mtproto :: LengthPrefixedTypedObject > ( body ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for ll_message { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( ll_message { msg_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , seqno : _de . read_bare :: < :: mtproto :: int > ( ) ? , body : _de . read_boxed :: < :: mtproto :: LengthPrefixedTypedObject > ( ) ? , } ) } } # [ derive ( Debug , Clone ) ] pub enum MessageContainer { msg_container ( msg_container ) , } impl :: BoxedSerialize for MessageContainer { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & MessageContainer :: msg_container ( 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 :: msg_container ( _de . read_bare :: < :: mtproto :: manual :: msg_container > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct msg_container { pub messages : :: mtproto :: vector < :: mtproto :: Bare , :: mtproto :: manual :: ll_message > , } impl :: BareSerialize for msg_container { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & msg_container { ref messages } = self ; _ser . write_bare :: < :: mtproto :: vector < :: mtproto :: Bare , :: mtproto :: manual :: ll_message > > ( messages ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for msg_container { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( msg_container { messages : _de . read_bare :: < :: mtproto :: vector < :: mtproto :: Bare , :: mtproto :: manual :: ll_message > > ( ) ? , } ) } } impl :: IntoBoxed for msg_container { type Boxed = MessageContainer ; fn into_boxed ( self ) -> MessageContainer { MessageContainer :: msg_container ( self ) } } # [ derive ( Debug , Clone ) ] pub struct plain { pub auth_key_id : :: mtproto :: long , pub message_id : :: mtproto :: long , pub payload : :: mtproto :: LengthPrefixedTypedObject , } impl :: BareSerialize for plain { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & plain { 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_boxed :: < :: mtproto :: LengthPrefixedTypedObject > ( payload ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for plain { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( plain { auth_key_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , message_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , payload : _de . read_boxed :: < :: mtproto :: LengthPrefixedTypedObject > ( ) ? , } ) } } # [ derive ( Debug , Clone ) ] pub enum RpcResult { rpc_result ( rpc_result ) , } impl :: BoxedSerialize for RpcResult { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & RpcResult :: rpc_result ( 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 :: rpc_result ( _de . read_bare :: < :: mtproto :: manual :: rpc_result > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct rpc_result { pub req_msg_id : :: mtproto :: long , pub result : :: mtproto :: TypedObject , } impl :: BareSerialize for rpc_result { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & rpc_result { 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 rpc_result { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( rpc_result { req_msg_id : _de . read_bare :: < :: mtproto :: long > ( ) ? , result : _de . read_boxed :: < :: mtproto :: TypedObject > ( ) ? , } ) } } impl :: IntoBoxed for rpc_result { type Boxed = RpcResult ; fn into_boxed ( self ) -> RpcResult { RpcResult :: rpc_result ( self ) } } } pub mod messages { # [ derive ( Debug , Clone ) ] pub enum AffectedHistory { affectedHistory ( affectedHistory ) , } 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 :: affectedHistory > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = AffectedHistory ; fn into_boxed ( self ) -> AffectedHistory { AffectedHistory :: affectedHistory ( self ) } } # [ derive ( Debug , Clone ) ] pub enum AffectedMessages { affectedMessages ( affectedMessages ) , } 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 :: affectedMessages > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = AffectedMessages ; fn into_boxed ( self ) -> AffectedMessages { AffectedMessages :: affectedMessages ( self ) } } # [ derive ( Debug , Clone ) ] pub enum AllStickers { allStickersNotModified , allStickers ( allStickers ) , } impl :: BoxedSerialize for AllStickers { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & AllStickers :: allStickersNotModified => ( :: 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 :: allStickersNotModified ) , :: ConstructorNumber ( 0xedfd405f ) => Ok ( AllStickers :: allStickers ( _de . read_bare :: < :: mtproto :: messages :: allStickers > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = AllStickers ; fn into_boxed ( self ) -> AllStickers { AllStickers :: allStickers ( self ) } } # [ derive ( Debug , Clone ) ] pub enum ArchivedStickers { archivedStickers ( archivedStickers ) , } 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 :: archivedStickers > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = ArchivedStickers ; fn into_boxed ( self ) -> ArchivedStickers { ArchivedStickers :: archivedStickers ( self ) } } # [ derive ( Debug , Clone ) ] pub enum BotCallbackAnswer { botCallbackAnswer ( botCallbackAnswer ) , } 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 :: botCallbackAnswer > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = BotCallbackAnswer ; fn into_boxed ( self ) -> BotCallbackAnswer { BotCallbackAnswer :: botCallbackAnswer ( self ) } } # [ derive ( Debug , Clone ) ] pub enum BotResults { botResults ( botResults ) , } 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 :: botResults > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = BotResults ; fn into_boxed ( self ) -> BotResults { BotResults :: botResults ( self ) } } # [ derive ( Debug , Clone ) ] pub enum ChatFull { chatFull ( chatFull ) , } 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 :: chatFull > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = ChatFull ; fn into_boxed ( self ) -> ChatFull { ChatFull :: chatFull ( self ) } } # [ derive ( Debug , Clone ) ] pub enum Chats { chats ( chats ) , chatsSlice ( chatsSlice ) , } impl :: BoxedSerialize for Chats { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Chats :: chats ( ref x ) => ( :: ConstructorNumber ( 0x64ff9fd5 ) , x ) , & Chats :: chatsSlice ( 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 > ( ) ? ) ) , :: ConstructorNumber ( 0x9cd81144 ) => Ok ( Chats :: chatsSlice ( _de . read_bare :: < :: mtproto :: messages :: chatsSlice > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = Chats ; fn into_boxed ( self ) -> Chats { Chats :: chats ( self ) } } # [ derive ( Debug , Clone ) ] pub struct chatsSlice { pub count : :: mtproto :: int , pub chats : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > , } impl :: BareSerialize for chatsSlice { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & chatsSlice { 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 chatsSlice { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( chatsSlice { count : _de . read_bare :: < :: mtproto :: int > ( ) ? , chats : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Chat > > ( ) ? , } ) } } impl :: IntoBoxed for chatsSlice { type Boxed = Chats ; fn into_boxed ( self ) -> Chats { Chats :: chatsSlice ( self ) } } # [ derive ( Debug , Clone ) ] pub enum DhConfig { dhConfigNotModified ( dhConfigNotModified ) , dhConfig ( dhConfig ) , } impl :: BoxedSerialize for DhConfig { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & DhConfig :: dhConfigNotModified ( 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 :: dhConfigNotModified ( _de . read_bare :: < :: mtproto :: messages :: dhConfigNotModified > ( ) ? ) ) , :: ConstructorNumber ( 0x2c221edd ) => Ok ( DhConfig :: dhConfig ( _de . read_bare :: < :: mtproto :: messages :: dhConfig > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct dhConfigNotModified { pub random : :: mtproto :: bytes , } impl :: BareSerialize for dhConfigNotModified { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & dhConfigNotModified { ref random } = self ; _ser . write_bare :: < :: mtproto :: bytes > ( random ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for dhConfigNotModified { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( dhConfigNotModified { random : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , } ) } } impl :: IntoBoxed for dhConfigNotModified { type Boxed = DhConfig ; fn into_boxed ( self ) -> DhConfig { DhConfig :: dhConfigNotModified ( self ) } } # [ derive ( Debug , Clone ) ] 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 = DhConfig ; fn into_boxed ( self ) -> DhConfig { DhConfig :: dhConfig ( self ) } } # [ derive ( Debug , Clone ) ] pub enum Dialogs { dialogs ( dialogs ) , dialogsSlice ( dialogsSlice ) , } impl :: BoxedSerialize for Dialogs { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Dialogs :: dialogs ( ref x ) => ( :: ConstructorNumber ( 0x15ba6c40 ) , x ) , & Dialogs :: dialogsSlice ( 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 > ( ) ? ) ) , :: ConstructorNumber ( 0x71e094f3 ) => Ok ( Dialogs :: dialogsSlice ( _de . read_bare :: < :: mtproto :: messages :: dialogsSlice > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = Dialogs ; fn into_boxed ( self ) -> Dialogs { Dialogs :: dialogs ( self ) } } # [ derive ( Debug , Clone ) ] pub struct dialogsSlice { 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 dialogsSlice { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & dialogsSlice { 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 dialogsSlice { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( dialogsSlice { 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 dialogsSlice { type Boxed = Dialogs ; fn into_boxed ( self ) -> Dialogs { Dialogs :: dialogsSlice ( self ) } } # [ derive ( Debug , Clone ) ] pub enum FavedStickers { favedStickersNotModified , favedStickers ( favedStickers ) , } impl :: BoxedSerialize for FavedStickers { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & FavedStickers :: favedStickersNotModified => ( :: 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 :: favedStickersNotModified ) , :: ConstructorNumber ( 0xf37f2f16 ) => Ok ( FavedStickers :: favedStickers ( _de . read_bare :: < :: mtproto :: messages :: favedStickers > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = FavedStickers ; fn into_boxed ( self ) -> FavedStickers { FavedStickers :: favedStickers ( self ) } } # [ derive ( Debug , Clone ) ] pub enum FeaturedStickers { featuredStickersNotModified , featuredStickers ( featuredStickers ) , } impl :: BoxedSerialize for FeaturedStickers { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & FeaturedStickers :: featuredStickersNotModified => ( :: 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 :: featuredStickersNotModified ) , :: ConstructorNumber ( 0xf89d88e5 ) => Ok ( FeaturedStickers :: featuredStickers ( _de . read_bare :: < :: mtproto :: messages :: featuredStickers > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = FeaturedStickers ; fn into_boxed ( self ) -> FeaturedStickers { FeaturedStickers :: featuredStickers ( self ) } } # [ derive ( Debug , Clone ) ] pub enum FoundGifs { foundGifs ( foundGifs ) , } 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 :: foundGifs > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = FoundGifs ; fn into_boxed ( self ) -> FoundGifs { FoundGifs :: foundGifs ( self ) } } # [ derive ( Debug , Clone ) ] pub enum HighScores { highScores ( highScores ) , } 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 :: highScores > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = HighScores ; fn into_boxed ( self ) -> HighScores { HighScores :: highScores ( self ) } } # [ derive ( Debug , Clone ) ] pub enum MessageEditData { messageEditData ( messageEditData ) , } 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 :: messageEditData > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = MessageEditData ; fn into_boxed ( self ) -> MessageEditData { MessageEditData :: messageEditData ( self ) } } # [ derive ( Debug , Clone ) ] pub enum Messages { messages ( messages ) , messagesSlice ( messagesSlice ) , channelMessages ( channelMessages ) , messagesNotModified ( messagesNotModified ) , } 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 > ( ) ? ) ) , :: ConstructorNumber ( 0x0b446ae3 ) => Ok ( Messages :: messagesSlice ( _de . read_bare :: < :: mtproto :: messages :: messagesSlice > ( ) ? ) ) , :: ConstructorNumber ( 0x99262e37 ) => Ok ( Messages :: channelMessages ( _de . read_bare :: < :: mtproto :: messages :: channelMessages > ( ) ? ) ) , :: ConstructorNumber ( 0x74535f21 ) => Ok ( Messages :: messagesNotModified ( _de . read_bare :: < :: mtproto :: messages :: messagesNotModified > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = Messages ; fn into_boxed ( self ) -> Messages { Messages :: messages ( self ) } } # [ derive ( Debug , Clone ) ] 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 = Messages ; fn into_boxed ( self ) -> Messages { Messages :: messagesSlice ( self ) } } # [ derive ( Debug , Clone ) ] 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 = Messages ; fn into_boxed ( self ) -> Messages { Messages :: channelMessages ( self ) } } # [ derive ( Debug , Clone ) ] 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 = Messages ; fn into_boxed ( self ) -> Messages { Messages :: messagesNotModified ( self ) } } # [ derive ( Debug , Clone ) ] pub enum PeerDialogs { peerDialogs ( peerDialogs ) , } 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 :: peerDialogs > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = PeerDialogs ; fn into_boxed ( self ) -> PeerDialogs { PeerDialogs :: peerDialogs ( self ) } } # [ derive ( Debug , Clone ) ] pub enum RecentStickers { recentStickersNotModified , recentStickers ( recentStickers ) , } impl :: BoxedSerialize for RecentStickers { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & RecentStickers :: recentStickersNotModified => ( :: 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 :: recentStickersNotModified ) , :: ConstructorNumber ( 0x5ce20970 ) => Ok ( RecentStickers :: recentStickers ( _de . read_bare :: < :: mtproto :: messages :: recentStickers > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = RecentStickers ; fn into_boxed ( self ) -> RecentStickers { RecentStickers :: recentStickers ( self ) } } # [ derive ( Debug , Clone ) ] pub enum SavedGifs { savedGifsNotModified , savedGifs ( savedGifs ) , } impl :: BoxedSerialize for SavedGifs { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & SavedGifs :: savedGifsNotModified => ( :: 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 :: savedGifsNotModified ) , :: ConstructorNumber ( 0x2e0709a5 ) => Ok ( SavedGifs :: savedGifs ( _de . read_bare :: < :: mtproto :: messages :: savedGifs > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = SavedGifs ; fn into_boxed ( self ) -> SavedGifs { SavedGifs :: savedGifs ( self ) } } # [ derive ( Debug , Clone ) ] pub enum SentEncryptedMessage { sentEncryptedMessage ( sentEncryptedMessage ) , sentEncryptedFile ( sentEncryptedFile ) , } impl :: BoxedSerialize for SentEncryptedMessage { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & SentEncryptedMessage :: sentEncryptedMessage ( ref x ) => ( :: ConstructorNumber ( 0x560f8935 ) , x ) , & SentEncryptedMessage :: sentEncryptedFile ( 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 :: sentEncryptedMessage ( _de . read_bare :: < :: mtproto :: messages :: sentEncryptedMessage > ( ) ? ) ) , :: ConstructorNumber ( 0x9493ff32 ) => Ok ( SentEncryptedMessage :: sentEncryptedFile ( _de . read_bare :: < :: mtproto :: messages :: sentEncryptedFile > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct sentEncryptedMessage { pub date : :: mtproto :: int , } impl :: BareSerialize for sentEncryptedMessage { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & sentEncryptedMessage { ref date } = self ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for sentEncryptedMessage { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( sentEncryptedMessage { date : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for sentEncryptedMessage { type Boxed = SentEncryptedMessage ; fn into_boxed ( self ) -> SentEncryptedMessage { SentEncryptedMessage :: sentEncryptedMessage ( self ) } } # [ derive ( Debug , Clone ) ] pub struct sentEncryptedFile { pub date : :: mtproto :: int , pub file : :: mtproto :: EncryptedFile , } impl :: BareSerialize for sentEncryptedFile { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & sentEncryptedFile { ref date , ref file } = self ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; _ser . write_boxed :: < :: mtproto :: EncryptedFile > ( file ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for sentEncryptedFile { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( sentEncryptedFile { date : _de . read_bare :: < :: mtproto :: int > ( ) ? , file : _de . read_boxed :: < :: mtproto :: EncryptedFile > ( ) ? , } ) } } impl :: IntoBoxed for sentEncryptedFile { type Boxed = SentEncryptedMessage ; fn into_boxed ( self ) -> SentEncryptedMessage { SentEncryptedMessage :: sentEncryptedFile ( self ) } } # [ derive ( Debug , Clone ) ] pub enum StickerSet { stickerSet ( stickerSet ) , } 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 :: stickerSet > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = StickerSet ; fn into_boxed ( self ) -> StickerSet { StickerSet :: stickerSet ( self ) } } # [ derive ( Debug , Clone ) ] pub enum StickerSetInstallResult { stickerSetInstallResultSuccess , stickerSetInstallResultArchive ( stickerSetInstallResultArchive ) , } impl :: BoxedSerialize for StickerSetInstallResult { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & StickerSetInstallResult :: stickerSetInstallResultSuccess => ( :: ConstructorNumber ( 0x38641628 ) , & ( ) ) , & StickerSetInstallResult :: stickerSetInstallResultArchive ( 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 :: stickerSetInstallResultSuccess ) , :: ConstructorNumber ( 0x35e410a8 ) => Ok ( StickerSetInstallResult :: stickerSetInstallResultArchive ( _de . read_bare :: < :: mtproto :: messages :: stickerSetInstallResultArchive > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct stickerSetInstallResultArchive { pub sets : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: StickerSetCovered > , } impl :: BareSerialize for stickerSetInstallResultArchive { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & stickerSetInstallResultArchive { ref sets } = self ; _ser . write_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: StickerSetCovered > > ( sets ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for stickerSetInstallResultArchive { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( stickerSetInstallResultArchive { sets : _de . read_boxed :: < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: StickerSetCovered > > ( ) ? , } ) } } impl :: IntoBoxed for stickerSetInstallResultArchive { type Boxed = StickerSetInstallResult ; fn into_boxed ( self ) -> StickerSetInstallResult { StickerSetInstallResult :: stickerSetInstallResultArchive ( self ) } } # [ derive ( Debug , Clone ) ] pub enum Stickers { stickersNotModified , stickers ( stickers ) , } impl :: BoxedSerialize for Stickers { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Stickers :: stickersNotModified => ( :: 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 :: stickersNotModified ) , :: ConstructorNumber ( 0x8a8ecd32 ) => Ok ( Stickers :: stickers ( _de . read_bare :: < :: mtproto :: messages :: stickers > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = Stickers ; fn into_boxed ( self ) -> Stickers { Stickers :: stickers ( self ) } } } pub mod payments { # [ derive ( Debug , Clone ) ] pub enum PaymentForm { paymentForm ( paymentForm ) , } 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 :: paymentForm > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = PaymentForm ; fn into_boxed ( self ) -> PaymentForm { PaymentForm :: paymentForm ( self ) } } # [ derive ( Debug , Clone ) ] pub enum PaymentReceipt { paymentReceipt ( paymentReceipt ) , } 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 :: paymentReceipt > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = PaymentReceipt ; fn into_boxed ( self ) -> PaymentReceipt { PaymentReceipt :: paymentReceipt ( self ) } } # [ derive ( Debug , Clone ) ] pub enum PaymentResult { paymentResult ( paymentResult ) , paymentVerficationNeeded ( paymentVerficationNeeded ) , } impl :: BoxedSerialize for PaymentResult { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & PaymentResult :: paymentResult ( ref x ) => ( :: ConstructorNumber ( 0x4e5f810d ) , x ) , & PaymentResult :: paymentVerficationNeeded ( 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 :: paymentResult ( _de . read_bare :: < :: mtproto :: payments :: paymentResult > ( ) ? ) ) , :: ConstructorNumber ( 0x6b56b921 ) => Ok ( PaymentResult :: paymentVerficationNeeded ( _de . read_bare :: < :: mtproto :: payments :: paymentVerficationNeeded > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct paymentResult { pub updates : :: mtproto :: Updates , } impl :: BareSerialize for paymentResult { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & paymentResult { ref updates } = self ; _ser . write_boxed :: < :: mtproto :: Updates > ( updates ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for paymentResult { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( paymentResult { updates : _de . read_boxed :: < :: mtproto :: Updates > ( ) ? , } ) } } impl :: IntoBoxed for paymentResult { type Boxed = PaymentResult ; fn into_boxed ( self ) -> PaymentResult { PaymentResult :: paymentResult ( self ) } } # [ derive ( Debug , Clone ) ] pub struct paymentVerficationNeeded { pub url : :: mtproto :: string , } impl :: BareSerialize for paymentVerficationNeeded { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & paymentVerficationNeeded { ref url } = self ; _ser . write_bare :: < :: mtproto :: string > ( url ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for paymentVerficationNeeded { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( paymentVerficationNeeded { url : _de . read_bare :: < :: mtproto :: string > ( ) ? , } ) } } impl :: IntoBoxed for paymentVerficationNeeded { type Boxed = PaymentResult ; fn into_boxed ( self ) -> PaymentResult { PaymentResult :: paymentVerficationNeeded ( self ) } } # [ derive ( Debug , Clone ) ] pub enum SavedInfo { savedInfo ( savedInfo ) , } 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 :: savedInfo > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = SavedInfo ; fn into_boxed ( self ) -> SavedInfo { SavedInfo :: savedInfo ( self ) } } # [ derive ( Debug , Clone ) ] pub enum ValidatedRequestedInfo { validatedRequestedInfo ( validatedRequestedInfo ) , } 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 :: validatedRequestedInfo > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = ValidatedRequestedInfo ; fn into_boxed ( self ) -> ValidatedRequestedInfo { ValidatedRequestedInfo :: validatedRequestedInfo ( self ) } } } pub mod phone { # [ derive ( Debug , Clone ) ] pub enum PhoneCall { phoneCall ( phoneCall ) , } 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 :: phoneCall > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = PhoneCall ; fn into_boxed ( self ) -> PhoneCall { PhoneCall :: phoneCall ( self ) } } } pub mod photos { # [ derive ( Debug , Clone ) ] pub enum Photo { photo ( photo ) , } 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 > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = Photo ; fn into_boxed ( self ) -> Photo { Photo :: photo ( self ) } } # [ derive ( Debug , Clone ) ] pub enum Photos { photos ( photos ) , photosSlice ( photosSlice ) , } impl :: BoxedSerialize for Photos { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Photos :: photos ( ref x ) => ( :: ConstructorNumber ( 0x8dca6aa5 ) , x ) , & Photos :: photosSlice ( 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 > ( ) ? ) ) , :: ConstructorNumber ( 0x15051f54 ) => Ok ( Photos :: photosSlice ( _de . read_bare :: < :: mtproto :: photos :: photosSlice > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = Photos ; fn into_boxed ( self ) -> Photos { Photos :: photos ( self ) } } # [ derive ( Debug , Clone ) ] pub struct photosSlice { pub count : :: mtproto :: int , pub photos : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: Photo > , pub users : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: User > , } impl :: BareSerialize for photosSlice { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & photosSlice { 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 photosSlice { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( photosSlice { 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 photosSlice { type Boxed = Photos ; fn into_boxed ( self ) -> Photos { Photos :: photosSlice ( self ) } } } pub mod storage { # [ derive ( Debug , Clone ) ] pub enum FileType { fileUnknown , filePartial , fileJpeg , fileGif , filePng , filePdf , fileMp3 , fileMov , fileMp4 , fileWebp , } impl :: BoxedSerialize for FileType { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & FileType :: fileUnknown => ( :: ConstructorNumber ( 0xaa963b05 ) , & ( ) ) , & FileType :: filePartial => ( :: ConstructorNumber ( 0x40bc6f52 ) , & ( ) ) , & FileType :: fileJpeg => ( :: ConstructorNumber ( 0x007efe0e ) , & ( ) ) , & FileType :: fileGif => ( :: ConstructorNumber ( 0xcae1aadf ) , & ( ) ) , & FileType :: filePng => ( :: ConstructorNumber ( 0x0a4f63c0 ) , & ( ) ) , & FileType :: filePdf => ( :: ConstructorNumber ( 0xae1e508d ) , & ( ) ) , & FileType :: fileMp3 => ( :: ConstructorNumber ( 0x528a0677 ) , & ( ) ) , & FileType :: fileMov => ( :: ConstructorNumber ( 0x4b09ebbc ) , & ( ) ) , & FileType :: fileMp4 => ( :: ConstructorNumber ( 0xb3cea0e4 ) , & ( ) ) , & FileType :: fileWebp => ( :: 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 :: fileUnknown ) , :: ConstructorNumber ( 0x40bc6f52 ) => Ok ( FileType :: filePartial ) , :: ConstructorNumber ( 0x007efe0e ) => Ok ( FileType :: fileJpeg ) , :: ConstructorNumber ( 0xcae1aadf ) => Ok ( FileType :: fileGif ) , :: ConstructorNumber ( 0x0a4f63c0 ) => Ok ( FileType :: filePng ) , :: ConstructorNumber ( 0xae1e508d ) => Ok ( FileType :: filePdf ) , :: ConstructorNumber ( 0x528a0677 ) => Ok ( FileType :: fileMp3 ) , :: ConstructorNumber ( 0x4b09ebbc ) => Ok ( FileType :: fileMov ) , :: ConstructorNumber ( 0xb3cea0e4 ) => Ok ( FileType :: fileMp4 ) , :: ConstructorNumber ( 0x1081464c ) => Ok ( FileType :: fileWebp ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } } pub mod updates { # [ derive ( Debug , Clone ) ] pub enum ChannelDifference { channelDifferenceEmpty ( channelDifferenceEmpty ) , channelDifferenceTooLong ( channelDifferenceTooLong ) , channelDifference ( channelDifference ) , } impl :: BoxedSerialize for ChannelDifference { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & ChannelDifference :: channelDifferenceEmpty ( ref x ) => ( :: ConstructorNumber ( 0x3e11affb ) , x ) , & ChannelDifference :: channelDifferenceTooLong ( 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 :: channelDifferenceEmpty ( _de . read_bare :: < :: mtproto :: updates :: channelDifferenceEmpty > ( ) ? ) ) , :: ConstructorNumber ( 0x6a9d7b35 ) => Ok ( ChannelDifference :: channelDifferenceTooLong ( _de . read_bare :: < :: mtproto :: updates :: channelDifferenceTooLong > ( ) ? ) ) , :: ConstructorNumber ( 0x2064674e ) => Ok ( ChannelDifference :: channelDifference ( _de . read_bare :: < :: mtproto :: updates :: channelDifference > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct channelDifferenceEmpty { pub final_ : bool , pub pts : :: mtproto :: int , pub timeout : Option < :: mtproto :: int > , } impl :: BareSerialize for channelDifferenceEmpty { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & channelDifferenceEmpty { 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 channelDifferenceEmpty { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( channelDifferenceEmpty { 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 channelDifferenceEmpty { type Boxed = ChannelDifference ; fn into_boxed ( self ) -> ChannelDifference { ChannelDifference :: channelDifferenceEmpty ( self ) } } # [ derive ( Debug , Clone ) ] pub struct channelDifferenceTooLong { 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 channelDifferenceTooLong { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & channelDifferenceTooLong { 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 channelDifferenceTooLong { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { let flags : i32 ; Ok ( channelDifferenceTooLong { 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 channelDifferenceTooLong { type Boxed = ChannelDifference ; fn into_boxed ( self ) -> ChannelDifference { ChannelDifference :: channelDifferenceTooLong ( self ) } } # [ derive ( Debug , Clone ) ] 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 = ChannelDifference ; fn into_boxed ( self ) -> ChannelDifference { ChannelDifference :: channelDifference ( self ) } } # [ derive ( Debug , Clone ) ] pub enum Difference { differenceEmpty ( differenceEmpty ) , difference ( difference ) , differenceSlice ( differenceSlice ) , differenceTooLong ( differenceTooLong ) , } impl :: BoxedSerialize for Difference { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & Difference :: differenceEmpty ( ref x ) => ( :: ConstructorNumber ( 0x5d75a138 ) , x ) , & Difference :: difference ( ref x ) => ( :: ConstructorNumber ( 0x00f49ca0 ) , x ) , & Difference :: differenceSlice ( ref x ) => ( :: ConstructorNumber ( 0xa8fb1981 ) , x ) , & Difference :: differenceTooLong ( 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 :: differenceEmpty ( _de . read_bare :: < :: mtproto :: updates :: differenceEmpty > ( ) ? ) ) , :: ConstructorNumber ( 0x00f49ca0 ) => Ok ( Difference :: difference ( _de . read_bare :: < :: mtproto :: updates :: difference > ( ) ? ) ) , :: ConstructorNumber ( 0xa8fb1981 ) => Ok ( Difference :: differenceSlice ( _de . read_bare :: < :: mtproto :: updates :: differenceSlice > ( ) ? ) ) , :: ConstructorNumber ( 0x4afe8f6d ) => Ok ( Difference :: differenceTooLong ( _de . read_bare :: < :: mtproto :: updates :: differenceTooLong > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct differenceEmpty { pub date : :: mtproto :: int , pub seq : :: mtproto :: int , } impl :: BareSerialize for differenceEmpty { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & differenceEmpty { ref date , ref seq } = self ; _ser . write_bare :: < :: mtproto :: int > ( date ) ? ; _ser . write_bare :: < :: mtproto :: int > ( seq ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for differenceEmpty { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( differenceEmpty { date : _de . read_bare :: < :: mtproto :: int > ( ) ? , seq : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for differenceEmpty { type Boxed = Difference ; fn into_boxed ( self ) -> Difference { Difference :: differenceEmpty ( self ) } } # [ derive ( Debug , Clone ) ] 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 = Difference ; fn into_boxed ( self ) -> Difference { Difference :: difference ( self ) } } # [ derive ( Debug , Clone ) ] pub struct differenceSlice { 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 differenceSlice { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & differenceSlice { 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 differenceSlice { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( differenceSlice { 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 differenceSlice { type Boxed = Difference ; fn into_boxed ( self ) -> Difference { Difference :: differenceSlice ( self ) } } # [ derive ( Debug , Clone ) ] pub struct differenceTooLong { pub pts : :: mtproto :: int , } impl :: BareSerialize for differenceTooLong { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & differenceTooLong { ref pts } = self ; _ser . write_bare :: < :: mtproto :: int > ( pts ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for differenceTooLong { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( differenceTooLong { pts : _de . read_bare :: < :: mtproto :: int > ( ) ? , } ) } } impl :: IntoBoxed for differenceTooLong { type Boxed = Difference ; fn into_boxed ( self ) -> Difference { Difference :: differenceTooLong ( self ) } } # [ derive ( Debug , Clone ) ] pub enum State { state ( state ) , } 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 > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = State ; fn into_boxed ( self ) -> State { State :: state ( self ) } } } pub mod upload { # [ derive ( Debug , Clone ) ] pub enum CdnFile { cdnFileReuploadNeeded ( cdnFileReuploadNeeded ) , cdnFile ( cdnFile ) , } impl :: BoxedSerialize for CdnFile { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & CdnFile :: cdnFileReuploadNeeded ( 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 :: cdnFileReuploadNeeded ( _de . read_bare :: < :: mtproto :: upload :: cdnFileReuploadNeeded > ( ) ? ) ) , :: ConstructorNumber ( 0xa99fca4f ) => Ok ( CdnFile :: cdnFile ( _de . read_bare :: < :: mtproto :: upload :: cdnFile > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] pub struct cdnFileReuploadNeeded { pub request_token : :: mtproto :: bytes , } impl :: BareSerialize for cdnFileReuploadNeeded { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & cdnFileReuploadNeeded { ref request_token } = self ; _ser . write_bare :: < :: mtproto :: bytes > ( request_token ) ? ; Ok ( ( ) ) } } impl :: BareDeserialize for cdnFileReuploadNeeded { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( cdnFileReuploadNeeded { request_token : _de . read_bare :: < :: mtproto :: bytes > ( ) ? , } ) } } impl :: IntoBoxed for cdnFileReuploadNeeded { type Boxed = CdnFile ; fn into_boxed ( self ) -> CdnFile { CdnFile :: cdnFileReuploadNeeded ( self ) } } # [ derive ( Debug , Clone ) ] 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 = CdnFile ; fn into_boxed ( self ) -> CdnFile { CdnFile :: cdnFile ( self ) } } # [ derive ( Debug , Clone ) ] pub enum File { file ( file ) , fileCdnRedirect ( fileCdnRedirect ) , } impl :: BoxedSerialize for File { fn serialize_boxed < 'this > ( & 'this self ) -> ( :: ConstructorNumber , & 'this :: BareSerialize ) { match self { & File :: file ( ref x ) => ( :: ConstructorNumber ( 0x096a18d5 ) , x ) , & File :: fileCdnRedirect ( 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 > ( ) ? ) ) , :: ConstructorNumber ( 0xea52fe5a ) => Ok ( File :: fileCdnRedirect ( _de . read_bare :: < :: mtproto :: upload :: fileCdnRedirect > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = File ; fn into_boxed ( self ) -> File { File :: file ( self ) } } # [ derive ( Debug , Clone ) ] pub struct fileCdnRedirect { 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 fileCdnRedirect { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & fileCdnRedirect { 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 fileCdnRedirect { fn deserialize_bare ( _de : & mut :: Deserializer ) -> :: Result < Self > { Ok ( fileCdnRedirect { 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 fileCdnRedirect { type Boxed = File ; fn into_boxed ( self ) -> File { File :: fileCdnRedirect ( self ) } } # [ derive ( Debug , Clone ) ] pub enum WebFile { webFile ( webFile ) , } 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 :: webFile > ( ) ? ) ) , id => Err ( :: error :: ErrorKind :: InvalidType ( Self :: possible_constructors ( ) , id ) . into ( ) ) , } } } # [ derive ( Debug , Clone ) ] 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 = WebFile ; fn into_boxed ( self ) -> WebFile { WebFile :: webFile ( self ) } } } pub mod rpc { # [ derive ( Debug , Clone ) ] pub struct destroy_auth_key ; impl :: Function for destroy_auth_key { type Reply = :: mtproto :: DestroyAuthKeyRes ; } impl :: BareSerialize for destroy_auth_key { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { Ok ( ( ) ) } } # [ derive ( Debug , Clone ) ] pub struct destroy_session { pub session_id : :: mtproto :: long , } impl :: Function for destroy_session { type Reply = :: mtproto :: DestroySessionRes ; } impl :: BareSerialize for destroy_session { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & destroy_session { ref session_id } = self ; _ser . write_bare :: < :: mtproto :: long > ( session_id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone ) ] pub struct get_future_salts { pub num : :: mtproto :: int , } impl :: Function for get_future_salts { type Reply = :: mtproto :: FutureSalts ; } impl :: BareSerialize for get_future_salts { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & get_future_salts { ref num } = self ; _ser . write_bare :: < :: mtproto :: int > ( num ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone ) ] 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 : :: Function > :: Function for initConnection < X > { type Reply = X :: Reply ; } impl < X : :: BoxedSerialize > :: 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 ) ] pub struct invokeAfterMsg < X > { pub msg_id : :: mtproto :: long , pub query : X , } impl < X : :: Function > :: Function for invokeAfterMsg < X > { type Reply = X :: Reply ; } impl < X : :: BoxedSerialize > :: 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 ) ] pub struct invokeAfterMsgs < X > { pub msg_ids : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > , pub query : X , } impl < X : :: Function > :: Function for invokeAfterMsgs < X > { type Reply = X :: Reply ; } impl < X : :: BoxedSerialize > :: 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 ) ] pub struct invokeWithLayer < X > { pub layer : :: mtproto :: int , pub query : X , } impl < X : :: Function > :: Function for invokeWithLayer < X > { type Reply = X :: Reply ; } impl < X : :: BoxedSerialize > :: 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 ) ] pub struct invokeWithoutUpdates < X > { pub query : X , } impl < X : :: Function > :: Function for invokeWithoutUpdates < X > { type Reply = X :: Reply ; } impl < X : :: BoxedSerialize > :: 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 ) ] pub struct ping { pub ping_id : :: mtproto :: long , } 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 ) ] pub struct ping_delay_disconnect { pub ping_id : :: mtproto :: long , pub disconnect_delay : :: mtproto :: int , } impl :: Function for ping_delay_disconnect { type Reply = :: mtproto :: Pong ; } impl :: BareSerialize for ping_delay_disconnect { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & ping_delay_disconnect { 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 ) ] pub struct req_DH_params { 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 :: Function for req_DH_params { type Reply = :: mtproto :: Server_DH_Params ; } impl :: BareSerialize for req_DH_params { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & req_DH_params { 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 ) ] pub struct req_pq { pub nonce : :: mtproto :: int128 , } impl :: Function for req_pq { type Reply = :: mtproto :: ResPQ ; } impl :: BareSerialize for req_pq { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & req_pq { ref nonce } = self ; _ser . write_bare :: < :: mtproto :: int128 > ( nonce ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone ) ] pub struct rpc_drop_answer { pub req_msg_id : :: mtproto :: long , } impl :: Function for rpc_drop_answer { type Reply = :: mtproto :: RpcDropAnswer ; } impl :: BareSerialize for rpc_drop_answer { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & rpc_drop_answer { ref req_msg_id } = self ; _ser . write_bare :: < :: mtproto :: long > ( req_msg_id ) ? ; Ok ( ( ) ) } } # [ derive ( Debug , Clone ) ] pub struct set_client_DH_params { pub nonce : :: mtproto :: int128 , pub server_nonce : :: mtproto :: int128 , pub encrypted_data : :: mtproto :: bytes , } impl :: Function for set_client_DH_params { type Reply = :: mtproto :: Set_client_DH_params_answer ; } impl :: BareSerialize for set_client_DH_params { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { let & set_client_DH_params { 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 ) ] pub struct changePhone { pub phone_number : :: mtproto :: string , pub phone_code_hash : :: mtproto :: string , pub phone_code : :: mtproto :: string , } 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 ) ] pub struct checkUsername { pub username : :: mtproto :: string , } 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 ) ] pub struct confirmPhone { pub phone_code_hash : :: mtproto :: string , pub phone_code : :: mtproto :: string , } 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 ) ] pub struct deleteAccount { pub reason : :: mtproto :: string , } 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 ) ] pub struct getAccountTTL ; impl :: Function for getAccountTTL { type Reply = :: mtproto :: AccountDaysTTL ; } impl :: BareSerialize for getAccountTTL { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { Ok ( ( ) ) } } # [ derive ( Debug , Clone ) ] pub struct getAuthorizations ; 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 ) ] pub struct getNotifySettings { pub peer : :: mtproto :: InputNotifyPeer , } 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 ) ] pub struct getPassword ; 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 ) ] pub struct getPasswordSettings { pub current_password_hash : :: mtproto :: bytes , } 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 ) ] pub struct getPrivacy { pub key : :: mtproto :: InputPrivacyKey , } 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 ) ] pub struct getTmpPassword { pub password_hash : :: mtproto :: bytes , pub period : :: mtproto :: int , } 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 ) ] pub struct getWallPapers ; 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 ) ] pub struct registerDevice { pub token_type : :: mtproto :: int , pub token : :: mtproto :: string , } 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 ) ] pub struct reportPeer { pub peer : :: mtproto :: InputPeer , pub reason : :: mtproto :: ReportReason , } 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 ) ] pub struct resetAuthorization { pub hash : :: mtproto :: long , } 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 ) ] pub struct resetNotifySettings ; impl :: Function for resetNotifySettings { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for resetNotifySettings { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { Ok ( ( ) ) } } # [ derive ( Debug , Clone ) ] pub struct sendChangePhoneCode { pub allow_flashcall : bool , pub phone_number : :: mtproto :: string , pub current_number : Option < :: mtproto :: Bool > , } 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 ) ] pub struct sendConfirmPhoneCode { pub allow_flashcall : bool , pub hash : :: mtproto :: string , pub current_number : Option < :: mtproto :: Bool > , } 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 ) ] pub struct setAccountTTL { pub ttl : :: mtproto :: AccountDaysTTL , } 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 ) ] pub struct setPrivacy { pub key : :: mtproto :: InputPrivacyKey , pub rules : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputPrivacyRule > , } 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 ) ] pub struct unregisterDevice { pub token_type : :: mtproto :: int , pub token : :: mtproto :: string , } 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 ) ] pub struct updateDeviceLocked { pub period : :: mtproto :: int , } 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 ) ] pub struct updateNotifySettings { pub peer : :: mtproto :: InputNotifyPeer , pub settings : :: mtproto :: InputPeerNotifySettings , } 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 ) ] pub struct updatePasswordSettings { pub current_password_hash : :: mtproto :: bytes , pub new_settings : :: mtproto :: account :: PasswordInputSettings , } 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 ) ] pub struct updateProfile { pub first_name : Option < :: mtproto :: string > , pub last_name : Option < :: mtproto :: string > , pub about : Option < :: mtproto :: string > , } 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 ) ] pub struct updateStatus { pub offline : :: mtproto :: Bool , } 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 ) ] pub struct updateUsername { pub username : :: mtproto :: string , } 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 ) ] 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 :: 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 ) ] pub struct cancelCode { pub phone_number : :: mtproto :: string , pub phone_code_hash : :: mtproto :: string , } 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 ) ] pub struct checkPassword { pub password_hash : :: mtproto :: bytes , } 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 ) ] pub struct checkPhone { pub phone_number : :: mtproto :: string , } 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 ) ] pub struct dropTempAuthKeys { pub except_auth_keys : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > , } 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 ) ] pub struct exportAuthorization { pub dc_id : :: mtproto :: int , } 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 ) ] pub struct importAuthorization { pub id : :: mtproto :: int , pub bytes : :: mtproto :: bytes , } 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 ) ] pub struct importBotAuthorization { pub flags : :: mtproto :: int , pub api_id : :: mtproto :: int , pub api_hash : :: mtproto :: string , pub bot_auth_token : :: mtproto :: string , } 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 ) ] pub struct logOut ; impl :: Function for logOut { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for logOut { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { Ok ( ( ) ) } } # [ derive ( Debug , Clone ) ] pub struct recoverPassword { pub code : :: mtproto :: string , } 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 ) ] pub struct requestPasswordRecovery ; 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 ) ] pub struct resendCode { pub phone_number : :: mtproto :: string , pub phone_code_hash : :: mtproto :: string , } 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 ) ] pub struct resetAuthorizations ; impl :: Function for resetAuthorizations { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for resetAuthorizations { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { Ok ( ( ) ) } } # [ derive ( Debug , Clone ) ] 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 :: 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 ) ] pub struct sendInvites { pub phone_numbers : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: string > , pub message : :: mtproto :: string , } 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 ) ] pub struct signIn { pub phone_number : :: mtproto :: string , pub phone_code_hash : :: mtproto :: string , pub phone_code : :: mtproto :: string , } 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 ) ] 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 :: 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 ) ] pub struct answerWebhookJSONQuery { pub query_id : :: mtproto :: long , pub data : :: mtproto :: DataJSON , } 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 ) ] pub struct sendCustomRequest { pub custom_method : :: mtproto :: string , pub params : :: mtproto :: DataJSON , } 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 ) ] pub struct checkUsername { pub channel : :: mtproto :: InputChannel , pub username : :: mtproto :: string , } 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 ) ] pub struct createChannel { pub broadcast : bool , pub megagroup : bool , pub title : :: mtproto :: string , pub about : :: mtproto :: string , } 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 ) ] pub struct deleteChannel { pub channel : :: mtproto :: InputChannel , } 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 ) ] pub struct deleteHistory { pub channel : :: mtproto :: InputChannel , pub max_id : :: mtproto :: int , } 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 ) ] pub struct deleteMessages { pub channel : :: mtproto :: InputChannel , pub id : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > , } 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 ) ] pub struct deleteUserHistory { pub channel : :: mtproto :: InputChannel , pub user_id : :: mtproto :: InputUser , } 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 ) ] pub struct editAbout { pub channel : :: mtproto :: InputChannel , pub about : :: mtproto :: string , } 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 ) ] pub struct editAdmin { pub channel : :: mtproto :: InputChannel , pub user_id : :: mtproto :: InputUser , pub admin_rights : :: mtproto :: ChannelAdminRights , } 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 ) ] pub struct editBanned { pub channel : :: mtproto :: InputChannel , pub user_id : :: mtproto :: InputUser , pub banned_rights : :: mtproto :: ChannelBannedRights , } 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 ) ] pub struct editPhoto { pub channel : :: mtproto :: InputChannel , pub photo : :: mtproto :: InputChatPhoto , } 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 ) ] pub struct editTitle { pub channel : :: mtproto :: InputChannel , pub title : :: mtproto :: string , } 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 ) ] pub struct exportInvite { pub channel : :: mtproto :: InputChannel , } 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 ) ] pub struct exportMessageLink { pub channel : :: mtproto :: InputChannel , pub id : :: mtproto :: int , } 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 ) ] 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 :: 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 ) ] pub struct getAdminedPublicChannels ; 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 ) ] pub struct getChannels { pub id : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputChannel > , } 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 ) ] pub struct getFullChannel { pub channel : :: mtproto :: InputChannel , } 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 ) ] pub struct getMessages { pub channel : :: mtproto :: InputChannel , pub id : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > , } 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 ) ] pub struct getParticipant { pub channel : :: mtproto :: InputChannel , pub user_id : :: mtproto :: InputUser , } 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 ) ] pub struct getParticipants { pub channel : :: mtproto :: InputChannel , pub filter : :: mtproto :: ChannelParticipantsFilter , pub offset : :: mtproto :: int , pub limit : :: mtproto :: int , pub hash : :: mtproto :: int , } 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 ) ] pub struct inviteToChannel { pub channel : :: mtproto :: InputChannel , pub users : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputUser > , } 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 ) ] pub struct joinChannel { pub channel : :: mtproto :: InputChannel , } 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 ) ] pub struct leaveChannel { pub channel : :: mtproto :: InputChannel , } 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 ) ] pub struct readHistory { pub channel : :: mtproto :: InputChannel , pub max_id : :: mtproto :: int , } 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 ) ] pub struct readMessageContents { pub channel : :: mtproto :: InputChannel , pub id : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > , } 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 ) ] pub struct reportSpam { pub channel : :: mtproto :: InputChannel , pub user_id : :: mtproto :: InputUser , pub id : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > , } 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 ) ] pub struct setStickers { pub channel : :: mtproto :: InputChannel , pub stickerset : :: mtproto :: InputStickerSet , } 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 ) ] pub struct toggleInvites { pub channel : :: mtproto :: InputChannel , pub enabled : :: mtproto :: Bool , } 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 ) ] pub struct togglePreHistoryHidden { pub channel : :: mtproto :: InputChannel , pub enabled : :: mtproto :: Bool , } 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 ) ] pub struct toggleSignatures { pub channel : :: mtproto :: InputChannel , pub enabled : :: mtproto :: Bool , } 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 ) ] pub struct updatePinnedMessage { pub silent : bool , pub channel : :: mtproto :: InputChannel , pub id : :: mtproto :: int , } 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 ) ] pub struct updateUsername { pub channel : :: mtproto :: InputChannel , pub username : :: mtproto :: string , } 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 ) ] pub struct block { pub id : :: mtproto :: InputUser , } 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 ) ] pub struct deleteContact { pub id : :: mtproto :: InputUser , } 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 ) ] pub struct deleteContacts { pub id : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputUser > , } 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 ) ] pub struct exportCard ; 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 ) ] pub struct getBlocked { pub offset : :: mtproto :: int , pub limit : :: mtproto :: int , } 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 ) ] pub struct getContacts { pub hash : :: mtproto :: int , } 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 ) ] pub struct getStatuses ; 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 ) ] 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 :: 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 ) ] pub struct importCard { pub export_card : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > , } 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 ) ] pub struct importContacts { pub contacts : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputContact > , } 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 ) ] pub struct resetSaved ; impl :: Function for resetSaved { type Reply = :: mtproto :: Bool ; } impl :: BareSerialize for resetSaved { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { Ok ( ( ) ) } } # [ derive ( Debug , Clone ) ] pub struct resetTopPeerRating { pub category : :: mtproto :: TopPeerCategory , pub peer : :: mtproto :: InputPeer , } 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 ) ] pub struct resolveUsername { pub username : :: mtproto :: string , } 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 ) ] pub struct search { pub q : :: mtproto :: string , pub limit : :: mtproto :: int , } 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 ) ] pub struct unblock { pub id : :: mtproto :: InputUser , } 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 ) ] 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 :: 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 ) ] pub struct getAppChangelog { pub prev_app_version : :: mtproto :: string , } 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 ) ] pub struct getAppUpdate ; 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 ) ] pub struct getCdnConfig ; impl :: Function for getCdnConfig { type Reply = :: mtproto :: CdnConfig ; } impl :: BareSerialize for getCdnConfig { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { Ok ( ( ) ) } } # [ derive ( Debug , Clone ) ] pub struct getConfig ; impl :: Function for getConfig { type Reply = :: mtproto :: Config ; } impl :: BareSerialize for getConfig { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { Ok ( ( ) ) } } # [ derive ( Debug , Clone ) ] pub struct getInviteText ; 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 ) ] pub struct getNearestDc ; impl :: Function for getNearestDc { type Reply = :: mtproto :: NearestDc ; } impl :: BareSerialize for getNearestDc { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { Ok ( ( ) ) } } # [ derive ( Debug , Clone ) ] pub struct getRecentMeUrls { pub referer : :: mtproto :: string , } 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 ) ] pub struct getSupport ; 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 ) ] pub struct getTermsOfService ; 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 ) ] pub struct saveAppLog { pub events : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputAppEvent > , } 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 ) ] pub struct setBotUpdatesStatus { pub pending_updates_count : :: mtproto :: int , pub message : :: mtproto :: string , } 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 ) ] pub struct getDifference { pub from_version : :: mtproto :: int , } 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 ) ] pub struct getLangPack { pub lang_code : :: mtproto :: string , } 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 ) ] pub struct getLanguages ; 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 ) ] pub struct getStrings { pub lang_code : :: mtproto :: string , pub keys : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: string > , } 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 ) ] pub struct acceptEncryption { pub peer : :: mtproto :: InputEncryptedChat , pub g_b : :: mtproto :: bytes , pub key_fingerprint : :: mtproto :: long , } 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 ) ] pub struct addChatUser { pub chat_id : :: mtproto :: int , pub user_id : :: mtproto :: InputUser , pub fwd_limit : :: mtproto :: int , } 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 ) ] pub struct checkChatInvite { pub hash : :: mtproto :: string , } 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 ) ] pub struct clearRecentStickers { pub attached : bool , } 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 ) ] pub struct createChat { pub users : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputUser > , pub title : :: mtproto :: string , } 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 ) ] pub struct deleteChatUser { pub chat_id : :: mtproto :: int , pub user_id : :: mtproto :: InputUser , } 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 ) ] pub struct deleteHistory { pub just_clear : bool , pub peer : :: mtproto :: InputPeer , pub max_id : :: mtproto :: int , } 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 ) ] pub struct deleteMessages { pub revoke : bool , pub id : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > , } 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 ) ] pub struct discardEncryption { pub chat_id : :: mtproto :: int , } 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 ) ] pub struct editChatAdmin { pub chat_id : :: mtproto :: int , pub user_id : :: mtproto :: InputUser , pub is_admin : :: mtproto :: Bool , } 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 ) ] pub struct editChatPhoto { pub chat_id : :: mtproto :: int , pub photo : :: mtproto :: InputChatPhoto , } 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 ) ] pub struct editChatTitle { pub chat_id : :: mtproto :: int , pub title : :: mtproto :: string , } 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 ) ] 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 :: 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 ) ] 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 :: 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 ) ] pub struct exportChatInvite { pub chat_id : :: mtproto :: int , } 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 ) ] pub struct faveSticker { pub id : :: mtproto :: InputDocument , pub unfave : :: mtproto :: Bool , } 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 ) ] pub struct forwardMessage { pub peer : :: mtproto :: InputPeer , pub id : :: mtproto :: int , pub random_id : :: mtproto :: long , } 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 ) ] 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 :: 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 ) ] pub struct getAllChats { pub except_ids : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > , } 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 ) ] pub struct getAllDrafts ; impl :: Function for getAllDrafts { type Reply = :: mtproto :: Updates ; } impl :: BareSerialize for getAllDrafts { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { Ok ( ( ) ) } } # [ derive ( Debug , Clone ) ] pub struct getAllStickers { pub hash : :: mtproto :: int , } 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 ) ] pub struct getArchivedStickers { pub masks : bool , pub offset_id : :: mtproto :: long , pub limit : :: mtproto :: int , } 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 ) ] pub struct getAttachedStickers { pub media : :: mtproto :: InputStickeredMedia , } 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 ) ] pub struct getBotCallbackAnswer { pub game : bool , pub peer : :: mtproto :: InputPeer , pub msg_id : :: mtproto :: int , pub data : Option < :: mtproto :: bytes > , } 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 ) ] pub struct getChats { pub id : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > , } 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 ) ] pub struct getCommonChats { pub user_id : :: mtproto :: InputUser , pub max_id : :: mtproto :: int , pub limit : :: mtproto :: int , } 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 ) ] pub struct getDhConfig { pub version : :: mtproto :: int , pub random_length : :: mtproto :: int , } 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 ) ] 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 :: 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 ) ] pub struct getDocumentByHash { pub sha256 : :: mtproto :: bytes , pub size : :: mtproto :: int , pub mime_type : :: mtproto :: string , } 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 ) ] pub struct getFavedStickers { pub hash : :: mtproto :: int , } 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 ) ] pub struct getFeaturedStickers { pub hash : :: mtproto :: int , } 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 ) ] pub struct getFullChat { pub chat_id : :: mtproto :: int , } 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 ) ] pub struct getGameHighScores { pub peer : :: mtproto :: InputPeer , pub id : :: mtproto :: int , pub user_id : :: mtproto :: InputUser , } 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 ) ] 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 :: 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 ) ] 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 :: 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 ) ] pub struct getInlineGameHighScores { pub id : :: mtproto :: InputBotInlineMessageID , pub user_id : :: mtproto :: InputUser , } 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 ) ] pub struct getMaskStickers { pub hash : :: mtproto :: int , } 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 ) ] pub struct getMessageEditData { pub peer : :: mtproto :: InputPeer , pub id : :: mtproto :: int , } 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 ) ] pub struct getMessages { pub id : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > , } 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 ) ] pub struct getMessagesViews { pub peer : :: mtproto :: InputPeer , pub id : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > , pub increment : :: mtproto :: Bool , } 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 ) ] pub struct getPeerDialogs { pub peers : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputPeer > , } 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 ) ] pub struct getPeerSettings { pub peer : :: mtproto :: InputPeer , } 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 ) ] pub struct getPinnedDialogs ; 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 ) ] pub struct getRecentLocations { pub peer : :: mtproto :: InputPeer , pub limit : :: mtproto :: int , } 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 ) ] pub struct getRecentStickers { pub attached : bool , pub hash : :: mtproto :: int , } 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 ) ] pub struct getSavedGifs { pub hash : :: mtproto :: int , } 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 ) ] pub struct getStickerSet { pub stickerset : :: mtproto :: InputStickerSet , } 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 ) ] 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 :: 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 ) ] pub struct getWebPage { pub url : :: mtproto :: string , pub hash : :: mtproto :: int , } 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 ) ] pub struct getWebPagePreview { pub message : :: mtproto :: string , } 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 ) ] pub struct hideReportSpam { pub peer : :: mtproto :: InputPeer , } 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 ) ] pub struct importChatInvite { pub hash : :: mtproto :: string , } 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 ) ] pub struct installStickerSet { pub stickerset : :: mtproto :: InputStickerSet , pub archived : :: mtproto :: Bool , } 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 ) ] pub struct migrateChat { pub chat_id : :: mtproto :: int , } 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 ) ] pub struct readEncryptedHistory { pub peer : :: mtproto :: InputEncryptedChat , pub max_date : :: mtproto :: int , } 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 ) ] pub struct readFeaturedStickers { pub id : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > , } 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 ) ] pub struct readHistory { pub peer : :: mtproto :: InputPeer , pub max_id : :: mtproto :: int , } 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 ) ] pub struct readMentions { pub peer : :: mtproto :: InputPeer , } 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 ) ] pub struct readMessageContents { pub id : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: int > , } 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 ) ] pub struct receivedMessages { pub max_id : :: mtproto :: int , } 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 ) ] pub struct receivedQueue { pub max_qts : :: mtproto :: int , } 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 ) ] pub struct reorderPinnedDialogs { pub force : bool , pub order : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputPeer > , } 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 ) ] pub struct reorderStickerSets { pub masks : bool , pub order : :: mtproto :: Vector < :: mtproto :: Bare , :: mtproto :: long > , } 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 ) ] pub struct reportEncryptedSpam { pub peer : :: mtproto :: InputEncryptedChat , } 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 ) ] pub struct reportSpam { pub peer : :: mtproto :: InputPeer , } 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 ) ] pub struct requestEncryption { pub user_id : :: mtproto :: InputUser , pub random_id : :: mtproto :: int , pub g_a : :: mtproto :: bytes , } 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 ) ] 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 :: 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 ) ] pub struct saveGif { pub id : :: mtproto :: InputDocument , pub unsave : :: mtproto :: Bool , } 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 ) ] pub struct saveRecentSticker { pub attached : bool , pub id : :: mtproto :: InputDocument , pub unsave : :: mtproto :: Bool , } 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 ) ] 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 :: 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 ) ] pub struct searchGifs { pub q : :: mtproto :: string , pub offset : :: mtproto :: int , } 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 ) ] 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 :: 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 ) ] pub struct sendEncrypted { pub peer : :: mtproto :: InputEncryptedChat , pub random_id : :: mtproto :: long , pub data : :: mtproto :: bytes , } 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 ) ] pub struct sendEncryptedFile { pub peer : :: mtproto :: InputEncryptedChat , pub random_id : :: mtproto :: long , pub data : :: mtproto :: bytes , pub file : :: mtproto :: InputEncryptedFile , } 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 ) ] pub struct sendEncryptedService { pub peer : :: mtproto :: InputEncryptedChat , pub random_id : :: mtproto :: long , pub data : :: mtproto :: bytes , } 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 ) ] 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 :: 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 ) ] 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 :: 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 ) ] 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 :: 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 ) ] 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 :: 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 ) ] pub struct sendScreenshotNotification { pub peer : :: mtproto :: InputPeer , pub reply_to_msg_id : :: mtproto :: int , pub random_id : :: mtproto :: long , } 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 ) ] 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 :: 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 ) ] pub struct setBotPrecheckoutResults { pub success : bool , pub query_id : :: mtproto :: long , pub error : Option < :: mtproto :: string > , } 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 ) ] pub struct setBotShippingResults { pub query_id : :: mtproto :: long , pub error : Option < :: mtproto :: string > , pub shipping_options : Option < :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: ShippingOption > > , } 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 ) ] pub struct setEncryptedTyping { pub peer : :: mtproto :: InputEncryptedChat , pub typing : :: mtproto :: Bool , } 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 ) ] 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 :: 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 ) ] 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 :: 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 ) ] pub struct setInlineGameScore { pub edit_message : bool , pub force : bool , pub id : :: mtproto :: InputBotInlineMessageID , pub user_id : :: mtproto :: InputUser , pub score : :: mtproto :: int , } 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 ) ] pub struct setTyping { pub peer : :: mtproto :: InputPeer , pub action : :: mtproto :: SendMessageAction , } 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 ) ] pub struct startBot { pub bot : :: mtproto :: InputUser , pub peer : :: mtproto :: InputPeer , pub random_id : :: mtproto :: long , pub start_param : :: mtproto :: string , } 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 ) ] pub struct toggleChatAdmins { pub chat_id : :: mtproto :: int , pub enabled : :: mtproto :: Bool , } 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 ) ] pub struct toggleDialogPin { pub pinned : bool , pub peer : :: mtproto :: InputPeer , } 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 ) ] pub struct uninstallStickerSet { pub stickerset : :: mtproto :: InputStickerSet , } 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 ) ] pub struct uploadEncryptedFile { pub peer : :: mtproto :: InputEncryptedChat , pub file : :: mtproto :: InputEncryptedFile , } 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 ) ] pub struct uploadMedia { pub peer : :: mtproto :: InputPeer , pub media : :: mtproto :: InputMedia , } 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 ) ] pub struct clearSavedInfo { pub credentials : bool , pub info : bool , } 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 ) ] pub struct getPaymentForm { pub msg_id : :: mtproto :: int , } 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 ) ] pub struct getPaymentReceipt { pub msg_id : :: mtproto :: int , } 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 ) ] pub struct getSavedInfo ; 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 ) ] 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 :: 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 ) ] pub struct validateRequestedInfo { pub save : bool , pub msg_id : :: mtproto :: int , pub info : :: mtproto :: PaymentRequestedInfo , } 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 ) ] pub struct acceptCall { pub peer : :: mtproto :: InputPhoneCall , pub g_b : :: mtproto :: bytes , pub protocol : :: mtproto :: PhoneCallProtocol , } 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 ) ] pub struct confirmCall { pub peer : :: mtproto :: InputPhoneCall , pub g_a : :: mtproto :: bytes , pub key_fingerprint : :: mtproto :: long , pub protocol : :: mtproto :: PhoneCallProtocol , } 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 ) ] pub struct discardCall { pub peer : :: mtproto :: InputPhoneCall , pub duration : :: mtproto :: int , pub reason : :: mtproto :: PhoneCallDiscardReason , pub connection_id : :: mtproto :: long , } 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 ) ] pub struct getCallConfig ; impl :: Function for getCallConfig { type Reply = :: mtproto :: DataJSON ; } impl :: BareSerialize for getCallConfig { fn serialize_bare ( & self , _ser : & mut :: Serializer ) -> :: Result < ( ) > { Ok ( ( ) ) } } # [ derive ( Debug , Clone ) ] pub struct receivedCall { pub peer : :: mtproto :: InputPhoneCall , } 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 ) ] pub struct requestCall { pub user_id : :: mtproto :: InputUser , pub random_id : :: mtproto :: int , pub g_a_hash : :: mtproto :: bytes , pub protocol : :: mtproto :: PhoneCallProtocol , } 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 ) ] pub struct saveCallDebug { pub peer : :: mtproto :: InputPhoneCall , pub debug : :: mtproto :: DataJSON , } 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 ) ] pub struct setCallRating { pub peer : :: mtproto :: InputPhoneCall , pub rating : :: mtproto :: int , pub comment : :: mtproto :: string , } 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 ) ] pub struct deletePhotos { pub id : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputPhoto > , } 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 ) ] pub struct getUserPhotos { pub user_id : :: mtproto :: InputUser , pub offset : :: mtproto :: int , pub max_id : :: mtproto :: long , pub limit : :: mtproto :: int , } 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 ) ] pub struct updateProfilePhoto { pub id : :: mtproto :: InputPhoto , } 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 ) ] pub struct uploadProfilePhoto { pub file : :: mtproto :: InputFile , } 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 ) ] pub struct addStickerToSet { pub stickerset : :: mtproto :: InputStickerSet , pub sticker : :: mtproto :: InputStickerSetItem , } 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 ) ] pub struct changeStickerPosition { pub sticker : :: mtproto :: InputDocument , pub position : :: mtproto :: int , } 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 ) ] 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 :: 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 ) ] pub struct removeStickerFromSet { pub sticker : :: mtproto :: InputDocument , } 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 ) ] pub struct getChannelDifference { pub force : bool , pub channel : :: mtproto :: InputChannel , pub filter : :: mtproto :: ChannelMessagesFilter , pub pts : :: mtproto :: int , pub limit : :: mtproto :: int , } 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 ) ] pub struct getDifference { pub pts : :: mtproto :: int , pub pts_total_limit : Option < :: mtproto :: int > , pub date : :: mtproto :: int , pub qts : :: mtproto :: int , } 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 ) ] pub struct getState ; 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 ) ] pub struct getCdnFile { pub file_token : :: mtproto :: bytes , pub offset : :: mtproto :: int , pub limit : :: mtproto :: int , } 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 ) ] pub struct getCdnFileHashes { pub file_token : :: mtproto :: bytes , pub offset : :: mtproto :: int , } 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 ) ] pub struct getFile { pub location : :: mtproto :: InputFileLocation , pub offset : :: mtproto :: int , pub limit : :: mtproto :: int , } 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 ) ] pub struct getWebFile { pub location : :: mtproto :: InputWebFileLocation , pub offset : :: mtproto :: int , pub limit : :: mtproto :: int , } 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 ) ] pub struct reuploadCdnFile { pub file_token : :: mtproto :: bytes , pub request_token : :: mtproto :: bytes , } 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 ) ] pub struct saveBigFilePart { pub file_id : :: mtproto :: long , pub file_part : :: mtproto :: int , pub file_total_parts : :: mtproto :: int , pub bytes : :: mtproto :: bytes , } 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 ) ] pub struct saveFilePart { pub file_id : :: mtproto :: long , pub file_part : :: mtproto :: int , pub bytes : :: mtproto :: bytes , } 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 ) ] pub struct getFullUser { pub id : :: mtproto :: InputUser , } 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 ) ] pub struct getUsers { pub id : :: mtproto :: Vector < :: mtproto :: Boxed , :: mtproto :: InputUser > , } 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 ( ( ) ) } } } }