fn write_raw<W: Write>(&self, writer: &mut W) -> io::Result<()> {
        match self {
            Tag::Header(hdr) => {
                writer.write_u32::<LittleEndian>(0x03000000)?;
                writer.write_u8(if hdr.encrypted { 1 } else { 0 })?;
                writer.write_u8(if hdr.signed { 1 } else { 0 })?;
                writer.write_u8(0)?;
                writer.write_u8(0)?;
            }
            Tag::AppInfo(appinfo) => {
                appinfo.write(writer)?;
            }
            Tag::ProgramData(data) => {
                writer.write_u32::<LittleEndian>(data.flash_addr)?;
                writer.write_all(&data.data)?;
            }
            Tag::Signature(sig) => {
                writer.write_all(&sig.raw)?;
            }
            Tag::End(crc) => {
                writer.write_u32::<LittleEndian>(*crc)?;
            }
            Tag::EncryptionHeader(hdr) => {
                writer.write_u32::<LittleEndian>(hdr.total_bytes)?;
                writer.write_all(&hdr.nonce)?;
            }
            Tag::EncryptedData(data) => {
                writer.write_all(data)?;
            }
        }

        Ok(())
    }
/// Writes this tag into a writer, without its tag ID and length.
Writes this tag into a writer, without its tag ID and length.
Writes this tag into a writer without its tag ID and length .
fn write_raw<W: Write>(&self, writer: &mut W) -> io::Result<()> {
        match self {
            Tag::Header(hdr) => {
                writer.write_u32::<LittleEndian>(0x03000000)?;
                writer.write_u8(if hdr.encrypted { 1 } else { 0 })?;
                writer.write_u8(if hdr.signed { 1 } else { 0 })?;
                writer.write_u8(0)?;
                writer.write_u8(0)?;
            }
            Tag::AppInfo(appinfo) => {
                appinfo.write(writer)?;
            }
            Tag::ProgramData(data) => {
                writer.write_u32::<LittleEndian>(data.flash_addr)?;
                writer.write_all(&data.data)?;
            }
            Tag::Signature(sig) => {
                writer.write_all(&sig.raw)?;
            }
            Tag::End(crc) => {
                writer.write_u32::<LittleEndian>(*crc)?;
            }
            Tag::EncryptionHeader(hdr) => {
                writer.write_u32::<LittleEndian>(hdr.total_bytes)?;
                writer.write_all(&hdr.nonce)?;
            }
            Tag::EncryptedData(data) => {
                writer.write_all(data)?;
            }
        }
        Ok(())
    }
fn write_raw < W : Write > ( & self , writer : & mut W ) -> io :: Result < ( ) > { match self { Tag :: Header ( hdr ) => { writer . write_u32 :: < LittleEndian > ( 0x03000000 ) ? ; writer . write_u8 ( if hdr . encrypted { 1 } else { 0 } ) ? ; writer . write_u8 ( if hdr . signed { 1 } else { 0 } ) ? ; writer . write_u8 ( 0 ) ? ; writer . write_u8 ( 0 ) ? ; } Tag :: AppInfo ( appinfo ) => { appinfo . write ( writer ) ? ; } Tag :: ProgramData ( data ) => { writer . write_u32 :: < LittleEndian > ( data . flash_addr ) ? ; writer . write_all ( & data . data ) ? ; } Tag :: Signature ( sig ) => { writer . write_all ( & sig . raw ) ? ; } Tag :: End ( crc ) => { writer . write_u32 :: < LittleEndian > ( * crc ) ? ; } Tag :: EncryptionHeader ( hdr ) => { writer . write_u32 :: < LittleEndian > ( hdr . total_bytes ) ? ; writer . write_all ( & hdr . nonce ) ? ; } Tag :: EncryptedData ( data ) => { writer . write_all ( data ) ? ; } } Ok ( ( ) ) }
Writes this tag into a writer, without its tag ID and length.
Writes this tag into a writer without its tag ID and length .
&self
writer
&mut W