pub struct GpuSemaphore { /* private fields */ }Expand description
Semaphore for controlling concurrent GPU access
Implementations§
Source§impl GpuSemaphore
impl GpuSemaphore
Sourcepub async fn acquire(&self) -> Result<SemaphoreGuard<'_>>
pub async fn acquire(&self) -> Result<SemaphoreGuard<'_>>
Acquire a permit
Sourcepub fn try_acquire(&self) -> Option<SemaphoreGuard<'_>>
pub fn try_acquire(&self) -> Option<SemaphoreGuard<'_>>
Try to acquire a permit without waiting
Sourcepub fn available_permits(&self) -> usize
pub fn available_permits(&self) -> usize
Get available permits
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GpuSemaphore
impl !RefUnwindSafe for GpuSemaphore
impl Send for GpuSemaphore
impl Sync for GpuSemaphore
impl Unpin for GpuSemaphore
impl UnsafeUnpin for GpuSemaphore
impl !UnwindSafe for GpuSemaphore
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