Skip to main content

Buffer

Trait Buffer 

Source
pub trait Buffer<'a, N: Num>: Sized {
    // Required methods
    fn to_device(&mut self, src: &[N]) -> Result<()>;
    fn to_host(&self, dst: &mut [N]) -> Result<()>;
}
Expand description

A device-side memory buffer holding elements of dtype N.

Required Methods§

Source

fn to_device(&mut self, src: &[N]) -> Result<()>

Copy elements from a host slice into this device buffer. The slice length must not exceed the buffer’s allocated element count.

Source

fn to_host(&self, dst: &mut [N]) -> Result<()>

Copy elements from this device buffer into a host slice. The slice length must not exceed the buffer’s allocated element count.

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§