fn to_tags<F, Er>(&self, mut f: F) -> Result<(), Er>
    where
        F: FnMut(&Tag) -> Result<(), Er>,
    {
        f(&Tag::Header(Header {
            signed: self.is_signed(),
            encrypted: self.is_encrypted(),
        }))?;

        // Write data tags, encrypted or non-encrypted
        match self.enc.as_either_ref() {
            Either::Left(enc) => {
                f(&Tag::EncryptionHeader(enc.enc_header))?;
                for section in &enc.enc_sections {
                    f(&Tag::EncryptedData(Cow::Borrowed(&section.0)))?;
                }
            }
            Either::Right(not_enc) => {
                f(&Tag::AppInfo(not_enc.app_info))?;
                // TODO: Bootloader
                for programdata in &not_enc.sections {
                    f(&Tag::ProgramData(programdata.clone()))?;
                }
            }
        }

        if let Either::Left(sig) = self.sig.as_either_ref() {
            f(&Tag::Signature(sig.signature.clone()))?;
        }

        Ok(())
    }
/// Serialize this GBL to a sequence of tags (excluding the end tag) and
/// pass each tag to a closure.
Serialize this GBL to a sequence of tags (excluding the end tag) and
pass each tag to a closure.
Serialize this GBL to a sequence of tags ( excluding the end tag ) and pass each tag to a closure .
fn to_tags<F, Er>(&self, mut f: F) -> Result<(), Er>
    where
        F: FnMut(&Tag) -> Result<(), Er>,
    {
        f(&Tag::Header(Header {
            signed: self.is_signed(),
            encrypted: self.is_encrypted(),
        }))?;
        // Write data tags, encrypted or non-encrypted
        match self.enc.as_either_ref() {
            Either::Left(enc) => {
                f(&Tag::EncryptionHeader(enc.enc_header))?;
                for section in &enc.enc_sections {
                    f(&Tag::EncryptedData(Cow::Borrowed(&section.0)))?;
                }
            }
            Either::Right(not_enc) => {
                f(&Tag::AppInfo(not_enc.app_info))?;
                // TODO: Bootloader
                for programdata in &not_enc.sections {
                    f(&Tag::ProgramData(programdata.clone()))?;
                }
            }
        }
        if let Either::Left(sig) = self.sig.as_either_ref() {
            f(&Tag::Signature(sig.signature.clone()))?;
        }
        Ok(())
    }
fn to_tags < F , Er > ( & self , mut f : F ) -> Result < ( ) , Er > where F : FnMut ( & Tag ) -> Result < ( ) , Er > , { f ( & Tag :: Header ( Header { signed : self . is_signed ( ) , encrypted : self . is_encrypted ( ) , } ) ) ? ; // Write data tags, encrypted or non-encrypted match self . enc . as_either_ref ( ) { Either :: Left ( enc ) => { f ( & Tag :: EncryptionHeader ( enc . enc_header ) ) ? ; for section in & enc . enc_sections { f ( & Tag :: EncryptedData ( Cow :: Borrowed ( & section . 0 ) ) ) ? ; } } Either :: Right ( not_enc ) => { f ( & Tag :: AppInfo ( not_enc . app_info ) ) ? ; // TODO: Bootloader for programdata in & not_enc . sections { f ( & Tag :: ProgramData ( programdata . clone ( ) ) ) ? ; } } } if let Either :: Left ( sig ) = self . sig . as_either_ref ( ) { f ( & Tag :: Signature ( sig . signature . clone ( ) ) ) ? ; } Ok ( ( ) ) }
Serialize this GBL to a sequence of tags (excluding the end tag) and
pass each tag to a closure.
Serialize this GBL to a sequence of tags ( excluding the end tag ) and pass each tag to a closure .
&self
f
F