Trait io_block::BlockSize [] [src]

pub trait BlockSize {
    fn block_size_logical(&self) -> Result<u64>;
    fn block_count(&self) -> Result<u64>;

    fn block_size_physical(&self) -> Result<u64> { ... }
}

Some writable and readable devices (disk drives, media cards) have a block size (number of bytes that are read or written at a time) associated with them.

These devices also have a (relatively) fixed (or at least known) number of blocks that limits their length. At least, they can't be appended to.

Required Methods

The number of bytes in each logical block

The total number of logical blocks

Provided Methods

The number of bytes in each physical block

This is only a best guess. Many devices do not report a physical block size or do not report and accurate physical block size. Results will vary, be wary.

Implementors