pub fn patch(self, ch: &mut Channel) {
        match ch {
            Channel::SavedMessages(SavedMessagesChannel { id: _, user, nonce }) => {
                if let Some(puser) = self.user {
                    *user = puser;
                }
                if let Some(pnonce) = self.nonce {
                    *nonce = Some(pnonce);
                }
            }
            Channel::DirectMessage(DirectMessageChannel {
                id: _,
                recipients,
                last_message_id,
                nonce,
                active,
            }) => {
                if let Some(precipients) = self.recipients {
                    *recipients = precipients;
                }
                if let Some(plast_message_id) = self.last_message_id {
                    *last_message_id = Some(plast_message_id);
                }
                if let Some(pnonce) = self.nonce {
                    *nonce = Some(pnonce);
                }

                if let Some(pactive) = self.active {
                    *active = pactive;
                }
            }
            Channel::Group(GroupChannel {
                id: _,
                recipients,
                name,
                owner,
                description,
                last_message_id,
                icon,
                permissions,
                nsfw,
                nonce,
            }) => {
                if let Some(precipients) = self.recipients {
                    *recipients = precipients;
                }
                if let Some(pname) = self.name {
                    *name = pname;
                }
                if let Some(powner) = self.owner {
                    *owner = powner;
                }
                if let Some(pdescription) = self.description {
                    *description = Some(pdescription);
                }
                if let Some(plast_message_id) = self.last_message_id {
                    *last_message_id = Some(plast_message_id);
                }
                if let Some(picon) = self.icon {
                    *icon = Some(picon);
                }
                if let Some(ppermissions) = self.permissions {
                    *permissions = Some(ppermissions);
                }
                if let Some(pnsfw) = self.nsfw {
                    *nsfw = Some(pnsfw);
                }
                if let Some(pnonce) = self.nonce {
                    *nonce = Some(pnonce);
                }
            }
            Channel::TextChannel(TextChannel {
                server_channel:
                    ServerChannel {
                        id: _,
                        server,
                        name,
                        description,
                        icon,
                        default_permissions,
                        role_permissions,
                        nsfw,
                    },
                last_message_id: _,
                nonce,
            }) => {
                if let Some(pserver) = self.server {
                    *server = pserver;
                }
                if let Some(pname) = self.name {
                    *name = pname;
                }
                if let Some(pdescription) = self.description {
                    *description = Some(pdescription);
                }
                if let Some(picon) = self.icon {
                    *icon = Some(picon);
                }
                if let Some(pdefault_permissions) = self.default_permissions {
                    *default_permissions = Some(pdefault_permissions);
                }
                if let Some(prole_permissions) = self.role_permissions {
                    *role_permissions = prole_permissions;
                }
                if let Some(pnsfw) = self.nsfw {
                    *nsfw = Some(pnsfw);
                }
                // if let Some(plast_message_id) = self.last_message_id {
                //     *last_message_id = Some(plast_message_id);
                // }
                if let Some(pnonce) = self.nonce {
                    *nonce = Some(pnonce);
                }
            }
            Channel::VoiceChannel(VoiceChannel {
                server_channel:
                    ServerChannel {
                        id: _,
                        server,
                        name,
                        description,
                        icon,
                        default_permissions,
                        role_permissions,
                        nsfw,
                    },
                nonce,
            }) => {
                if let Some(pserver) = self.server {
                    *server = pserver;
                }
                if let Some(pname) = self.name {
                    *name = pname;
                }
                if let Some(pdescription) = self.description {
                    *description = Some(pdescription);
                }
                if let Some(picon) = self.icon {
                    *icon = Some(picon);
                }
                if let Some(pdefault_permissions) = self.default_permissions {
                    *default_permissions = Some(pdefault_permissions);
                }
                if let Some(prole_permissions) = self.role_permissions {
                    *role_permissions = prole_permissions;
                }
                if let Some(pnsfw) = self.nsfw {
                    *nsfw = Some(pnsfw);
                }
                if let Some(pnonce) = self.nonce {
                    *nonce = Some(pnonce);
                }
            }
        }
    }
/// Treats self as a patch and applies it to channel.
Treats self as a patch and applies it to channel.
Treats self as a patch and applies it to channel .
pub fn patch(self, ch: &mut Channel) {
        match ch {
            Channel::SavedMessages(SavedMessagesChannel { id: _, user, nonce }) => {
                if let Some(puser) = self.user {
                    *user = puser;
                }
                if let Some(pnonce) = self.nonce {
                    *nonce = Some(pnonce);
                }
            }
            Channel::DirectMessage(DirectMessageChannel {
                id: _,
                recipients,
                last_message_id,
                nonce,
                active,
            }) => {
                if let Some(precipients) = self.recipients {
                    *recipients = precipients;
                }
                if let Some(plast_message_id) = self.last_message_id {
                    *last_message_id = Some(plast_message_id);
                }
                if let Some(pnonce) = self.nonce {
                    *nonce = Some(pnonce);
                }
                if let Some(pactive) = self.active {
                    *active = pactive;
                }
            }
            Channel::Group(GroupChannel {
                id: _,
                recipients,
                name,
                owner,
                description,
                last_message_id,
                icon,
                permissions,
                nsfw,
                nonce,
            }) => {
                if let Some(precipients) = self.recipients {
                    *recipients = precipients;
                }
                if let Some(pname) = self.name {
                    *name = pname;
                }
                if let Some(powner) = self.owner {
                    *owner = powner;
                }
                if let Some(pdescription) = self.description {
                    *description = Some(pdescription);
                }
                if let Some(plast_message_id) = self.last_message_id {
                    *last_message_id = Some(plast_message_id);
                }
                if let Some(picon) = self.icon {
                    *icon = Some(picon);
                }
                if let Some(ppermissions) = self.permissions {
                    *permissions = Some(ppermissions);
                }
                if let Some(pnsfw) = self.nsfw {
                    *nsfw = Some(pnsfw);
                }
                if let Some(pnonce) = self.nonce {
                    *nonce = Some(pnonce);
                }
            }
            Channel::TextChannel(TextChannel {
                server_channel:
                    ServerChannel {
                        id: _,
                        server,
                        name,
                        description,
                        icon,
                        default_permissions,
                        role_permissions,
                        nsfw,
                    },
                last_message_id: _,
                nonce,
            }) => {
                if let Some(pserver) = self.server {
                    *server = pserver;
                }
                if let Some(pname) = self.name {
                    *name = pname;
                }
                if let Some(pdescription) = self.description {
                    *description = Some(pdescription);
                }
                if let Some(picon) = self.icon {
                    *icon = Some(picon);
                }
                if let Some(pdefault_permissions) = self.default_permissions {
                    *default_permissions = Some(pdefault_permissions);
                }
                if let Some(prole_permissions) = self.role_permissions {
                    *role_permissions = prole_permissions;
                }
                if let Some(pnsfw) = self.nsfw {
                    *nsfw = Some(pnsfw);
                }
                // if let Some(plast_message_id) = self.last_message_id {
                //     *last_message_id = Some(plast_message_id);
                // }
                if let Some(pnonce) = self.nonce {
                    *nonce = Some(pnonce);
                }
            }
            Channel::VoiceChannel(VoiceChannel {
                server_channel:
                    ServerChannel {
                        id: _,
                        server,
                        name,
                        description,
                        icon,
                        default_permissions,
                        role_permissions,
                        nsfw,
                    },
                nonce,
            }) => {
                if let Some(pserver) = self.server {
                    *server = pserver;
                }
                if let Some(pname) = self.name {
                    *name = pname;
                }
                if let Some(pdescription) = self.description {
                    *description = Some(pdescription);
                }
                if let Some(picon) = self.icon {
                    *icon = Some(picon);
                }
                if let Some(pdefault_permissions) = self.default_permissions {
                    *default_permissions = Some(pdefault_permissions);
                }
                if let Some(prole_permissions) = self.role_permissions {
                    *role_permissions = prole_permissions;
                }
                if let Some(pnsfw) = self.nsfw {
                    *nsfw = Some(pnsfw);
                }
                if let Some(pnonce) = self.nonce {
                    *nonce = Some(pnonce);
                }
            }
        }
    }
pub fn patch ( self , ch : & mut Channel ) { match ch { Channel :: SavedMessages ( SavedMessagesChannel { id : _ , user , nonce } ) => { if let Some ( puser ) = self . user { * user = puser ; } if let Some ( pnonce ) = self . nonce { * nonce = Some ( pnonce ) ; } } Channel :: DirectMessage ( DirectMessageChannel { id : _ , recipients , last_message_id , nonce , active , } ) => { if let Some ( precipients ) = self . recipients { * recipients = precipients ; } if let Some ( plast_message_id ) = self . last_message_id { * last_message_id = Some ( plast_message_id ) ; } if let Some ( pnonce ) = self . nonce { * nonce = Some ( pnonce ) ; } if let Some ( pactive ) = self . active { * active = pactive ; } } Channel :: Group ( GroupChannel { id : _ , recipients , name , owner , description , last_message_id , icon , permissions , nsfw , nonce , } ) => { if let Some ( precipients ) = self . recipients { * recipients = precipients ; } if let Some ( pname ) = self . name { * name = pname ; } if let Some ( powner ) = self . owner { * owner = powner ; } if let Some ( pdescription ) = self . description { * description = Some ( pdescription ) ; } if let Some ( plast_message_id ) = self . last_message_id { * last_message_id = Some ( plast_message_id ) ; } if let Some ( picon ) = self . icon { * icon = Some ( picon ) ; } if let Some ( ppermissions ) = self . permissions { * permissions = Some ( ppermissions ) ; } if let Some ( pnsfw ) = self . nsfw { * nsfw = Some ( pnsfw ) ; } if let Some ( pnonce ) = self . nonce { * nonce = Some ( pnonce ) ; } } Channel :: TextChannel ( TextChannel { server_channel : ServerChannel { id : _ , server , name , description , icon , default_permissions , role_permissions , nsfw , } , last_message_id : _ , nonce , } ) => { if let Some ( pserver ) = self . server { * server = pserver ; } if let Some ( pname ) = self . name { * name = pname ; } if let Some ( pdescription ) = self . description { * description = Some ( pdescription ) ; } if let Some ( picon ) = self . icon { * icon = Some ( picon ) ; } if let Some ( pdefault_permissions ) = self . default_permissions { * default_permissions = Some ( pdefault_permissions ) ; } if let Some ( prole_permissions ) = self . role_permissions { * role_permissions = prole_permissions ; } if let Some ( pnsfw ) = self . nsfw { * nsfw = Some ( pnsfw ) ; } // if let Some(plast_message_id) = self.last_message_id { //     *last_message_id = Some(plast_message_id); // } if let Some ( pnonce ) = self . nonce { * nonce = Some ( pnonce ) ; } } Channel :: VoiceChannel ( VoiceChannel { server_channel : ServerChannel { id : _ , server , name , description , icon , default_permissions , role_permissions , nsfw , } , nonce , } ) => { if let Some ( pserver ) = self . server { * server = pserver ; } if let Some ( pname ) = self . name { * name = pname ; } if let Some ( pdescription ) = self . description { * description = Some ( pdescription ) ; } if let Some ( picon ) = self . icon { * icon = Some ( picon ) ; } if let Some ( pdefault_permissions ) = self . default_permissions { * default_permissions = Some ( pdefault_permissions ) ; } if let Some ( prole_permissions ) = self . role_permissions { * role_permissions = prole_permissions ; } if let Some ( pnsfw ) = self . nsfw { * nsfw = Some ( pnsfw ) ; } if let Some ( pnonce ) = self . nonce { * nonce = Some ( pnonce ) ; } } } }
Treats self as a patch and applies it to channel.
Treats self as a patch and applies it to channel .
self
ch
&mut Channel
self
ch
&mut Channel