pub unsafe trait LocalMrReadAccess: MrAccess + Sealed {
Show 14 methods fn lkey(&self) -> u32; fn get_inner(&self) -> &Arc<RwLock<LocalMrInner>>; fn as_ptr(&self) -> MappedRwLockReadGuard<'_, *const u8> { ... } fn try_as_ptr(&self) -> Option<MappedRwLockReadGuard<'_, *const u8>> { ... } fn as_ptr_unchecked(&self) -> *const u8 { ... } fn as_slice(&self) -> MappedRwLockReadGuard<'_, &[u8]> { ... } fn try_as_slice(&self) -> Option<MappedRwLockReadGuard<'_, &[u8]>> { ... } unsafe fn as_slice_unchecked(&self) -> &[u8] { ... } unsafe fn lkey_unchecked(&self) -> u32 { ... } unsafe fn rkey_unchecked(&self) -> u32 { ... } fn token_with_timeout(&self, timeout: Duration) -> Option<MrToken> { ... } unsafe fn token_with_timeout_unchecked(
        &self,
        timeout: Duration
    ) -> Option<MrToken> { ... } fn is_readable(&self) -> bool { ... } fn read_inner(&self) -> RwLockReadGuard<'_, LocalMrInner> { ... }
}
Expand description

Local memory region 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 of mrs 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.

Required Methods§

source

fn lkey(&self) -> u32

Get the local key

source

fn get_inner(&self) -> &Arc<RwLock<LocalMrInner>>

Get the corresponding RwLocalMrInner

Provided Methods§

source

fn as_ptr(&self) -> MappedRwLockReadGuard<'_, *const u8>

Get the start pointer until it is readable

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

source

fn try_as_ptr(&self) -> Option<MappedRwLockReadGuard<'_, *const u8>>

Try to get the start pointer

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

source

fn as_ptr_unchecked(&self) -> *const u8

Get the start pointer without lock

Safety

Make sure the mr is readable without cancel safety issue

source

fn as_slice(&self) -> MappedRwLockReadGuard<'_, &[u8]>

Get the memory region as slice until it is readable

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

source

fn try_as_slice(&self) -> Option<MappedRwLockReadGuard<'_, &[u8]>>

Try to get the memory region as slice

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

source

unsafe fn as_slice_unchecked(&self) -> &[u8]

Get the memory region as slice without lock

Safety
  • Make sure the mr is readable 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

unsafe fn lkey_unchecked(&self) -> u32

Get the local key without lock

Safety

Must ensure that there are no data races, for example:

  • The current thread logically owns a guard but that guard has been discarded using mem::forget.
  • The lkey of this mr is going to be changed.(It’s not going to happen so far, because variable lkey has not been implemented yet.)
source

unsafe fn rkey_unchecked(&self) -> u32

Get the remote key without lock

Safety

Must ensure that there are no data races, for example:

  • The current thread logically owns a guard but that guard has been discarded using mem::forget.
  • The rkey of this mr is going to be changed.(It’s not going to happen so far, because variable rkey has not been implemented yet.)
source

fn token_with_timeout(&self, timeout: Duration) -> Option<MrToken>

New a token with specified timeout

source

unsafe fn token_with_timeout_unchecked(
    &self,
    timeout: Duration
) -> Option<MrToken>

New a token with specified timeout with rkey_unchecked

Safety

Must ensure that there are no data races about rkey, for example:

  • The current thread logically owns a guard but that guard has been discarded using mem::forget.
  • The rkey of this mr is going to be changed.(It’s not going to happen so far, because variable rkey has not been implemented yet.)
source

fn is_readable(&self) -> bool

Is the corresponding RwLocalMrInner readable?

source

fn read_inner(&self) -> RwLockReadGuard<'_, LocalMrInner>

Get read lock of LocalMrInenr

Implementors§