1- //! Block Device support
1+ //! Traits and types for working with Block Devices.
22//!
33//! Generic code for handling block devices, such as types for identifying
44//! a particular block on a block device by its index.
55
6- /// Represents a standard 512 byte block (also known as a sector). IBM PC
7- /// formatted 5.25" and 3.5" floppy disks, SD/MMC cards up to 1 GiB in size
8- /// and IDE/SATA Hard Drives up to about 2 TiB all have 512 byte blocks.
6+ /// A standard 512 byte block (also known as a sector).
7+ ///
8+ /// IBM PC formatted 5.25" and 3.5" floppy disks, IDE/SATA Hard Drives up to
9+ /// about 2 TiB, and almost all SD/MMC cards have 512 byte blocks.
910///
1011/// This library does not support devices with a block size other than 512
1112/// bytes.
@@ -15,15 +16,17 @@ pub struct Block {
1516 pub contents : [ u8 ; Block :: LEN ] ,
1617}
1718
18- /// Represents the linear numeric address of a block (or sector). The first
19- /// block on a disk gets `BlockIdx(0)` (which usually contains the Master Boot
20- /// Record).
19+ /// The linear numeric address of a block (or sector).
20+ ///
21+ /// The first block on a disk gets `BlockIdx(0)` (which usually contains the
22+ /// Master Boot Record).
2123#[ cfg_attr( feature = "defmt-log" , derive( defmt:: Format ) ) ]
2224#[ derive( Debug , Copy , Clone , PartialEq , Eq , PartialOrd , Ord ) ]
2325pub struct BlockIdx ( pub u32 ) ;
2426
25- /// Represents the a number of blocks (or sectors). Add this to a `BlockIdx`
26- /// to get an actual address on disk.
27+ /// The a number of blocks (or sectors).
28+ ///
29+ /// Add this to a `BlockIdx` to get an actual address on disk.
2730#[ cfg_attr( feature = "defmt-log" , derive( defmt:: Format ) ) ]
2831#[ derive( Debug , Copy , Clone , PartialEq , Eq , PartialOrd , Ord ) ]
2932pub struct BlockCount ( pub u32 ) ;
@@ -34,7 +37,7 @@ pub struct BlockIter {
3437 current : BlockIdx ,
3538}
3639
37- /// Represents a block device - a device which can read and write blocks (or
40+ /// A block device - a device which can read and write blocks (or
3841/// sectors). Only supports devices which are <= 2 TiB in size.
3942pub trait BlockDevice {
4043 /// The errors that the `BlockDevice` can return. Must be debug formattable.
0 commit comments