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]
fn downgrade(&self) -> WeakPointer<T>
[src]
Creates a new WeakPointer
to this component.
See WeakPointer
Trait Implementations
impl<T> Debug for Pointer<T>
[src]
impl<T> PartialOrd for Pointer<T>
[src]
fn partial_cmp(&self, other: &Pointer<T>) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
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]
fn clone(&self) -> Pointer<T>
[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<T> PartialEq for Pointer<T>
[src]
fn eq(&self, other: &Pointer<T>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<T> Eq for Pointer<T>
[src]
impl<T> Hash for Pointer<T>
[src]
fn hash<H: Hasher>(&self, state: &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