Skip to main content

DeviceContext

Struct DeviceContext 

Source
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

Source

pub fn alloc_pd( self: &Arc<Self>, ) -> Result<Arc<ProtectionDomain>, AllocateProtectionDomainError>

Allocate a protection domain.

Source

pub fn create_comp_channel( self: &Arc<Self>, ) -> Result<Arc<CompletionChannel>, CreateCompletionChannelError>

Create a completion event channel.

Source

pub fn create_cq_builder(self: &Arc<Self>) -> CompletionQueueBuilder

Create a factory for creating BasicCompletionQueue and ExtendedCompletionQueue.

Source

pub fn query_device(&self) -> Result<DeviceAttr, QueryDeviceError>

Query the attributes of the RDMA device.

Source

pub fn query_port(&self, port_num: u8) -> Result<PortAttr, QueryPortError>

Query the attributes of a physical port.

Source

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.

Source

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.

Source

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:

Source

pub fn query_gid_table(&self) -> Result<Vec<GidEntry>, QueryGidTableError>

Query all GidEntrys on a RDMA device.

Source

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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl DeviceInfo for DeviceContext

Source§

fn name(&self) -> String

Get the name of the device, for example, mlx5_0.
Source§

fn guid(&self) -> Guid

Get the GUID of the device.
Source§

fn transport_type(&self) -> TransportType

Get the transport type of the device.
Source§

impl Drop for DeviceContext

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Send for DeviceContext

Source§

impl Sync for DeviceContext

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.