pub struct BufferView<'a, U: Copy> { /* private fields */ }Expand description
An immutable, type-reinterpreted view into a DeviceBuffer.
This struct borrows the underlying device allocation and exposes it
as a different element type U. No data is copied; only the
pointer arithmetic changes.
The view is lifetime-bound to the original buffer, preventing use after the buffer is freed.
Implementations§
Source§impl<U: Copy> BufferView<'_, U>
impl<U: Copy> BufferView<'_, U>
Sourcepub fn as_device_ptr(&self) -> CUdeviceptr
pub fn as_device_ptr(&self) -> CUdeviceptr
Returns the raw CUdeviceptr for this view.
Trait Implementations§
Auto Trait Implementations§
impl<'a, U> Freeze for BufferView<'a, U>
impl<'a, U> RefUnwindSafe for BufferView<'a, U>where
U: RefUnwindSafe,
impl<'a, U> Send for BufferView<'a, U>where
U: Sync,
impl<'a, U> Sync for BufferView<'a, U>where
U: Sync,
impl<'a, U> Unpin for BufferView<'a, U>
impl<'a, U> UnsafeUnpin for BufferView<'a, U>
impl<'a, U> UnwindSafe for BufferView<'a, U>where
U: RefUnwindSafe,
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