pub struct LayerHandle { /* private fields */ }Expand description
Opaque, generation-tagged identity for a scene layer.
The scene recycles table slots, so a bare index would let a handle to a
removed layer address whatever took its place. The generation counter makes
that impossible: a stale handle no longer matches, and
layer returns None.
Implementations§
Source§impl LayerHandle
impl LayerHandle
Sourcepub const fn is_valid(self) -> bool
pub const fn is_valid(self) -> bool
Whether this is not the default sentinel.
Says nothing about liveness — a valid handle can still be stale. Resolve
with LayerScene::layer.
Trait Implementations§
Source§impl Clone for LayerHandle
impl Clone for LayerHandle
impl Copy for LayerHandle
Source§impl Debug for LayerHandle
impl Debug for LayerHandle
Source§impl Default for LayerHandle
impl Default for LayerHandle
impl Eq for LayerHandle
Source§impl From<LayerHandle> for LayerId
impl From<LayerHandle> for LayerId
Source§fn from(handle: LayerHandle) -> Self
fn from(handle: LayerHandle) -> Self
The same packing LayerHandle::layer_id does.
Here as well so anything taking a layer’s identity can accept either, which is what lets a report be queried with a handle by a caller and with a bare id by a test that has no scene to get a handle from.
Source§impl Hash for LayerHandle
impl Hash for LayerHandle
Source§impl Ord for LayerHandle
impl Ord for LayerHandle
1.21.0 (const: unstable) · 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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for LayerHandle
impl PartialEq for LayerHandle
Source§impl PartialOrd for LayerHandle
impl PartialOrd for LayerHandle
impl StructuralPartialEq for LayerHandle
Auto Trait Implementations§
impl Freeze for LayerHandle
impl RefUnwindSafe for LayerHandle
impl Send for LayerHandle
impl Sync for LayerHandle
impl Unpin for LayerHandle
impl UnsafeUnpin for LayerHandle
impl UnwindSafe for LayerHandle
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