pub struct Region { /* private fields */ }Expand description
A contiguous region of memory addressed by offset.
§Safety
The caller must ensure:
baseis valid forlenbytes and properly aligned for all contained types- the memory remains valid for the lifetime of this Region
Implementations§
Source§impl Region
impl Region
Sourcepub unsafe fn from_raw(base: *mut u8, len: usize) -> Self
pub unsafe fn from_raw(base: *mut u8, len: usize) -> Self
Create a region from a raw pointer and length.
§Safety
basemust be valid forlenbytesbasemust be aligned for all contained types- the memory must remain valid for the lifetime of this Region
Trait Implementations§
impl Copy for Region
impl Send for Region
impl Sync for Region
Auto Trait Implementations§
impl Freeze for Region
impl RefUnwindSafe for Region
impl Unpin for Region
impl UnwindSafe for Region
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