pub trait AsyncCopy {
// Required methods
unsafe fn issue(
&mut self,
src: *const u8,
dst: *mut u8,
bytes: usize,
) -> BarrierToken;
fn wait(&mut self, token: BarrierToken);
}Expand description
Pluggable async-copy engine. Backends (SyncCopy for CPU,
future MetalBlitCopy for GPU) implement this.
Required Methods§
Sourceunsafe fn issue(
&mut self,
src: *const u8,
dst: *mut u8,
bytes: usize,
) -> BarrierToken
unsafe fn issue( &mut self, src: *const u8, dst: *mut u8, bytes: usize, ) -> BarrierToken
Schedule a bytes-byte copy from src to dst. Returns a
token usable with Self::wait.
§Safety
src valid for read, dst valid for write, bytes doesn’t
overflow either region. Caller ensures src and dst don’t
alias unless that’s intentional.
Sourcefn wait(&mut self, token: BarrierToken)
fn wait(&mut self, token: BarrierToken)
Block until the copy referred to by token has completed.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".