pub struct Buffer { /* private fields */ }Expand description
An array stored on a device.
Buffers are created by Client::buffer_from_host and by executing a
LoadedExecutable.
Implementations§
Source§impl Buffer
impl Buffer
Sourcepub fn is_deleted(&self) -> Result<bool>
pub fn is_deleted(&self) -> Result<bool>
Returns whether the buffer was deleted (donated to an execution).
§Errors
Returns an error if the plugin fails to report it.
Sourcepub fn element_type(&self) -> Result<ElementType>
pub fn element_type(&self) -> Result<ElementType>
Sourcepub fn to_bytes(&self) -> Result<Vec<u8>>
pub fn to_bytes(&self) -> Result<Vec<u8>>
Copies the contents to the host as raw bytes in row-major order.
§Errors
Returns an error if the transfer fails.
Sourcepub fn to_host_array(&self) -> Result<HostArray>
pub fn to_host_array(&self) -> Result<HostArray>
Copies the contents to a host array.
§Errors
Returns an error if the element type has no ruxla dtype, or if the transfer fails.
Trait Implementations§
impl Send for Buffer
impl Sync for Buffer
Auto Trait Implementations§
impl Freeze for Buffer
impl RefUnwindSafe for Buffer
impl Unpin for Buffer
impl UnsafeUnpin for Buffer
impl UnwindSafe for Buffer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more