Struct fyrox_core::pool::Handle

source ·
pub struct Handle<T> { /* private fields */ }
Expand description

Handle is some sort of non-owning reference to content in a pool. It stores index of object and additional information that allows to ensure that handle is still valid (points to the same object as when handle was created).

Implementations§

source§

impl<T> Handle<T>

source

pub const INDEX: &'static str = "index"

source

pub const GENERATION: &'static str = "generation"

source§

impl<T> Handle<T>

source

pub const NONE: Handle<T> = _

source

pub fn is_none(self) -> bool

source

pub fn is_some(self) -> bool

source

pub fn index(self) -> u32

source

pub fn generation(self) -> u32

source

pub fn new(index: u32, generation: u32) -> Self

source

pub fn transmute<U>(&self) -> Handle<U>

source

pub fn decode_from_u128(num: u128) -> Self

source

pub fn encode_to_u128(&self) -> u128

Trait Implementations§

source§

impl<T> Clone for Handle<T>

source§

fn clone(&self) -> Handle<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T> Debug for Handle<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T> Default for Handle<T>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'de, T> Deserialize<'de> for Handle<T>

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<T> Display for Handle<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T> From<AtomicHandle> for Handle<T>

source§

fn from(atomic_handle: AtomicHandle) -> Self

Converts to this type from the input type.
source§

impl<T> From<ErasedHandle> for Handle<T>

source§

fn from(erased_handle: ErasedHandle) -> Self

Converts to this type from the input type.
source§

impl<T> From<Handle<T>> for ErasedHandle

source§

fn from(h: Handle<T>) -> Self

Converts to this type from the input type.
source§

impl<T> Hash for Handle<T>

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<T, P> Index<Handle<T>> for Pool<T, P>
where T: 'static, P: PayloadContainer<Element = T> + 'static,

§

type Output = T

The returned type after indexing.
source§

fn index(&self, index: Handle<T>) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
source§

impl<T, P> IndexMut<Handle<T>> for Pool<T, P>
where T: 'static, P: PayloadContainer<Element = T> + 'static,

source§

fn index_mut(&mut self, index: Handle<T>) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
source§

impl<T> Ord for Handle<T>

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl<T> PartialEq for Handle<T>

source§

fn eq(&self, other: &Handle<T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T> PartialOrd for Handle<T>

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

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

fn lt(&self, other: &Rhs) -> bool

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

fn le(&self, other: &Rhs) -> bool

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

fn gt(&self, other: &Rhs) -> bool

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

fn ge(&self, other: &Rhs) -> bool

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

impl<T> Reflect for Handle<T>
where Self: 'static, u32: Reflect,

source§

fn type_name(&self) -> &'static str

source§

fn doc(&self) -> &'static str

source§

fn fields_info(&self, func: &mut dyn FnMut(&[FieldInfo<'_, '_>]))

source§

fn into_any(self: Box<Self>) -> Box<dyn Any>

source§

fn set( &mut self, value: Box<dyn Reflect> ) -> Result<Box<dyn Reflect>, Box<dyn Reflect>>

source§

fn as_any(&self, func: &mut dyn FnMut(&dyn Any))

source§

fn as_any_mut(&mut self, func: &mut dyn FnMut(&mut dyn Any))

source§

fn as_reflect(&self, func: &mut dyn FnMut(&dyn Reflect))

source§

fn as_reflect_mut(&mut self, func: &mut dyn FnMut(&mut dyn Reflect))

source§

fn fields(&self, func: &mut dyn FnMut(&[&dyn Reflect]))

source§

fn fields_mut(&mut self, func: &mut dyn FnMut(&mut [&mut dyn Reflect]))

source§

fn field(&self, name: &str, func: &mut dyn FnMut(Option<&dyn Reflect>))

source§

fn field_mut( &mut self, name: &str, func: &mut dyn FnMut(Option<&mut dyn Reflect>) )

source§

fn set_field( &mut self, field: &str, value: Box<dyn Reflect>, func: &mut dyn FnMut(Result<Box<dyn Reflect>, Box<dyn Reflect>>) )

Calls user method specified with #[reflect(setter = ..)] or falls back to Reflect::field_mut
source§

fn as_array(&self, func: &mut dyn FnMut(Option<&dyn ReflectArray>))

source§

fn as_array_mut(&mut self, func: &mut dyn FnMut(Option<&mut dyn ReflectArray>))

source§

fn as_list(&self, func: &mut dyn FnMut(Option<&dyn ReflectList>))

source§

fn as_list_mut(&mut self, func: &mut dyn FnMut(Option<&mut dyn ReflectList>))

source§

fn as_inheritable_variable( &self, func: &mut dyn FnMut(Option<&dyn ReflectInheritableVariable>) )

source§

fn as_inheritable_variable_mut( &mut self, func: &mut dyn FnMut(Option<&mut dyn ReflectInheritableVariable>) )

source§

fn as_hash_map(&self, func: &mut dyn FnMut(Option<&dyn ReflectHashMap>))

source§

fn as_hash_map_mut( &mut self, func: &mut dyn FnMut(Option<&mut dyn ReflectHashMap>) )

source§

impl<T> Serialize for Handle<T>

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<T: TypeUuidProvider> TypeUuidProvider for Handle<T>

source§

fn type_uuid() -> Uuid

Return type UUID.
source§

impl<T> Visit for Handle<T>

source§

fn visit(&mut self, name: &str, visitor: &mut Visitor) -> VisitResult

source§

impl<T> Copy for Handle<T>

source§

impl<T> Eq for Handle<T>

source§

impl<T> Send for Handle<T>

source§

impl<T> Sync for Handle<T>

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for Handle<T>
where T: RefUnwindSafe,

§

impl<T> Unpin for Handle<T>
where T: Unpin,

§

impl<T> UnwindSafe for Handle<T>
where T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> FieldValue for T
where T: 'static,

source§

fn as_any(&self) -> &(dyn Any + 'static)

Casts self to a &dyn Any
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<R> GetField for R
where R: Reflect,

source§

fn get_field<T>(&self, name: &str, func: &mut dyn FnMut(Option<&T>))
where T: 'static,

source§

fn get_field_mut<T>(&mut self, name: &str, func: &mut dyn FnMut(Option<&mut T>))
where T: 'static,

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ResolvePath for T
where T: Reflect,

source§

fn resolve_path<'p>( &self, path: &'p str, func: &mut dyn FnMut(Result<&(dyn Reflect + 'static), ReflectPathError<'p>>) )

source§

fn resolve_path_mut<'p>( &mut self, path: &'p str, func: &mut dyn FnMut(Result<&mut (dyn Reflect + 'static), ReflectPathError<'p>>) )

source§

fn get_resolve_path<'p, T: Reflect>( &self, path: &'p str, func: &mut dyn FnMut(Result<&T, ReflectPathError<'p>>) )

source§

fn get_resolve_path_mut<'p, T: Reflect>( &mut self, path: &'p str, func: &mut dyn FnMut(Result<&mut T, ReflectPathError<'p>>) )

source§

impl<T> Same for T

§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,