pub enum SlotIndex {
Data(usize, PartitionAccess, RwPerms),
DataRange(Range<usize>, PartitionAccess, RwPerms),
}Expand description
SlotIndex encodes the index of a given slot and the specification of what the access
rights should be for that slot. The actual enforcement is done by hardware, so if someone
tries to “lie” to the API by creating a SlotIndex specifier with an inaccurate PartitionAccess
spec, hardware will ignore it.
The reason the two are bundled together is that semantic priority is given to getting the spec right in the constants in this crate that define the access control tables.
Variants§
Data(usize, PartitionAccess, RwPerms)
DataRange(Range<usize>, PartitionAccess, RwPerms)
Implementations§
Source§impl SlotIndex
impl SlotIndex
pub fn get_access_spec(&self) -> (PartitionAccess, RwPerms)
pub fn get_type(&self) -> SlotType
pub fn get_base(&self) -> usize
pub fn len(&self) -> usize
Sourcepub fn try_into_data_offset(&self) -> Result<usize, AccessError>
pub fn try_into_data_offset(&self) -> Result<usize, AccessError>
Returns OutOfBounds error if the index specified in the slot is out of bounds.
For ranges, returns the offset of the first element of the range.
pub fn try_into_data_iter(&self) -> Result<SlotOffsetIter, AccessError>
pub fn try_into_acl_offset(&self) -> Result<usize, AccessError>
pub fn try_into_acl_iter(&self) -> Result<SlotOffsetIter, AccessError>
Trait Implementations§
impl Eq for SlotIndex
impl StructuralPartialEq for SlotIndex
Auto Trait Implementations§
impl Freeze for SlotIndex
impl RefUnwindSafe for SlotIndex
impl Send for SlotIndex
impl Sync for SlotIndex
impl Unpin for SlotIndex
impl UnwindSafe for SlotIndex
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