pub struct ReflectAllocationId { /* private fields */ }Expand description
A value allocated for scripts. Clones share the value, which is freed with the last of them.
Accesses to the value are claimed in the world’s access map under WorldAccessRange::External,
which holds the value alive until the claim is released, and in the value itself against other access maps.
Implementations§
Source§impl ReflectAllocationId
impl ReflectAllocationId
Sourcepub fn new<T>(value: T) -> ReflectAllocationIdwhere
T: PartialReflect,
pub fn new<T>(value: T) -> ReflectAllocationIdwhere
T: PartialReflect,
Allocates a value, in a single heap allocation together with its reference counts.
Sourcepub fn new_boxed(value: Box<dyn PartialReflect>) -> ReflectAllocationId
pub fn new_boxed(value: Box<dyn PartialReflect>) -> ReflectAllocationId
Allocates a value which is already boxed.
Sourcepub fn id(&self) -> usize
pub fn id(&self) -> usize
Returns the id of the allocation, unique while it’s alive: its address, the same id as its access key
Sourcepub fn get_ptr(&self) -> *mut dyn PartialReflect
pub fn get_ptr(&self) -> *mut dyn PartialReflect
Returns a pointer to the allocated value.
Creating references from it is only safe while holding the matching claim in the world’s access map, which also keeps the value alive.
Sourcepub fn strong_count(&self) -> usize
pub fn strong_count(&self) -> usize
Returns the number of ids pointing to this allocation, including the ones held by claims
Trait Implementations§
Source§impl Clone for ReflectAllocationId
impl Clone for ReflectAllocationId
Source§fn clone(&self) -> ReflectAllocationId
fn clone(&self) -> ReflectAllocationId
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl DebugWithTypeInfo for ReflectAllocationId
impl DebugWithTypeInfo for ReflectAllocationId
Source§fn to_string_with_type_info(
&self,
f: &mut Formatter<'_>,
type_info_provider: Option<&WorldAccessGuard<'_>>,
) -> Result<(), Error>
fn to_string_with_type_info( &self, f: &mut Formatter<'_>, type_info_provider: Option<&WorldAccessGuard<'_>>, ) -> Result<(), Error>
Source§impl Display for ReflectAllocationId
impl Display for ReflectAllocationId
Source§impl DisplayWithTypeInfo for ReflectAllocationId
impl DisplayWithTypeInfo for ReflectAllocationId
Source§fn display_with_type_info(
&self,
f: &mut Formatter<'_>,
_type_info_provider: Option<&WorldAccessGuard<'_>>,
) -> Result<(), Error>
fn display_with_type_info( &self, f: &mut Formatter<'_>, _type_info_provider: Option<&WorldAccessGuard<'_>>, ) -> Result<(), Error>
impl Eq for ReflectAllocationId
Source§impl From<&ReflectAllocationId> for WorldAccessRange
impl From<&ReflectAllocationId> for WorldAccessRange
Source§fn from(val: &ReflectAllocationId) -> WorldAccessRange
fn from(val: &ReflectAllocationId) -> WorldAccessRange
Source§impl Hash for ReflectAllocationId
impl Hash for ReflectAllocationId
Source§impl Ord for ReflectAllocationId
impl Ord for ReflectAllocationId
Source§fn cmp(&self, other: &ReflectAllocationId) -> Ordering
fn cmp(&self, other: &ReflectAllocationId) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for ReflectAllocationId
impl PartialEq for ReflectAllocationId
Source§impl PartialOrd for ReflectAllocationId
impl PartialOrd for ReflectAllocationId
Auto Trait Implementations§
impl !RefUnwindSafe for ReflectAllocationId
impl !UnwindSafe for ReflectAllocationId
impl Forget for ReflectAllocationId
impl Freeze for ReflectAllocationId
impl Move for ReflectAllocationId
impl Send for ReflectAllocationId
impl Sync for ReflectAllocationId
impl Unpin for ReflectAllocationId
impl UnsafeUnpin for ReflectAllocationId
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> ConditionalSend for Twhere
T: Send,
impl<T> Context for T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
Source§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
impl<T> MaybeSend for Twhere
T: Send,
impl<T> MaybeSync for Twhere
T: Sync,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Settings for T
Source§impl<T> Template for T
impl<T> Template for T
Source§fn build_template(
&self,
_context: &mut TemplateContext<'_, '_>,
) -> Result<<T as Template>::Output, BevyError>
fn build_template( &self, _context: &mut TemplateContext<'_, '_>, ) -> Result<<T as Template>::Output, BevyError>
entity context to produce a Template::Output.Source§fn clone_template(&self) -> T
fn clone_template(&self) -> T
Clone.Source§impl<T> TypeData for T
impl<T> TypeData for T
Source§fn clone_type_data(&self) -> Box<dyn TypeData>
fn clone_type_data(&self) -> Box<dyn TypeData>
self.