pub struct DeviceContext { /* private fields */ }Expand description
A context of the RDMA device, could be used to query its resources or creating PD or CQ.
Implementations§
Source§impl DeviceContext
impl DeviceContext
Sourcepub fn alloc_pd(
self: &Arc<Self>,
) -> Result<Arc<ProtectionDomain>, AllocateProtectionDomainError>
pub fn alloc_pd( self: &Arc<Self>, ) -> Result<Arc<ProtectionDomain>, AllocateProtectionDomainError>
Allocate a protection domain.
Sourcepub fn create_comp_channel(
self: &Arc<Self>,
) -> Result<Arc<CompletionChannel>, CreateCompletionChannelError>
pub fn create_comp_channel( self: &Arc<Self>, ) -> Result<Arc<CompletionChannel>, CreateCompletionChannelError>
Create a completion event channel.
Sourcepub fn create_cq_builder(self: &Arc<Self>) -> CompletionQueueBuilder
pub fn create_cq_builder(self: &Arc<Self>) -> CompletionQueueBuilder
Create a factory for creating BasicCompletionQueue and ExtendedCompletionQueue.
Sourcepub fn query_device(&self) -> Result<DeviceAttr, QueryDeviceError>
pub fn query_device(&self) -> Result<DeviceAttr, QueryDeviceError>
Query the attributes of the RDMA device.
Sourcepub fn query_port(&self, port_num: u8) -> Result<PortAttr, QueryPortError>
pub fn query_port(&self, port_num: u8) -> Result<PortAttr, QueryPortError>
Query the attributes of a physical port.
Sourcepub fn query_gid(
&self,
port_num: u8,
gid_index: u32,
) -> Result<Gid, QueryGidError>
pub fn query_gid( &self, port_num: u8, gid_index: u32, ) -> Result<Gid, QueryGidError>
Query the Gid of the GID specified by GID index and port number.
Sourcepub fn query_gid_ex(
&self,
port_num: u8,
gid_index: u32,
) -> Result<GidEntry, QueryGidError>
pub fn query_gid_ex( &self, port_num: u8, gid_index: u32, ) -> Result<GidEntry, QueryGidError>
Query the GidEntry of the GID specified by GID index and port number.
Sourcepub fn query_gid_type(
&self,
port_num: u8,
gid_index: u32,
) -> Result<u32, QueryGidError>
pub fn query_gid_type( &self, port_num: u8, gid_index: u32, ) -> Result<u32, QueryGidError>
Query the type of the GID specified by GID index and port number.
Note that this gid type is represented by u32:
- If return value is 0, the type is either
GidType::InfiniBandorGidType::RoceV1. - If return value is 1, the type is
GidType::RoceV2.
Sourcepub fn query_gid_table(&self) -> Result<Vec<GidEntry>, QueryGidTableError>
pub fn query_gid_table(&self) -> Result<Vec<GidEntry>, QueryGidTableError>
Query all GidEntrys on a RDMA device.
Sourcepub unsafe fn context(&self) -> NonNull<ibv_context>
pub unsafe fn context(&self) -> NonNull<ibv_context>
§Safety
Return the handle of device context.
We mark this method unsafe because the lifetime of ibv_context is not associated
with the return value.
Trait Implementations§
Source§impl Debug for DeviceContext
impl Debug for DeviceContext
Source§impl DeviceInfo for DeviceContext
impl DeviceInfo for DeviceContext
Source§impl Drop for DeviceContext
impl Drop for DeviceContext
impl Send for DeviceContext
impl Sync for DeviceContext
Auto Trait Implementations§
impl Freeze for DeviceContext
impl RefUnwindSafe for DeviceContext
impl Unpin for DeviceContext
impl UnsafeUnpin for DeviceContext
impl UnwindSafe for DeviceContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more