pub struct MultiRegion { /* private fields */ }Expand description
A set of arena regions in absolute arena coordinates, the
multi-region sibling of Region. Where a Region confines an
entire value graph to one window, a MultiRegion lets the graph span
regions: every followed pointer is an arena-absolute offset that must
land fully inside one of these regions (contains_span picks the
region whose window the span starts in and requires the whole span to
fit it). A span that starts in no region, or starts in one region but
runs past its end, is rejected — there is no “fell through to the next
region” silent over-read.
The regions are half-open [start, end) absolute byte windows and may
be empty (start == end, e.g. a zero-length in_buf); an empty
region contains no span. They are expected non-overlapping (the ABI
arena layout guarantees this), but contains_span only ever requires
a span to fit some region, so a benign overlap could not cause a
missed bounds check.
Implementations§
Source§impl MultiRegion
impl MultiRegion
Sourcepub fn new(
const_data: (usize, usize),
in_buf: (usize, usize),
out_buf: (usize, usize),
scratch: (usize, usize),
) -> Result<Self, VerifyError>
pub fn new( const_data: (usize, usize), in_buf: (usize, usize), out_buf: (usize, usize), scratch: (usize, usize), ) -> Result<Self, VerifyError>
Build the four-region map from absolute arena boundaries. Each
pair is a half-open [start, end) window; start > end for any
region is a caller bug surfaced as VerifyError::DegenerateRegion.
Trait Implementations§
Source§impl Clone for MultiRegion
impl Clone for MultiRegion
Source§fn clone(&self) -> MultiRegion
fn clone(&self) -> MultiRegion
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for MultiRegion
Auto Trait Implementations§
impl Freeze for MultiRegion
impl RefUnwindSafe for MultiRegion
impl Send for MultiRegion
impl Sync for MultiRegion
impl Unpin for MultiRegion
impl UnsafeUnpin for MultiRegion
impl UnwindSafe for MultiRegion
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more