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]Notable traits for &[u8]impl Read for &[u8]impl Write for &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

Get the mutable start pointer until it is writeable

If this mr is being used in RDMA ops, the thread may be blocked

Try to get the mutable start pointer

Return None if this mr is being used in RDMA ops without blocking thread

Get the memory region start mut addr without lock

Safety

Make sure the mr is writeable without cancel safety issue

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

Try to get the memory region as mutable slice

Return None if this mr is being used in RDMA ops without blocking thread

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.

Is the corresponding RwLocalMrInner writeable?

Get write lock of LocalMrInenr

Implementors