pub struct RefMut<'a, T: ?Sized> { /* private fields */ }Implementations§
Source§impl<'a> RefMut<'a, [u8]>
impl<'a> RefMut<'a, [u8]>
Sourcepub unsafe fn project<U: ?Sized>(self, ptr: *mut U) -> RefMut<'a, U>
pub unsafe fn project<U: ?Sized>(self, ptr: *mut U) -> RefMut<'a, U>
Project a mutable byte borrow into another mutable view over the
same underlying bytes. The new guard owns the same release
mechanics. the exclusive borrow stays held until the returned
RefMut<U> drops.
§Safety
Same contract as Ref::project: ptr must point inside the
byte slice this guard owns, and the pointee must be valid U
for any bit pattern (U: Pod-style). The returned RefMut<U>
inherits the source guard’s lifetime so the account stays
exclusively borrowed for as long as the typed view lives.
Sourcepub fn slice_from(self, offset: usize) -> RefMut<'a, [u8]>
pub fn slice_from(self, offset: usize) -> RefMut<'a, [u8]>
Narrow an exclusive byte-slice borrow to a tail starting at offset.
Sourcepub fn slice(
self,
offset: usize,
len: usize,
) -> Result<RefMut<'a, [u8]>, ProgramError>
pub fn slice( self, offset: usize, len: usize, ) -> Result<RefMut<'a, [u8]>, ProgramError>
Narrow an exclusive byte-slice borrow to a checked sub-slice.
pub fn as_bytes_mut_ptr(&mut self) -> *mut u8
Trait Implementations§
impl<T: ?Sized> HopperRefOnly for RefMut<'_, T>
Auto Trait Implementations§
impl<'a, T> Freeze for RefMut<'a, T>where
T: ?Sized,
impl<'a, T> RefUnwindSafe for RefMut<'a, T>where
T: RefUnwindSafe + ?Sized,
impl<'a, T> !Send for RefMut<'a, T>
impl<'a, T> !Sync for RefMut<'a, T>
impl<'a, T> Unpin for RefMut<'a, T>where
T: ?Sized,
impl<'a, T> UnsafeUnpin for RefMut<'a, T>where
T: ?Sized,
impl<'a, T> !UnwindSafe for RefMut<'a, T>
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