Struct VolumeReader
pub struct VolumeReader<'a, R, M> {
source: &'a R,
map: M,
block_size: u32,
data_offset: u32,
leb_size: u32,
size: u64,
}Expand description
Reader over the data of a volume in a UBI image.
Returned by super::Image::volume. Byte n of the volume is in
logical eraseblock n / leb_size. A read goes to the blocks of the image
that contain those logical eraseblocks, without a buffer. Like in the
kernel, logical eraseblocks without a block read as 0xFF.
M is the block map, see super::Image::volume.
Fields§
§source: &'a R§map: M§block_size: u32§data_offset: u32§leb_size: u32§size: u64Implementations§
§impl<'a, R, M: AsRef<[u32]>> VolumeReader<'a, R, M>
impl<'a, R, M: AsRef<[u32]>> VolumeReader<'a, R, M>
pub(crate) const fn new( source: &'a R, map: M, block_size: u32, data_offset: u32, leb_size: u32, size: u64, ) -> Self
pub const fn leb_size(&self) -> u32
pub const fn leb_size(&self) -> u32
Returns the bytes of data in a logical eraseblock of the volume. It excludes the padding that the alignment of the volume leaves.
pub fn block(&self, lnum: u32) -> Option<u32>
pub fn block(&self, lnum: u32) -> Option<u32>
Returns the index of the block in the image that contains logical
eraseblock lnum, or None if there is none.
pub fn into_map(self) -> M
pub fn into_map(self) -> M
Returns the block map.
Trait Implementations§
§impl<R, M> Debug for VolumeReader<'_, R, M>
impl<R, M> Debug for VolumeReader<'_, R, M>
Auto Trait Implementations§
impl<'a, R, M> Freeze for VolumeReader<'a, R, M>
impl<'a, R, M> RefUnwindSafe for VolumeReader<'a, R, M>
impl<'a, R, M> Send for VolumeReader<'a, R, M>
impl<'a, R, M> Sync for VolumeReader<'a, R, M>
impl<'a, R, M> Unpin for VolumeReader<'a, R, M>
impl<'a, R, M> UnsafeUnpin for VolumeReader<'a, R, M>
impl<'a, R, M> UnwindSafe for VolumeReader<'a, R, M>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more