ServerCommunication

Trait ServerCommunication 

Source
pub trait ServerCommunication {
    const SERVER_COMM_ENABLED: bool;

    // Provided method
    fn copy(
        server_src: &mut Self,
        server_dst: &mut Self,
        src: CopyDescriptor<'_>,
        stream_id_src: StreamId,
        stream_id_dst: StreamId,
    ) -> Result<Allocation, IoError> { ... }
}
Expand description

Defines functions for optimized data transfer between servers, supporting custom communication mechanisms such as peer-to-peer communication or specialized implementations.

Required Associated Constants§

Source

const SERVER_COMM_ENABLED: bool

Indicates whether server-to-server communication is enabled for this implementation.

Provided Methods§

Source

fn copy( server_src: &mut Self, server_dst: &mut Self, src: CopyDescriptor<'_>, stream_id_src: StreamId, stream_id_dst: StreamId, ) -> Result<Allocation, IoError>

Copies data from a source server to a destination server.

§Arguments
  • server_src - A mutable reference to the source server from which data is copied.
  • server_dst - A mutable reference to the destination server receiving the data.
  • src - A descriptor specifying the data to be copied, including shape, strides, and binding.
  • stream_id_src - The stream ID associated with the source server’s operation.
  • stream_id_dst - The stream ID associated with the destination server’s operation.
§Returns

Returns a Result containing an Allocation on success, or an IoError if the operation fails.

§Panics

Panics if server communication is not enabled (SERVER_COMM_ENABLED is false) or if the trait is incorrectly implemented by the server.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§