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]

[src]

Constructs a new Handle.

[src]

Constructs a nil/uninitialized Handle.

[src]

Returns true if this Handle has been initialized.

[src]

Invalidate this Handle to default value.

[src]

Returns index value.

[src]

Returns version value.

Trait Implementations

impl Debug for Handle
[src]

[src]

Formats the value using the given formatter.

impl Default for Handle
[src]

[src]

Returns the "default value" for a type. Read more

impl Clone for Handle
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Copy for Handle
[src]

impl PartialEq for Handle
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl Eq for Handle
[src]

impl PartialOrd for Handle
[src]

[src]

This method returns an ordering between self and other values if one exists. Read more

[src]

This method tests less than (for self and other) and is used by the < operator. Read more

[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

[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]

[src]

This method returns an Ordering between self and other. Read more

1.22.0
[src]

Compares and returns the maximum of two values. Read more

1.22.0
[src]

Compares and returns the minimum of two values. Read more

impl Hash for Handle
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl Deref for Handle
[src]

The resulting type after dereferencing.

[src]

Dereferences the value.

impl Borrow<HandleIndex> for Handle
[src]

[src]

Immutably borrows from an owned value. Read more

impl<'a> Borrow<HandleIndex> for &'a Handle
[src]

[src]

Immutably borrows from an owned value. Read more

impl From<SurfaceHandle> for Handle
[src]

[src]

Performs the conversion.

impl From<FrameBufferHandle> for Handle
[src]

[src]

Performs the conversion.

impl From<ShaderHandle> for Handle
[src]

[src]

Performs the conversion.

impl From<TextureHandle> for Handle
[src]

[src]

Performs the conversion.

impl From<RenderBufferHandle> for Handle
[src]

[src]

Performs the conversion.

impl From<IndexBufferHandle> for Handle
[src]

[src]

Performs the conversion.

impl From<VertexBufferHandle> for Handle
[src]

[src]

Performs the conversion.