pub struct Context { /* private fields */ }Expand description
An opened RDMA device context.
Wraps ibv_context*. Create via Device::open.
All child resources (PD, CQ, QP, …) hold an Arc<Context> to keep
the context alive.
Implementations§
Source§impl Context
impl Context
Sourcepub unsafe fn from_raw(ctx: *mut ibv_context, owned: bool) -> Self
pub unsafe fn from_raw(ctx: *mut ibv_context, owned: bool) -> Self
Wrap a raw ibv_context pointer.
§Safety
The pointer must be valid. If owned is true, ibv_close_device will
be called on drop. Set owned to false for rdma_cm-managed contexts.
Sourcepub fn query_device(&self) -> Result<ibv_device_attr>
pub fn query_device(&self) -> Result<ibv_device_attr>
Query device attributes.
Sourcepub fn query_port(&self, port_num: u8) -> Result<ibv_port_attr>
pub fn query_port(&self, port_num: u8) -> Result<ibv_port_attr>
Query port attributes.
Sourcepub fn query_gid(&self, port_num: u8, index: i32) -> Result<ibv_gid>
pub fn query_gid(&self, port_num: u8, index: i32) -> Result<ibv_gid>
Query a single GID entry by index.
Sourcepub fn as_raw(&self) -> *mut ibv_context
pub fn as_raw(&self) -> *mut ibv_context
Raw ibv_context pointer (for advanced/FFI use).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Context
impl RefUnwindSafe for Context
impl Unpin for Context
impl UnsafeUnpin for Context
impl UnwindSafe for Context
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