pub trait WorkerTransfers: Send + Sync {
// Required methods
fn execute_local_transfer(
&self,
src: LogicalLayoutHandle,
dst: LogicalLayoutHandle,
src_block_ids: Arc<[BlockId]>,
dst_block_ids: Arc<[BlockId]>,
options: TransferOptions,
) -> Result<TransferCompleteNotification>;
fn execute_remote_onboard(
&self,
src: RemoteDescriptor,
dst: LogicalLayoutHandle,
dst_block_ids: Arc<[BlockId]>,
options: TransferOptions,
) -> Result<TransferCompleteNotification>;
fn execute_remote_offload(
&self,
src: LogicalLayoutHandle,
src_block_ids: Arc<[BlockId]>,
dst: RemoteDescriptor,
options: TransferOptions,
) -> Result<TransferCompleteNotification>;
fn connect_remote(
&self,
instance_id: InstanceId,
metadata: Vec<SerializedLayout>,
) -> Result<ConnectRemoteResponse>;
fn has_remote_metadata(&self, instance_id: InstanceId) -> bool;
fn execute_remote_onboard_for_instance(
&self,
instance_id: InstanceId,
remote_logical_type: LogicalLayoutHandle,
src_block_ids: Vec<BlockId>,
dst: LogicalLayoutHandle,
dst_block_ids: Arc<[BlockId]>,
options: TransferOptions,
) -> Result<TransferCompleteNotification>;
}Required Methods§
Sourcefn execute_local_transfer(
&self,
src: LogicalLayoutHandle,
dst: LogicalLayoutHandle,
src_block_ids: Arc<[BlockId]>,
dst_block_ids: Arc<[BlockId]>,
options: TransferOptions,
) -> Result<TransferCompleteNotification>
fn execute_local_transfer( &self, src: LogicalLayoutHandle, dst: LogicalLayoutHandle, src_block_ids: Arc<[BlockId]>, dst_block_ids: Arc<[BlockId]>, options: TransferOptions, ) -> Result<TransferCompleteNotification>
Execute a local transfer between two logical layouts.
§Arguments
src- The source layout handledst- The destination layout handlesrc_block_ids- The source block IDsdst_block_ids- The destination block IDsoptions- Transfer options (layer range, bounce buffers, etc.)
§Returns
A future that completes when the transfer is complete
Sourcefn execute_remote_onboard(
&self,
src: RemoteDescriptor,
dst: LogicalLayoutHandle,
dst_block_ids: Arc<[BlockId]>,
options: TransferOptions,
) -> Result<TransferCompleteNotification>
fn execute_remote_onboard( &self, src: RemoteDescriptor, dst: LogicalLayoutHandle, dst_block_ids: Arc<[BlockId]>, options: TransferOptions, ) -> Result<TransferCompleteNotification>
Execute a remote transfer from a remote layout to a local logical layout.
This represents a NIXL transfer.
§Arguments
src- Remote sources can take several forms, seeRemoteDescriptordst- The destination layout handledst_block_ids- The destination block IDsoptions- Transfer options (layer range, bounce buffers, etc.)
§Returns
A future that completes when the transfer is complete
Sourcefn execute_remote_offload(
&self,
src: LogicalLayoutHandle,
src_block_ids: Arc<[BlockId]>,
dst: RemoteDescriptor,
options: TransferOptions,
) -> Result<TransferCompleteNotification>
fn execute_remote_offload( &self, src: LogicalLayoutHandle, src_block_ids: Arc<[BlockId]>, dst: RemoteDescriptor, options: TransferOptions, ) -> Result<TransferCompleteNotification>
Execute a remote offload from a local logical layout to a remote descriptor.
This represents a NIXL offload.
§Arguments
src- The source layout handledst- The destination remote descriptorsrc_block_ids- The source block IDsoptions- Transfer options (layer range, bounce buffers, etc.)
§Returns
A future that completes when the offload is complete
Sourcefn connect_remote(
&self,
instance_id: InstanceId,
metadata: Vec<SerializedLayout>,
) -> Result<ConnectRemoteResponse>
fn connect_remote( &self, instance_id: InstanceId, metadata: Vec<SerializedLayout>, ) -> Result<ConnectRemoteResponse>
Connect to a remote instance by importing its metadata and storing handle mappings.
This method stores the handle mappings internally for later use by
execute_remote_onboard_for_instance. The metadata is also imported into
the underlying transfer manager so NIXL knows about the remote.
§Arguments
instance_id- The unique identifier of the remote instancemetadata- Serialized layout metadata from the remote instance. For DirectWorker, expects exactly 1 element. For ReplicatedWorker, expects one element per worker (in rank order).
§Returns
A response that completes when the metadata has been imported and mappings stored.
Sourcefn has_remote_metadata(&self, instance_id: InstanceId) -> bool
fn has_remote_metadata(&self, instance_id: InstanceId) -> bool
Check if remote metadata has been imported for an instance.
Returns true if connect_remote has been successfully called for this instance.
Sourcefn execute_remote_onboard_for_instance(
&self,
instance_id: InstanceId,
remote_logical_type: LogicalLayoutHandle,
src_block_ids: Vec<BlockId>,
dst: LogicalLayoutHandle,
dst_block_ids: Arc<[BlockId]>,
options: TransferOptions,
) -> Result<TransferCompleteNotification>
fn execute_remote_onboard_for_instance( &self, instance_id: InstanceId, remote_logical_type: LogicalLayoutHandle, src_block_ids: Vec<BlockId>, dst: LogicalLayoutHandle, dst_block_ids: Arc<[BlockId]>, options: TransferOptions, ) -> Result<TransferCompleteNotification>
Execute a remote onboard transfer using stored handle mapping.
This method looks up the remote handle from the stored mapping
(established via connect_remote) and executes the transfer.
§Arguments
instance_id- The remote instance to pull fromremote_logical_type- The logical layout type on the remote (e.g., G2)src_block_ids- Block IDs on the remote to pulldst- Local destination logical layoutdst_block_ids- Local destination block IDsoptions- Transfer options
§Errors
Returns error if remote metadata hasn’t been imported for this instance.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".