pub struct CpuBufferPoolSubbuffer<T, A> where
[T]: BufferContents,
A: MemoryPool, { /* private fields */ }
Expand description
A subbuffer allocated from a CpuBufferPool
.
When this object is destroyed, the subbuffer is automatically reclaimed by the pool.
Trait Implementations
sourceimpl<T, A> BufferAccess for CpuBufferPoolSubbuffer<T, A> where
T: Send + Sync,
[T]: BufferContents,
A: MemoryPool,
impl<T, A> BufferAccess for CpuBufferPoolSubbuffer<T, A> where
T: Send + Sync,
[T]: BufferContents,
A: MemoryPool,
sourcefn inner(&self) -> BufferInner<'_>
fn inner(&self) -> BufferInner<'_>
Returns the inner information about this buffer.
sourcefn size(&self) -> DeviceSize
fn size(&self) -> DeviceSize
Returns the size of the buffer in bytes.
sourcefn conflict_key(&self) -> (u64, u64)
fn conflict_key(&self) -> (u64, u64)
Returns a key that uniquely identifies the buffer. Two buffers or images that potentially overlap in memory must return the same key. Read more
sourcefn try_gpu_lock(&self, e: bool, q: &Queue) -> Result<(), AccessError>
fn try_gpu_lock(&self, e: bool, q: &Queue) -> Result<(), AccessError>
Locks the resource for usage on the GPU. Returns an error if the lock can’t be acquired. Read more
sourceunsafe fn increase_gpu_lock(&self)
unsafe fn increase_gpu_lock(&self)
Locks the resource for usage on the GPU. Supposes that the resource is already locked, and simply increases the lock by one. Read more
sourceunsafe fn unlock(&self)
unsafe fn unlock(&self)
Unlocks the resource previously acquired with try_gpu_lock
or increase_gpu_lock
. Read more
sourcefn into_buffer_slice(self: &Arc<Self>) -> Arc<BufferSlice<Self::Content, Self>> where
Self: Sized + TypedBufferAccess,
fn into_buffer_slice(self: &Arc<Self>) -> Arc<BufferSlice<Self::Content, Self>> where
Self: Sized + TypedBufferAccess,
Returns a BufferSlice
covering the whole buffer.
sourcefn slice<T>(
self: &Arc<Self>,
range: Range<DeviceSize>
) -> Option<Arc<BufferSlice<[T], Self>>> where
Self: Sized + TypedBufferAccess<Content = [T]>,
fn slice<T>(
self: &Arc<Self>,
range: Range<DeviceSize>
) -> Option<Arc<BufferSlice<[T], Self>>> where
Self: Sized + TypedBufferAccess<Content = [T]>,
Returns a BufferSlice
for a subrange of elements in the buffer. Returns None
if
out of range. Read more
sourcefn index<T>(
self: &Arc<Self>,
index: DeviceSize
) -> Option<Arc<BufferSlice<T, Self>>> where
Self: Sized + TypedBufferAccess<Content = [T]>,
fn index<T>(
self: &Arc<Self>,
index: DeviceSize
) -> Option<Arc<BufferSlice<T, Self>>> where
Self: Sized + TypedBufferAccess<Content = [T]>,
Returns a BufferSlice
for a single element in the buffer. Returns None
if out of range. Read more
sourcefn raw_device_address(&self) -> Result<NonZeroU64, BufferDeviceAddressError>
fn raw_device_address(&self) -> Result<NonZeroU64, BufferDeviceAddressError>
Gets the device address for this buffer. Read more
sourceimpl<T, A> Clone for CpuBufferPoolSubbuffer<T, A> where
[T]: BufferContents,
A: MemoryPool,
impl<T, A> Clone for CpuBufferPoolSubbuffer<T, A> where
[T]: BufferContents,
A: MemoryPool,
sourcefn clone(&self) -> CpuBufferPoolSubbuffer<T, A>
fn clone(&self) -> CpuBufferPoolSubbuffer<T, A>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<T, A> DeviceOwned for CpuBufferPoolSubbuffer<T, A> where
[T]: BufferContents,
A: MemoryPool,
impl<T, A> DeviceOwned for CpuBufferPoolSubbuffer<T, A> where
[T]: BufferContents,
A: MemoryPool,
sourceimpl<T, A> Hash for CpuBufferPoolSubbuffer<T, A> where
T: Send + Sync,
[T]: BufferContents,
A: MemoryPool,
impl<T, A> Hash for CpuBufferPoolSubbuffer<T, A> where
T: Send + Sync,
[T]: BufferContents,
A: MemoryPool,
sourceimpl<T, A> PartialEq<CpuBufferPoolSubbuffer<T, A>> for CpuBufferPoolSubbuffer<T, A> where
T: Send + Sync,
[T]: BufferContents,
A: MemoryPool,
impl<T, A> PartialEq<CpuBufferPoolSubbuffer<T, A>> for CpuBufferPoolSubbuffer<T, A> where
T: Send + Sync,
[T]: BufferContents,
A: MemoryPool,
sourceimpl<T, A> TypedBufferAccess for CpuBufferPoolSubbuffer<T, A> where
T: BufferContents,
[T]: BufferContents,
A: MemoryPool,
impl<T, A> TypedBufferAccess for CpuBufferPoolSubbuffer<T, A> where
T: BufferContents,
[T]: BufferContents,
A: MemoryPool,
type Content = T
type Content = T
The type of the content.
sourcefn len(&self) -> DeviceSize
fn len(&self) -> DeviceSize
Returns the length of the buffer in number of elements. Read more
impl<T, A> Eq for CpuBufferPoolSubbuffer<T, A> where
T: Send + Sync,
[T]: BufferContents,
A: MemoryPool,
Auto Trait Implementations
impl<T, A> RefUnwindSafe for CpuBufferPoolSubbuffer<T, A> where
T: RefUnwindSafe,
<A as MemoryPool>::Alloc: RefUnwindSafe,
impl<T, A> Send for CpuBufferPoolSubbuffer<T, A> where
T: Send,
impl<T, A> Sync for CpuBufferPoolSubbuffer<T, A> where
T: Sync,
impl<T, A> Unpin for CpuBufferPoolSubbuffer<T, A>
impl<T, A> UnwindSafe for CpuBufferPoolSubbuffer<T, A> where
T: UnwindSafe,
<A as MemoryPool>::Alloc: RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more