fn write_entry_to_disk(
        &mut self,
        fat_type: FatType,
        entry: &DirEntry,
    ) -> Result<(), Error<D::Error>> {
        let mut blocks = [Block::new()];
        self.block_device
            .read(&mut blocks, entry.entry_block, "read")
            .map_err(Error::DeviceError)?;
        let block = &mut blocks[0];

        let start = usize::try_from(entry.entry_offset).map_err(|_| Error::ConversionError)?;
        block[start..start + 32].copy_from_slice(&entry.serialize(fat_type)[..]);

        self.block_device
            .write(&blocks, entry.entry_block)
            .map_err(Error::DeviceError)?;
        Ok(())
    }
/// Writes a Directory Entry to the disk
Writes a Directory Entry to the disk
Writes a Directory Entry to the disk
fn write_entry_to_disk(
        &mut self,
        fat_type: FatType,
        entry: &DirEntry,
    ) -> Result<(), Error<D::Error>> {
        let mut blocks = [Block::new()];
        self.block_device
            .read(&mut blocks, entry.entry_block, "read")
            .map_err(Error::DeviceError)?;
        let block = &mut blocks[0];
        let start = usize::try_from(entry.entry_offset).map_err(|_| Error::ConversionError)?;
        block[start..start + 32].copy_from_slice(&entry.serialize(fat_type)[..]);
        self.block_device
            .write(&blocks, entry.entry_block)
            .map_err(Error::DeviceError)?;
        Ok(())
    }
fn write_entry_to_disk ( & mut self , fat_type : FatType , entry : & DirEntry , ) -> Result < ( ) , Error < D :: Error > > { let mut blocks = [ Block :: new ( ) ] ; self . block_device . read ( & mut blocks , entry . entry_block , " " ) . map_err ( Error :: DeviceError ) ? ; let block = & mut blocks [ 0 ] ; let start = usize :: try_from ( entry . entry_offset ) . map_err ( | _ | Error :: ConversionError ) ? ; block [ start .. start + 32 ] . copy_from_slice ( & entry . serialize ( fat_type ) [ .. ] ) ; self . block_device . write ( & blocks , entry . entry_block ) . map_err ( Error :: DeviceError ) ? ; Ok ( ( ) ) }
Writes a Directory Entry to the disk
Writes a Directory Entry to the disk
&mut self
fat_type
FatType
entry
&DirEntry
&mut self
fat_type
FatType
entry
&DirEntry