pub struct ResourceIndex(/* private fields */);Expand description
A unique resource identifier.
Resource index is composed of index(usize) and generation(u64). The generation is determined when the resource is registered to an ECS instance. The generation help us detect stale resource identifiers.
Implementations§
Source§impl ResourceIndex
impl ResourceIndex
Sourcepub const fn new(index: usize, generation: u64) -> Self
pub const fn new(index: usize, generation: u64) -> Self
Creates a new ResourceIndex with the given index and generation.
Sourcepub const fn dummy() -> Self
pub const fn dummy() -> Self
Creates a dummy ResourceIndex.
Sourcepub fn generation(&self) -> u64
pub fn generation(&self) -> u64
Returns inner generation.
Trait Implementations§
Source§impl Clone for ResourceIndex
impl Clone for ResourceIndex
Source§fn clone(&self) -> ResourceIndex
fn clone(&self) -> ResourceIndex
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 moreSource§impl Debug for ResourceIndex
impl Debug for ResourceIndex
Source§impl Default for ResourceIndex
impl Default for ResourceIndex
Source§impl Display for ResourceIndex
impl Display for ResourceIndex
Source§impl Hash for ResourceIndex
impl Hash for ResourceIndex
Source§impl Ord for ResourceIndex
impl Ord for ResourceIndex
Source§fn cmp(&self, other: &ResourceIndex) -> Ordering
fn cmp(&self, other: &ResourceIndex) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for ResourceIndex
impl PartialEq for ResourceIndex
Source§impl PartialOrd for ResourceIndex
impl PartialOrd for ResourceIndex
impl Copy for ResourceIndex
impl Eq for ResourceIndex
impl StructuralPartialEq for ResourceIndex
Auto Trait Implementations§
impl Freeze for ResourceIndex
impl RefUnwindSafe for ResourceIndex
impl Send for ResourceIndex
impl Sync for ResourceIndex
impl Unpin for ResourceIndex
impl UnwindSafe for ResourceIndex
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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