Trait async_rdma::LocalMrWriteAccess
source · pub unsafe trait LocalMrWriteAccess: MrAccess + LocalMrReadAccess + Sealed {
fn as_mut_ptr(&mut self) -> MappedRwLockWriteGuard<'_, *mut u8> { ... }
fn try_as_mut_ptr(&self) -> Option<MappedRwLockWriteGuard<'_, *mut u8>> { ... }
fn as_mut_ptr_unchecked(&mut self) -> *mut u8 { ... }
fn as_mut_slice(&mut self) -> MappedRwLockWriteGuard<'_, &mut [u8]> { ... }
fn try_as_mut_slice(
&mut self
) -> Option<MappedRwLockWriteGuard<'_, &mut [u8]>> { ... }
unsafe fn as_mut_slice_unchecked(&mut self) -> &mut [u8] ⓘ { ... }
fn is_writeable(&self) -> bool { ... }
fn write_inner(&self) -> RwLockWriteGuard<'_, LocalMrInner> { ... }
}
Expand description
Writable local mr trait
Safety
For the fn
s that have not been marked as unsafe
, we should make sure the implementations
meet all safety requirements, for example the memory should be initialized.
For the unsafe
fn
s, we should make sure no other safety issues have been introduced except
for the issues that have been listed in the Safety
documents of fn
s.
Provided Methods§
sourcefn as_mut_ptr(&mut self) -> MappedRwLockWriteGuard<'_, *mut u8>
fn as_mut_ptr(&mut self) -> MappedRwLockWriteGuard<'_, *mut u8>
Get the mutable start pointer until it is writeable
If this mr is being used in RDMA ops, the thread may be blocked
sourcefn try_as_mut_ptr(&self) -> Option<MappedRwLockWriteGuard<'_, *mut u8>>
fn try_as_mut_ptr(&self) -> Option<MappedRwLockWriteGuard<'_, *mut u8>>
Try to get the mutable start pointer
Return None
if this mr is being used in RDMA ops without blocking thread
sourcefn as_mut_ptr_unchecked(&mut self) -> *mut u8
fn as_mut_ptr_unchecked(&mut self) -> *mut u8
Get the memory region start mut addr without lock
Safety
Make sure the mr is writeable without cancel safety issue
sourcefn as_mut_slice(&mut self) -> MappedRwLockWriteGuard<'_, &mut [u8]>
fn as_mut_slice(&mut self) -> MappedRwLockWriteGuard<'_, &mut [u8]>
Get the memory region as mutable slice until it is writeable
If this mr is being used in RDMA ops, the thread may be blocked
sourcefn try_as_mut_slice(&mut self) -> Option<MappedRwLockWriteGuard<'_, &mut [u8]>>
fn try_as_mut_slice(&mut self) -> Option<MappedRwLockWriteGuard<'_, &mut [u8]>>
Try to get the memory region as mutable slice
Return None
if this mr is being used in RDMA ops without blocking thread
sourceunsafe fn as_mut_slice_unchecked(&mut self) -> &mut [u8] ⓘ
unsafe fn as_mut_slice_unchecked(&mut self) -> &mut [u8] ⓘ
Get the memory region as mut slice without lock
Safety
- Make sure the mr is writeable without cancel safety issue.
- The memory of this mr is initialized.
- The total size of this mr of the slice must be no larger than
isize::MAX
.
sourcefn is_writeable(&self) -> bool
fn is_writeable(&self) -> bool
Is the corresponding RwLocalMrInner
writeable?
sourcefn write_inner(&self) -> RwLockWriteGuard<'_, LocalMrInner>
fn write_inner(&self) -> RwLockWriteGuard<'_, LocalMrInner>
Get write lock of LocalMrInenr