pub enum SafetyBounds {
None,
Mpu,
Software,
Mask,
}Expand description
Memory-bounds safety strategy. Phase 1 of docs/binary-safety-design.md §3.1.
Mpu/PMP: rely on hardware (ARM MPU or RV32 PMP) — no inline check.Software: emit aCMP/BHS Trap_Handler(ARM) orbgeu addr, mem_size, ebreak(RV32) before every load/store.Mask: emitAND addr, addr, #(mem_size - 1)— only valid when memory size is a power of two. Wraps on OOB rather than trapping (fuzz-profile semantics).None: no bounds enforcement.
Variants§
None
No bounds check (caller assumes the WASM module is trusted)
Mpu
ARM MPU / RV32 PMP — hardware enforcement, no inline guard
Software
Software CMP/BHS (ARM) or BGEU+EBREAK (RV32) per access
Mask
AND-mask, requires power-of-two memory size
Implementations§
Trait Implementations§
Source§impl Clone for SafetyBounds
impl Clone for SafetyBounds
Source§fn clone(&self) -> SafetyBounds
fn clone(&self) -> SafetyBounds
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 moreSource§impl Debug for SafetyBounds
impl Debug for SafetyBounds
Source§impl Default for SafetyBounds
impl Default for SafetyBounds
Source§fn default() -> SafetyBounds
fn default() -> SafetyBounds
Returns the “default value” for a type. Read more
Source§impl PartialEq for SafetyBounds
impl PartialEq for SafetyBounds
Source§fn eq(&self, other: &SafetyBounds) -> bool
fn eq(&self, other: &SafetyBounds) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for SafetyBounds
impl Eq for SafetyBounds
impl StructuralPartialEq for SafetyBounds
Auto Trait Implementations§
impl Freeze for SafetyBounds
impl RefUnwindSafe for SafetyBounds
impl Send for SafetyBounds
impl Sync for SafetyBounds
impl Unpin for SafetyBounds
impl UnsafeUnpin for SafetyBounds
impl UnwindSafe for SafetyBounds
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.