Trait btlib::Sectored

source ·
pub trait Sectored {
    // Required method
    fn sector_sz(&self) -> usize;

    // Provided methods
    fn sector_sz64(&self) -> u64 { ... }
    fn assert_sector_sz(&self, actual: usize) -> Result<()> { ... }
    fn assert_at_least_sector_sz(&self, actual: usize) -> Result<()> { ... }
    fn offset_at(&self, index: u64) -> u64 { ... }
}

Required Methods§

source

fn sector_sz(&self) -> usize

Returns the size of the sector for this stream.

Provided Methods§

source

fn sector_sz64(&self) -> u64

Returns the sector size as a u64.

source

fn assert_sector_sz(&self, actual: usize) -> Result<()>

Returns Err(Error::IncorrectSize) if the given size is not equal to the sector size.

source

fn assert_at_least_sector_sz(&self, actual: usize) -> Result<()>

Returns Err(Error::IncorrectSize) if the given size is less than the sector size.

source

fn offset_at(&self, index: u64) -> u64

Returns the offset (in bytes) from the beginning of this stream that the given 0-based sector index corresponds to.

Implementations on Foreign Types§

source§

impl<T: Sectored + ?Sized> Sectored for &T

source§

impl Sectored for File

source§

impl<T: Sectored + ?Sized> Sectored for &mut T

Implementors§