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 fns 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 fns, we should make sure no other safety issues have been introduced except for the issues that have been listed in the Safety documents of fns.

Provided Methods§

source

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

source

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

source

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

source

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

source

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

source

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.
source

fn is_writeable(&self) -> bool

Is the corresponding RwLocalMrInner writeable?

source

fn write_inner(&self) -> RwLockWriteGuard<'_, LocalMrInner>

Get write lock of LocalMrInenr

Implementors§