Struct crayon::utils::handle::Handle
[−]
[src]
pub struct Handle { /* fields omitted */ }
Handle
is made up of two field, index
and version
. index
are
usually used to indicated address into some kind of space. This value
is recycled when an Handle
is freed to save address. However, this
means that you could end up with two different Handle
with identical
indices. We solve this by introducing version
.
Methods
impl Handle
[src]
fn new(index: HandleIndex, version: HandleIndex) -> Self
[src]
Constructs a new Handle
.
fn nil() -> Self
[src]
Constructs a nil/uninitialized Handle
.
fn is_valid(&self) -> bool
[src]
Returns true if this Handle
has been initialized.
fn invalidate(&mut self)
[src]
Invalidate this Handle
to default value.
fn index(&self) -> HandleIndex
[src]
Returns index value.
fn version(&self) -> HandleIndex
[src]
Returns version value.
Trait Implementations
impl Debug for Handle
[src]
impl Default for Handle
[src]
impl Clone for Handle
[src]
fn clone(&self) -> Handle
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Copy for Handle
[src]
impl PartialEq for Handle
[src]
fn eq(&self, __arg_0: &Handle) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Handle) -> bool
[src]
This method tests for !=
.
impl Eq for Handle
[src]
impl PartialOrd for Handle
[src]
fn partial_cmp(&self, __arg_0: &Handle) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &Handle) -> bool
[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &Handle) -> bool
[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &Handle) -> bool
[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &Handle) -> bool
[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for Handle
[src]
fn cmp(&self, __arg_0: &Handle) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.22.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.22.0[src]
Compares and returns the minimum of two values. Read more
impl Hash for Handle
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Deref for Handle
[src]
type Target = HandleIndex
The resulting type after dereferencing.
fn deref(&self) -> &HandleIndex
[src]
Dereferences the value.
impl Borrow<HandleIndex> for Handle
[src]
fn borrow(&self) -> &HandleIndex
[src]
Immutably borrows from an owned value. Read more
impl<'a> Borrow<HandleIndex> for &'a Handle
[src]
fn borrow(&self) -> &HandleIndex
[src]
Immutably borrows from an owned value. Read more
impl From<SurfaceHandle> for Handle
[src]
fn from(handle: SurfaceHandle) -> Self
[src]
Performs the conversion.
impl From<FrameBufferHandle> for Handle
[src]
fn from(handle: FrameBufferHandle) -> Self
[src]
Performs the conversion.
impl From<ShaderHandle> for Handle
[src]
fn from(handle: ShaderHandle) -> Self
[src]
Performs the conversion.
impl From<TextureHandle> for Handle
[src]
fn from(handle: TextureHandle) -> Self
[src]
Performs the conversion.
impl From<RenderBufferHandle> for Handle
[src]
fn from(handle: RenderBufferHandle) -> Self
[src]
Performs the conversion.
impl From<IndexBufferHandle> for Handle
[src]
fn from(handle: IndexBufferHandle) -> Self
[src]
Performs the conversion.
impl From<VertexBufferHandle> for Handle
[src]
fn from(handle: VertexBufferHandle) -> Self
[src]
Performs the conversion.