Struct VolumeTable
pub struct VolumeTable<'a> {
data: &'a [u8],
leb_size: u32,
}Expand description
Volume table of a UBI image, checked like the kernel does.
Returned by super::Image::volume_table. It borrows the buffer that
contains the table.
Fields§
§data: &'a [u8]§leb_size: u32Implementations§
§impl<'a> VolumeTable<'a>
impl<'a> VolumeTable<'a>
pub const BUFFER_LEN: usize
pub const BUFFER_LEN: usize
Length of a buffer that fits the volume table of any image.
pub(crate) const fn new(data: &'a [u8], leb_size: u32) -> Self
pub(crate) const fn new(data: &'a [u8], leb_size: u32) -> Self
Returns the table in data, which VolumeTable::check accepted.
pub(crate) fn len(leb_size: u32) -> usize
pub(crate) fn len(leb_size: u32) -> usize
Returns the length of the table on flash with logical eraseblocks of
leb_size bytes.
pub fn iter(&self) -> impl Iterator<Item = (u32, VolumeRecord<'a>)> + 'a
pub fn iter(&self) -> impl Iterator<Item = (u32, VolumeRecord<'a>)> + 'a
Returns the volumes with their IDs.
pub fn get(&self, id: u32) -> Option<VolumeRecord<'a>>
pub fn get(&self, id: u32) -> Option<VolumeRecord<'a>>
Returns the volume with the ID id.
pub fn find(&self, name: &[u8]) -> Option<(u32, VolumeRecord<'a>)>
pub fn find(&self, name: &[u8]) -> Option<(u32, VolumeRecord<'a>)>
Returns the volume named name with its ID.
Trait Implementations§
§impl<'a> Clone for VolumeTable<'a>
impl<'a> Clone for VolumeTable<'a>
§fn clone(&self) -> VolumeTable<'a>
fn clone(&self) -> VolumeTable<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a> Copy for VolumeTable<'a>
Auto Trait Implementations§
impl<'a> Freeze for VolumeTable<'a>
impl<'a> RefUnwindSafe for VolumeTable<'a>
impl<'a> Send for VolumeTable<'a>
impl<'a> Sync for VolumeTable<'a>
impl<'a> Unpin for VolumeTable<'a>
impl<'a> UnsafeUnpin for VolumeTable<'a>
impl<'a> UnwindSafe for VolumeTable<'a>
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