pub struct SegmentTableMut<'a> { /* private fields */ }Expand description
Mutable view over the segment table region.
Implementations§
Source§impl<'a> SegmentTableMut<'a>
impl<'a> SegmentTableMut<'a>
Sourcepub fn from_bytes(
data: &'a mut [u8],
segment_count: usize,
) -> Result<Self, ProgramError>
pub fn from_bytes( data: &'a mut [u8], segment_count: usize, ) -> Result<Self, ProgramError>
Parse a mutable segment table from data.
Sourcepub fn descriptor(
&self,
index: usize,
) -> Result<SegmentDescriptor, ProgramError>
pub fn descriptor( &self, index: usize, ) -> Result<SegmentDescriptor, ProgramError>
Read the descriptor at index.
Sourcepub fn set_descriptor(
&mut self,
index: usize,
desc: &SegmentDescriptor,
) -> Result<(), ProgramError>
pub fn set_descriptor( &mut self, index: usize, desc: &SegmentDescriptor, ) -> Result<(), ProgramError>
Write a descriptor at index.
Sourcepub fn init(
data: &'a mut [u8],
data_start: u32,
specs: &[(u16, u16)],
) -> Result<Self, ProgramError>
pub fn init( data: &'a mut [u8], data_start: u32, specs: &[(u16, u16)], ) -> Result<Self, ProgramError>
Initialize the segment table with descriptors computed from element sizes and initial counts.
specs is a slice of (element_size, initial_count) pairs.
Offsets are computed automatically, starting at data_start
(typically fixed_prefix_len + table_size).
Auto Trait Implementations§
impl<'a> Freeze for SegmentTableMut<'a>
impl<'a> RefUnwindSafe for SegmentTableMut<'a>
impl<'a> Send for SegmentTableMut<'a>
impl<'a> Sync for SegmentTableMut<'a>
impl<'a> Unpin for SegmentTableMut<'a>
impl<'a> UnsafeUnpin for SegmentTableMut<'a>
impl<'a> !UnwindSafe for SegmentTableMut<'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