pub struct ResourceLifecycle { /* private fields */ }Expand description
Tracks buffer lifecycle (creation, writes, reads) for debugging.
Implementations§
Source§impl ResourceLifecycle
impl ResourceLifecycle
Sourcepub fn record_create(&mut self, id: BufferId, size: usize)
pub fn record_create(&mut self, id: BufferId, size: usize)
Record a creation event.
Sourcepub fn record_write(&mut self, id: BufferId)
pub fn record_write(&mut self, id: BufferId)
Record a write event.
Sourcepub fn record_read(&mut self, id: BufferId)
pub fn record_read(&mut self, id: BufferId)
Record a read event.
Sourcepub fn record_destroy(&mut self, id: BufferId)
pub fn record_destroy(&mut self, id: BufferId)
Record a destroy event.
Sourcepub fn events(&self) -> &[ResourceEvent]
pub fn events(&self) -> &[ResourceEvent]
Return all events.
Sourcepub fn count_writes(&self, id: BufferId) -> usize
pub fn count_writes(&self, id: BufferId) -> usize
Count events of a specific type for a given buffer.
Sourcepub fn count_reads(&self, id: BufferId) -> usize
pub fn count_reads(&self, id: BufferId) -> usize
Count reads for a given buffer.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ResourceLifecycle
impl RefUnwindSafe for ResourceLifecycle
impl Send for ResourceLifecycle
impl Sync for ResourceLifecycle
impl Unpin for ResourceLifecycle
impl UnsafeUnpin for ResourceLifecycle
impl UnwindSafe for ResourceLifecycle
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