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

Get the local key

Get the corresponding RwLocalMrInner

Provided Methods

Get the start pointer until it is readable

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

Try to get the start pointer

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

Get the start pointer without lock

Safety

Make sure the mr is readable without cancel safety issue

Get the memory region as slice until it is readable

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

Try to get the memory region as slice

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

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.

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

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

New a token with specified timeout

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

Is the corresponding RwLocalMrInner readable?

Get read lock of LocalMrInenr

Implementors