pub(crate) struct QuerySetTracker {
metadata: ResourceMetadata<Arc<QuerySet>>,
size: usize,
}Expand description
A tracker that holds tracks QuerySets.
This is mostly a safe shell around ResourceMetadata
Fields§
§metadata: ResourceMetadata<Arc<QuerySet>>§size: usizeImplementations§
Source§impl QuerySetTracker
impl QuerySetTracker
pub fn new() -> Self
Sourcepub fn insert_single(&mut self, resource: Arc<QuerySet>) -> &Arc<QuerySet>
pub fn insert_single(&mut self, resource: Arc<QuerySet>) -> &Arc<QuerySet>
Inserts a single resource into the resource tracker.
Returns a reference to the newly inserted resource. (This allows avoiding a clone/reference count increase in many cases.)
Sourcepub fn set_size(&mut self, size: usize)
pub fn set_size(&mut self, size: usize)
Sets the size of all the vectors inside the tracker.
Must be called with the highest possible Texture ID before all unsafe functions are called.
Sourcefn allow_index(&mut self, index: usize)
fn allow_index(&mut self, index: usize)
Extend the vectors to let the given index be valid.
Sourcepub fn contains(&self, query_set: &QuerySet) -> bool
pub fn contains(&self, query_set: &QuerySet) -> bool
Returns true if the tracker owns the given query set.
pub fn used_resources(&self) -> impl Iterator<Item = &Arc<QuerySet>>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for QuerySetTracker
impl !RefUnwindSafe for QuerySetTracker
impl Send for QuerySetTracker
impl Sync for QuerySetTracker
impl Unpin for QuerySetTracker
impl !UnwindSafe for QuerySetTracker
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