Struct froggy::Pointer [] [src]

pub struct Pointer<T> { /* fields omitted */ }

A pointer to a component of type T. The component is guaranteed to be accessible for as long as this pointer is alive. You'd need a storage to access the data.

Examples

// you can create pointer by creating component in storage
let ptr1 = storage.create(1i32);
// later you can change component in storage
storage[&ptr1] = 2i32;

Also you can use Storage::pin to pin component with Pointer

let item = storage.iter().next().unwrap();
let ptr2 = storage.pin(&item);
// Pointers to the same component are equal
assert_eq!(ptr1, ptr2);

Methods

impl<T> Pointer<T>
[src]

[src]

Creates a new WeakPointer to this component. See WeakPointer

Trait Implementations

impl<T> Debug for Pointer<T>
[src]

[src]

Formats the value using the given formatter.

impl<T> PartialOrd for Pointer<T>
[src]

[src]

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

1.0.0
[src]

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

1.0.0
[src]

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

1.0.0
[src]

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

1.0.0
[src]

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

impl<T> Clone for Pointer<T>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T> PartialEq for Pointer<T>
[src]

[src]

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

1.0.0
[src]

This method tests for !=.

impl<T> Eq for Pointer<T>
[src]

impl<T> Hash for Pointer<T>
[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<T> Drop for Pointer<T>
[src]

[src]

Executes the destructor for this type. Read more