pub struct RdmaBuilder { /* private fields */ }
Expand description

The builder for the Rdma, it follows the builder pattern.

Implementations

Create a default builder The default settings are: dev name: None access right: LocalWrite | RemoteRead | RemoteWrite | RemoteAtomic complete queue size: 16 port number: 1 gid index: 1

Note: We highly recommend setting the port number and the gid index.

Create a Rdma from this builder

Establish connection with RDMA server

Used with listen

Examples
use async_rdma::RdmaBuilder;
use portpicker::pick_unused_port;
use std::{
    io,
    net::{Ipv4Addr, SocketAddrV4},
    time::Duration,
};

async fn client(addr: SocketAddrV4) -> io::Result<()> {
    let _rdma = RdmaBuilder::default().connect(addr).await?;
    Ok(())
}

#[tokio::main]
async fn server(addr: SocketAddrV4) -> io::Result<()> {
    let _rdma = RdmaBuilder::default().listen(addr).await?;
    Ok(())
}
#[tokio::main]
async fn main() {
    let addr = SocketAddrV4::new(Ipv4Addr::new(127, 0, 0, 1), pick_unused_port().unwrap());
    std::thread::spawn(move || server(addr));
    tokio::time::sleep(Duration::from_secs(3)).await;
    client(addr)
        .await
        .map_err(|err| println!("{}", err))
        .unwrap();
}

Listen to the address to wait for a connection to be established

Used with connect

Examples
use async_rdma::RdmaBuilder;
use portpicker::pick_unused_port;
use std::{
    io,
    net::{Ipv4Addr, SocketAddrV4},
    time::Duration,
};

async fn client(addr: SocketAddrV4) -> io::Result<()> {
    let _rdma = RdmaBuilder::default().connect(addr).await?;
    Ok(())
}

#[tokio::main]
async fn server(addr: SocketAddrV4) -> io::Result<()> {
    let _rdma = RdmaBuilder::default().listen(addr).await?;
    Ok(())
}
#[tokio::main]
async fn main() {
    let addr = SocketAddrV4::new(Ipv4Addr::new(127, 0, 0, 1), pick_unused_port().unwrap());
    std::thread::spawn(move || server(addr));
    tokio::time::sleep(Duration::from_secs(3)).await;
    client(addr)
        .await
        .map_err(|err| println!("{}", err))
        .unwrap();
}

Set device name

Set the complete queue size

Set the gid index

Set the port number

Set the connection type

Set if send/recv raw data

Set maximum number of outstanding send requests in the send queue

Set maximum number of outstanding receive requests in the receive queue

Set maximum number of scatter/gather elements (SGE) in a WR on the send queue

Set maximum number of scatter/gather elements (SGE) in a WR on the receive queue

Set default QP access

Set default MR access

Set the stragety to manage MRs

Set max length of message send/recv by Agent

Set max access permission for remote mr requests

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more