pub struct TagTracker { /* private fields */ }Expand description
Tracks which tags are present on an entity.
Implementations§
Source§impl TagTracker
impl TagTracker
Sourcepub unsafe fn tag<T>(&mut self)where
T: Tag,
pub unsafe fn tag<T>(&mut self)where
T: Tag,
Set this Tag as present.
§Safety
The caller must ensure that:
- The tag is registered.
- No other
TagTrackers of the same entity are being accessed.
Sourcepub unsafe fn untag<T>(&mut self)where
T: Tag,
pub unsafe fn untag<T>(&mut self)where
T: Tag,
Set this Tag as not present.
§Safety
The caller must ensure that:
- The tag is registered.
- No other
TagTrackers of the same entity are being accessed.
Sourcepub unsafe fn toggle_unchecked<T>(&mut self)where
T: Tag,
pub unsafe fn toggle_unchecked<T>(&mut self)where
T: Tag,
Toggle this Tag. (If it is present, remove it; if it is not present, add it.)
§Safety
The caller must ensure that:
- The tag is registered.
- No other
TagTrackers of the same entity are being accessed.
Sourcepub fn is_tag_registered<T>(&self) -> boolwhere
T: Tag,
pub fn is_tag_registered<T>(&self) -> boolwhere
T: Tag,
Check if this Tag is registered.
Sourcepub unsafe fn is_tagged<T>(&self) -> boolwhere
T: Tag,
pub unsafe fn is_tagged<T>(&self) -> boolwhere
T: Tag,
Check if this Tag is present in this tracker.
§Safety
The caller must ensure that:
- No other
TagTrackers of the same entity are being mutated.
Sourcepub unsafe fn is_tagged_unchecked<T>(&self) -> boolwhere
T: Tag,
pub unsafe fn is_tagged_unchecked<T>(&self) -> boolwhere
T: Tag,
Check if this Tag is present in this tracker, without checking whether it exists.
Sourcepub unsafe fn untag_all(&mut self)
pub unsafe fn untag_all(&mut self)
Remove all tags from this tracker.
§Safety
The caller must ensure that:
- No other
TagTrackers of the same entity are being accessed.
Trait Implementations§
Source§impl Clone for TagTracker
impl Clone for TagTracker
Source§fn clone(&self) -> TagTracker
fn clone(&self) -> TagTracker
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TagTracker
impl RefUnwindSafe for TagTracker
impl Send for TagTracker
impl Sync for TagTracker
impl Unpin for TagTracker
impl UnwindSafe for TagTracker
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