pub struct RefMut<'a, T: ?Sized> { /* private fields */ }Expand description
Exclusive (mutable) borrow guard for account data.
On drop, restores RuntimeAccount.borrow_state to NOT_BORROWED.
Implementations§
Source§impl<'a, T: ?Sized> RefMut<'a, T>
impl<'a, T: ?Sized> RefMut<'a, T>
Sourcepub unsafe fn from_raw_parts(value: &'a mut T, state: *mut u8) -> Self
pub unsafe fn from_raw_parts(value: &'a mut T, state: *mut u8) -> Self
Create an exclusive borrow guard from raw parts.
§Safety
The caller must ensure:
- The borrow state at
statewas set to 0 (exclusive) valueis valid and unique for lifetime'astatepoints to a validRuntimeAccount.borrow_state
Sourcepub fn into_raw_parts(self) -> (&'a mut T, *mut u8)
pub fn into_raw_parts(self) -> (&'a mut T, *mut u8)
Decompose into raw parts without running the destructor.
The caller takes responsibility for eventually releasing the
borrow (restoring *state to NOT_BORROWED).
Trait Implementations§
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