pub struct SegmentsMut<'a, T, const N: usize> { /* private fields */ }Expand description
A guard over several disjoint typed sub-ranges of one account,
returned by AccountView::split_segments_mut.
It holds a single exclusive byte borrow of the account plus N
registry leases (one per range) that proved pairwise disjointness at
construction and release on drop. Because the ranges are disjoint and
all sit inside the one borrow, all_mut can hand out
N independent &mut T simultaneously. This is the generalized
split_at_mut for account fields that ordinary segment_mut cannot
express.
Construction must go through the account’s checked split API. Raw offsets cannot be supplied to a safe constructor:
ⓘ
use hopper_runtime::{RefMut, SegmentLease, SegmentsMut};
fn unchecked<'a>(data: RefMut<'a, [u8]>, leases: [SegmentLease<'a>; 2]) {
let _ = SegmentsMut::<[u8; 8], 2>::new(data, [0, 0], leases);
}Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<'a, T, const N: usize> !Send for SegmentsMut<'a, T, N>
impl<'a, T, const N: usize> !Sync for SegmentsMut<'a, T, N>
impl<'a, T, const N: usize> !UnwindSafe for SegmentsMut<'a, T, N>
impl<'a, T, const N: usize> Freeze for SegmentsMut<'a, T, N>
impl<'a, T, const N: usize> RefUnwindSafe for SegmentsMut<'a, T, N>where
[usize; N]: RefUnwindSafe,
[SegmentLease<'a>; N]: RefUnwindSafe,
PhantomData<fn() -> T>: RefUnwindSafe,
impl<'a, T, const N: usize> Unpin for SegmentsMut<'a, T, N>
impl<'a, T, const N: usize> UnsafeUnpin for SegmentsMut<'a, T, N>where
[usize; N]: UnsafeUnpin,
[SegmentLease<'a>; N]: UnsafeUnpin,
PhantomData<fn() -> T>: UnsafeUnpin,
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