pub struct Worker { /* private fields */ }
Expand description
An object representing the communication context.
Implementations§
Source§impl Worker
impl Worker
Sourcepub async fn tag_recv(
&self,
tag: u64,
buf: &mut [MaybeUninit<u8>],
) -> Result<usize, Error>
pub async fn tag_recv( &self, tag: u64, buf: &mut [MaybeUninit<u8>], ) -> Result<usize, Error>
Receives a message with tag
.
Sourcepub async fn tag_recv_mask(
&self,
tag: u64,
tag_mask: u64,
buf: &mut [MaybeUninit<u8>],
) -> Result<(u64, usize), Error>
pub async fn tag_recv_mask( &self, tag: u64, tag_mask: u64, buf: &mut [MaybeUninit<u8>], ) -> Result<(u64, usize), Error>
Receives a message with tag
and tag_mask
.
Sourcepub async fn tag_recv_vectored(
&self,
tag: u64,
iov: &mut [IoSliceMut<'_>],
) -> Result<usize, Error>
pub async fn tag_recv_vectored( &self, tag: u64, iov: &mut [IoSliceMut<'_>], ) -> Result<usize, Error>
Like tag_recv
, except that it reads into a slice of buffers.
Source§impl Worker
impl Worker
Sourcepub fn print_to_stderr(&self)
pub fn print_to_stderr(&self)
Prints information about the worker.
Including protocols being used, thresholds, UCT transport methods, and other useful information associated with the worker.
Sourcepub fn thread_mode(&self) -> ucs_thread_mode_t
pub fn thread_mode(&self) -> ucs_thread_mode_t
Thread safe level of the context.
Sourcepub fn address(&self) -> Result<WorkerAddress<'_>, Error>
pub fn address(&self) -> Result<WorkerAddress<'_>, Error>
Get the address of the worker object.
This address can be passed to remote instances of the UCP library in order to connect to this worker.
Sourcepub fn create_listener(
self: &Rc<Self>,
addr: SocketAddr,
) -> Result<Listener, Error>
pub fn create_listener( self: &Rc<Self>, addr: SocketAddr, ) -> Result<Listener, Error>
Create a new Listener
.
Sourcepub fn connect_addr(
self: &Rc<Self>,
addr: &WorkerAddress<'_>,
) -> Result<Endpoint, Error>
pub fn connect_addr( self: &Rc<Self>, addr: &WorkerAddress<'_>, ) -> Result<Endpoint, Error>
Connect to a remote worker by address.
Sourcepub async fn connect_socket(
self: &Rc<Self>,
addr: SocketAddr,
) -> Result<Endpoint, Error>
pub async fn connect_socket( self: &Rc<Self>, addr: SocketAddr, ) -> Result<Endpoint, Error>
Connect to a remote listener.
Sourcepub async fn accept(
self: &Rc<Self>,
connection: ConnectionRequest,
) -> Result<Endpoint, Error>
pub async fn accept( self: &Rc<Self>, connection: ConnectionRequest, ) -> Result<Endpoint, Error>
Accept a connection request.
Sourcepub fn arm(&self) -> Result<bool, Error>
pub fn arm(&self) -> Result<bool, Error>
This needs to be called before waiting on each notification on this worker.
Returns ‘true’ if one can wait for events (sleep mode).