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§
Sourcetype HostBuffer
type HostBuffer
Backend-owned host representation.
Sourcetype Transfer: Completion<Error = Self::TransferError>
type Transfer: Completion<Error = Self::TransferError>
In-flight transfer guard retaining all source and destination storage.
Sourcetype TransferError: Error + Send + Sync + 'static
type TransferError: Error + Send + Sync + 'static
Backend-specific transfer failure.
Required Methods§
Sourcefn promote(
executor: &Self::Executor,
host: &Self::HostBuffer,
) -> Result<(Self::MaterializedWeight, Self::Transfer), Self::TransferError>
fn promote( executor: &Self::Executor, host: &Self::HostBuffer, ) -> Result<(Self::MaterializedWeight, Self::Transfer), Self::TransferError>
Promotes host storage into a materialized execution weight.
Sourcefn demote(
executor: &Self::Executor,
weight: &Self::MaterializedWeight,
) -> Result<(Self::HostBuffer, Self::Transfer), Self::TransferError>
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".