pub struct FencePool { /* private fields */ }Expand description
A pool of reusable GPU fence objects.
Manages fence lifecycle to avoid repeated allocation/deallocation overhead.
Implementations§
Source§impl FencePool
impl FencePool
Sourcepub fn with_config(config: FencePoolConfig) -> Self
pub fn with_config(config: FencePoolConfig) -> Self
Create a new fence pool with the given configuration.
Sourcepub fn acquire(&mut self) -> Option<FenceId>
pub fn acquire(&mut self) -> Option<FenceId>
Acquire a fence from the pool. Returns None if no fences are available
and auto-grow is disabled or the pool is at maximum size.
Sourcepub fn status(&self, id: FenceId) -> Option<FenceStatus>
pub fn status(&self, id: FenceId) -> Option<FenceStatus>
Get the current status of a fence.
Sourcepub fn pending_fences(&self) -> Vec<FenceId>
pub fn pending_fences(&self) -> Vec<FenceId>
Return all currently pending fence IDs.
Sourcepub fn total_count(&self) -> usize
pub fn total_count(&self) -> usize
Return the total number of fences in the pool.
Sourcepub fn available_count(&self) -> usize
pub fn available_count(&self) -> usize
Return the number of available fences.
Sourcepub fn stats(&self) -> FencePoolStats
pub fn stats(&self) -> FencePoolStats
Compute pool statistics.
Sourcepub fn wait_timeout(&self) -> Duration
pub fn wait_timeout(&self) -> Duration
Return the wait timeout configured for this pool.
Sourcepub fn has_available(&self) -> bool
pub fn has_available(&self) -> bool
Check whether the pool has fences available without growing.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for FencePool
impl RefUnwindSafe for FencePool
impl Send for FencePool
impl Sync for FencePool
impl Unpin for FencePool
impl UnsafeUnpin for FencePool
impl UnwindSafe for FencePool
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