Skip to main content

TransferBackend

Trait TransferBackend 

Source
pub trait TransferBackend: SubmissionBackend + ParameterBackend {
    type HostBuffer;
    type Transfer: Completion<Error = Self::TransferError>;
    type TransferError: Error + Send + Sync + 'static;

    // Required methods
    fn promote(
        executor: &Self::Executor,
        host: &Self::HostBuffer,
    ) -> Result<(Self::MaterializedWeight, Self::Transfer), Self::TransferError>;
    fn demote(
        executor: &Self::Executor,
        weight: &Self::MaterializedWeight,
    ) -> Result<(Self::HostBuffer, Self::Transfer), Self::TransferError>;
}
Expand description

Promotes and demotes backend-native storage without changing its semantics.

Required Associated Types§

Source

type HostBuffer

Backend-owned host representation.

Source

type Transfer: Completion<Error = Self::TransferError>

In-flight transfer guard retaining all source and destination storage.

Source

type TransferError: Error + Send + Sync + 'static

Backend-specific transfer failure.

Required Methods§

Source

fn promote( executor: &Self::Executor, host: &Self::HostBuffer, ) -> Result<(Self::MaterializedWeight, Self::Transfer), Self::TransferError>

Promotes host storage into a materialized execution weight.

Source

fn demote( executor: &Self::Executor, weight: &Self::MaterializedWeight, ) -> Result<(Self::HostBuffer, Self::Transfer), Self::TransferError>

Demotes a materialized execution weight into backend-owned host storage.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§