enum BufferOwnership {
Managed(Mutex<BufferMemoryBacking>),
RawHandle,
External(DropGuard),
}Available on
vulkan only.Expand description
Describes who owns a Buffer’s vk::Buffer handle and its backing memory,
and therefore what cleanup is required when the buffer is destroyed.
Variants§
Managed(Mutex<BufferMemoryBacking>)
wgpu-hal owns the vk::Buffer and its backing memory. On cleanup the buffer
handle is destroyed and the memory is released.
RawHandle
wgpu-hal owns the vk::Buffer handle but the backing memory is kept alive
by the caller. On cleanup only the buffer handle is destroyed.
External(DropGuard)
Caller owns the vk::Buffer and its backing memory. On cleanup the
crate::DropGuard runs the caller’s cleanup callback and wgpu-hal touches
neither the handle nor the memory.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for BufferOwnership
impl !RefUnwindSafe for BufferOwnership
impl Send for BufferOwnership
impl Sync for BufferOwnership
impl Unpin for BufferOwnership
impl !UnwindSafe for BufferOwnership
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more