#[non_exhaustive]pub struct ReflectReference {
pub base: ReflectBaseType,
pub reflect_path: ParsedPath,
}
Expand description
A reference to an arbitrary reflected instance.
The reference can point to either the ECS, or to the allocator.
References are composed of two parts:
- The base kind, which specifies where the reference points to
- The path, which specifies how to access the value from the base.
Bindings defined on this type, apply to ALL references.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.base: ReflectBaseType
The base type and id of the value we want to access
reflect_path: ParsedPath
The path from the top level type to the actual value we want to access
Implementations§
Source§impl ReflectReference
impl ReflectReference
Sourcepub fn variant_name(
&self,
world: WorldAccessGuard<'_>,
) -> Result<Option<String>, InteropError>
pub fn variant_name( &self, world: WorldAccessGuard<'_>, ) -> Result<Option<String>, InteropError>
If this points to a variant of an enum, returns the name of the variant.
Sourcepub fn into_iter_infinite(self) -> ReflectRefIter ⓘ
pub fn into_iter_infinite(self) -> ReflectRefIter ⓘ
Creates a new infinite iterator. This iterator will keep returning the next element reference forever.
Sourcepub fn len(
&self,
world: WorldAccessGuard<'_>,
) -> Result<Option<usize>, InteropError>
pub fn len( &self, world: WorldAccessGuard<'_>, ) -> Result<Option<usize>, InteropError>
If this is a reference to something with a length accessible via reflection, returns that length.
Sourcepub fn new_allocated<T>(
value: T,
allocator: &mut ReflectAllocator,
) -> ReflectReferencewhere
T: Reflect,
pub fn new_allocated<T>(
value: T,
allocator: &mut ReflectAllocator,
) -> ReflectReferencewhere
T: Reflect,
Create a new reference to a value by allocating it.
You can retrieve the allocator from the world using WorldGuard::allocator
.
Make sure to drop the allocator write guard before doing anything with the reference to prevent deadlocks.
Sourcepub fn new_allocated_boxed_parial_reflect(
value: Box<dyn PartialReflect>,
allocator: &mut ReflectAllocator,
) -> Result<ReflectReference, InteropError>
pub fn new_allocated_boxed_parial_reflect( value: Box<dyn PartialReflect>, allocator: &mut ReflectAllocator, ) -> Result<ReflectReference, InteropError>
Create a new reference to a value by allocating it.
Prefer using Self::new_allocated
if you have a value that implements Reflect
.
Will fail if the value does not have represented type info with a specific type id.
Sourcepub fn new_allocated_boxed(
value: Box<dyn Reflect>,
allocator: &mut ReflectAllocator,
) -> ReflectReference
pub fn new_allocated_boxed( value: Box<dyn Reflect>, allocator: &mut ReflectAllocator, ) -> ReflectReference
Create a new reference to a value by allocating it.
Sourcepub fn new_resource_ref<T>(
world: WorldAccessGuard<'_>,
) -> Result<ReflectReference, InteropError>where
T: Resource,
pub fn new_resource_ref<T>(
world: WorldAccessGuard<'_>,
) -> Result<ReflectReference, InteropError>where
T: Resource,
Create a new reference to resource
Sourcepub fn new_component_ref<T>(
entity: Entity,
world: WorldAccessGuard<'_>,
) -> Result<ReflectReference, InteropError>where
T: Component,
pub fn new_component_ref<T>(
entity: Entity,
world: WorldAccessGuard<'_>,
) -> Result<ReflectReference, InteropError>where
T: Component,
Create a new reference to component
Sourcepub fn index_path<T>(&mut self, index: T)where
T: Into<ParsedPath>,
pub fn index_path<T>(&mut self, index: T)where
T: Into<ParsedPath>,
Indexes into the reflect path inside this reference.
You can use [Self::reflect
] and Self::reflect_mut
to get the actual value.
Sourcepub fn downcast<O>(
&self,
world: WorldAccessGuard<'_>,
) -> Result<O, InteropError>where
O: Clone + PartialReflect,
pub fn downcast<O>(
&self,
world: WorldAccessGuard<'_>,
) -> Result<O, InteropError>where
O: Clone + PartialReflect,
Tries to downcast to the specified type and cloning the value if successful.
Sourcepub fn to_owned_value(
&self,
world: WorldAccessGuard<'_>,
) -> Result<Box<dyn PartialReflect>, InteropError>
pub fn to_owned_value( &self, world: WorldAccessGuard<'_>, ) -> Result<Box<dyn PartialReflect>, InteropError>
Attempts to create a Box<dyn PartialReflect>
from the reference. This is possible using a few strategies:
- If the reference is to a world, a [
WorldCallbackAccess
] is created and boxed - If the reference is to an allocation with no reflection path and references to it, the value is taken as is.
- If the reference has a
bevy::reflect::ReflectFromReflect
type data associated with it, the value is cloned using that impl. - If all above fails,
bevy::reflect::PartialReflect::clone_value
is used to clone the value.
Sourcepub fn with_reflect<O, F>(
&self,
world: WorldAccessGuard<'_>,
f: F,
) -> Result<O, InteropError>where
F: FnOnce(&(dyn PartialReflect + 'static)) -> O,
pub fn with_reflect<O, F>(
&self,
world: WorldAccessGuard<'_>,
f: F,
) -> Result<O, InteropError>where
F: FnOnce(&(dyn PartialReflect + 'static)) -> O,
The way to access the value of the reference, that is the pointed-to value. This method is safe to use as it ensures no-one else has aliasing access to the value at the same time.
Sourcepub fn with_reflect_mut<O, F>(
&self,
world: WorldAccessGuard<'_>,
f: F,
) -> Result<O, InteropError>where
F: FnOnce(&mut (dyn PartialReflect + 'static)) -> O,
pub fn with_reflect_mut<O, F>(
&self,
world: WorldAccessGuard<'_>,
f: F,
) -> Result<O, InteropError>where
F: FnOnce(&mut (dyn PartialReflect + 'static)) -> O,
The way to access the value of the reference, that is the pointed-to value. This method is safe to use as it ensures no-one else has aliasing access to the value at the same time.
Sourcepub fn tail_type_id(
&self,
world: WorldAccessGuard<'_>,
) -> Result<Option<TypeId>, InteropError>
pub fn tail_type_id( &self, world: WorldAccessGuard<'_>, ) -> Result<Option<TypeId>, InteropError>
Retrieves the type id of the value the reference points to.
Sourcepub fn element_type_id(
&self,
world: WorldAccessGuard<'_>,
) -> Result<Option<TypeId>, InteropError>
pub fn element_type_id( &self, world: WorldAccessGuard<'_>, ) -> Result<Option<TypeId>, InteropError>
Retrieves the type id of the elements in the value the reference points to.
Sourcepub fn key_type_id(
&self,
world: WorldAccessGuard<'_>,
) -> Result<Option<TypeId>, InteropError>
pub fn key_type_id( &self, world: WorldAccessGuard<'_>, ) -> Result<Option<TypeId>, InteropError>
Retrieves the type id of the keys in the value the reference points to.
Sourcepub fn type_id_of(
&self,
source: TypeIdSource,
world: WorldAccessGuard<'_>,
) -> Result<Option<TypeId>, InteropError>
pub fn type_id_of( &self, source: TypeIdSource, world: WorldAccessGuard<'_>, ) -> Result<Option<TypeId>, InteropError>
Retrieves the type id of the value the reference points to based on the given source.
Sourcepub unsafe fn reflect_unsafe<'w>(
&self,
world: WorldAccessGuard<'w>,
) -> Result<&'w (dyn PartialReflect + 'static), InteropError>
pub unsafe fn reflect_unsafe<'w>( &self, world: WorldAccessGuard<'w>, ) -> Result<&'w (dyn PartialReflect + 'static), InteropError>
Retrieves a reference to the underlying dyn PartialReflect
type valid for the ’w lifetime of the world cell
§Safety
- The caller must ensure the cell has permission to access the underlying value
- The caller must ensure no aliasing references to the same value exist at all at the same time
To do this safely you need to use [WorldAccessGuard::claim_read_access
] or [WorldAccessGuard::claim_global_access
] to ensure nobody else is currently accessing the value.
Sourcepub unsafe fn reflect_mut_unsafe<'w>(
&self,
world: WorldAccessGuard<'w>,
) -> Result<&'w mut (dyn PartialReflect + 'static), InteropError>
pub unsafe fn reflect_mut_unsafe<'w>( &self, world: WorldAccessGuard<'w>, ) -> Result<&'w mut (dyn PartialReflect + 'static), InteropError>
Retrieves mutable reference to the underlying dyn PartialReflect
type valid for the ’w lifetime of the world cell
§Safety
- The caller must ensure the cell has permission to access the underlying value
- The caller must ensure no other references to the same value exist at all at the same time (even if you have the correct access)
To do this safely you need to use [WorldAccessGuard::claim_write_access
] or [WorldAccessGuard::claim_global_access
] to ensure nobody else is currently accessing the value.
Trait Implementations§
Source§impl ArgMeta for ReflectReference
impl ArgMeta for ReflectReference
Source§fn default_value() -> Option<ScriptValue>
fn default_value() -> Option<ScriptValue>
Source§impl AsRef<ReflectReference> for LuaReflectReference
impl AsRef<ReflectReference> for LuaReflectReference
Source§fn as_ref(&self) -> &ReflectReference
fn as_ref(&self) -> &ReflectReference
Source§impl AsRef<ReflectReference> for RhaiReflectReference
impl AsRef<ReflectReference> for RhaiReflectReference
Source§fn as_ref(&self) -> &ReflectReference
fn as_ref(&self) -> &ReflectReference
Source§impl Clone for ReflectReference
impl Clone for ReflectReference
Source§fn clone(&self) -> ReflectReference
fn clone(&self) -> ReflectReference
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ReflectReference
impl Debug for ReflectReference
Source§impl Default for ReflectReference
impl Default for ReflectReference
Source§fn default() -> ReflectReference
fn default() -> ReflectReference
Source§impl DisplayWithWorld for ReflectReference
impl DisplayWithWorld for ReflectReference
Source§fn display_with_world(&self, world: WorldAccessGuard<'_>) -> String
fn display_with_world(&self, world: WorldAccessGuard<'_>) -> String
shallowest
representation of the type using world access.
For references this is the type path and the type of the value they are pointing to.Source§fn display_value_with_world(&self, world: WorldAccessGuard<'_>) -> String
fn display_value_with_world(&self, world: WorldAccessGuard<'_>) -> String
Source§fn display_without_world(&self) -> String
fn display_without_world(&self) -> String
Source§impl From<LuaReflectReference> for ReflectReference
impl From<LuaReflectReference> for ReflectReference
Source§fn from(value: LuaReflectReference) -> ReflectReference
fn from(value: LuaReflectReference) -> ReflectReference
Source§impl From<ReflectReference> for LuaReflectReference
impl From<ReflectReference> for LuaReflectReference
Source§fn from(value: ReflectReference) -> LuaReflectReference
fn from(value: ReflectReference) -> LuaReflectReference
Source§impl From<ReflectReference> for RhaiReflectReference
impl From<ReflectReference> for RhaiReflectReference
Source§fn from(value: ReflectReference) -> RhaiReflectReference
fn from(value: ReflectReference) -> RhaiReflectReference
Source§impl From<ReflectReference> for ScriptValue
impl From<ReflectReference> for ScriptValue
Source§fn from(value: ReflectReference) -> ScriptValue
fn from(value: ReflectReference) -> ScriptValue
Source§impl From<RhaiReflectReference> for ReflectReference
impl From<RhaiReflectReference> for ReflectReference
Source§fn from(value: RhaiReflectReference) -> ReflectReference
fn from(value: RhaiReflectReference) -> ReflectReference
Source§impl FromReflect for ReflectReference
impl FromReflect for ReflectReference
Source§fn from_reflect(
reflect: &(dyn PartialReflect + 'static),
) -> Option<ReflectReference>
fn from_reflect( reflect: &(dyn PartialReflect + 'static), ) -> Option<ReflectReference>
Self
from a reflected value.Source§fn take_from_reflect(
reflect: Box<dyn PartialReflect>,
) -> Result<Self, Box<dyn PartialReflect>>
fn take_from_reflect( reflect: Box<dyn PartialReflect>, ) -> Result<Self, Box<dyn PartialReflect>>
Self
using,
constructing the value using from_reflect
if that fails. Read moreSource§impl FromScript for ReflectReference
impl FromScript for ReflectReference
Source§type This<'w> = ReflectReference
type This<'w> = ReflectReference
Source§fn from_script(
value: ScriptValue,
_world: WorldAccessGuard<'_>,
) -> Result<ReflectReference, InteropError>
fn from_script( value: ScriptValue, _world: WorldAccessGuard<'_>, ) -> Result<ReflectReference, InteropError>
T
from a ScriptValue
.Source§impl GetTypeDependencies for ReflectReference
impl GetTypeDependencies for ReflectReference
Source§type Underlying = ReflectReference
type Underlying = ReflectReference
Self
However some types might be facades
for other types, in which case this will be the underlying typeSource§fn register_type_dependencies(registry: &mut TypeRegistry)
fn register_type_dependencies(registry: &mut TypeRegistry)
TypeRegistry
.Source§impl GetTypeRegistration for ReflectReference
impl GetTypeRegistration for ReflectReference
Source§fn get_type_registration() -> TypeRegistration
fn get_type_registration() -> TypeRegistration
TypeRegistration
for this type.Source§fn register_type_dependencies(registry: &mut TypeRegistry)
fn register_type_dependencies(registry: &mut TypeRegistry)
Source§impl IntoScript for ReflectReference
impl IntoScript for ReflectReference
Source§fn into_script(
self,
_world: WorldAccessGuard<'_>,
) -> Result<ScriptValue, InteropError>
fn into_script( self, _world: WorldAccessGuard<'_>, ) -> Result<ScriptValue, InteropError>
ScriptValue
.Source§fn into_script_inline_error(self, world: WorldAccessGuard<'_>) -> ScriptValuewhere
Self: Sized,
fn into_script_inline_error(self, world: WorldAccessGuard<'_>) -> ScriptValuewhere
Self: Sized,
ScriptValue
, returning an error as a ScriptValue if an error occurs.Source§impl IntoScriptRef for ReflectReference
impl IntoScriptRef for ReflectReference
Source§fn into_script_ref(
self_: ReflectReference,
world: WorldAccessGuard<'_>,
) -> Result<ScriptValue, InteropError>
fn into_script_ref( self_: ReflectReference, world: WorldAccessGuard<'_>, ) -> Result<ScriptValue, InteropError>
crate::bindings::function::ScriptValue
].Source§impl PartialEq for ReflectReference
impl PartialEq for ReflectReference
Source§impl PartialReflect for ReflectReference
impl PartialReflect for ReflectReference
Source§fn get_represented_type_info(&self) -> Option<&'static TypeInfo>
fn get_represented_type_info(&self) -> Option<&'static TypeInfo>
Source§fn clone_value(&self) -> Box<dyn PartialReflect>
fn clone_value(&self) -> Box<dyn PartialReflect>
Reflect
trait object. Read moreSource§fn try_apply(
&mut self,
value: &(dyn PartialReflect + 'static),
) -> Result<(), ApplyError>
fn try_apply( &mut self, value: &(dyn PartialReflect + 'static), ) -> Result<(), ApplyError>
Source§fn reflect_kind(&self) -> ReflectKind
fn reflect_kind(&self) -> ReflectKind
Source§fn reflect_ref(&self) -> ReflectRef<'_>
fn reflect_ref(&self) -> ReflectRef<'_>
Source§fn reflect_mut(&mut self) -> ReflectMut<'_>
fn reflect_mut(&mut self) -> ReflectMut<'_>
Source§fn reflect_owned(self: Box<ReflectReference>) -> ReflectOwned
fn reflect_owned(self: Box<ReflectReference>) -> ReflectOwned
Source§fn try_into_reflect(
self: Box<ReflectReference>,
) -> Result<Box<dyn Reflect>, Box<dyn PartialReflect>>
fn try_into_reflect( self: Box<ReflectReference>, ) -> Result<Box<dyn Reflect>, Box<dyn PartialReflect>>
Source§fn try_as_reflect(&self) -> Option<&(dyn Reflect + 'static)>
fn try_as_reflect(&self) -> Option<&(dyn Reflect + 'static)>
Source§fn try_as_reflect_mut(&mut self) -> Option<&mut (dyn Reflect + 'static)>
fn try_as_reflect_mut(&mut self) -> Option<&mut (dyn Reflect + 'static)>
Source§fn into_partial_reflect(self: Box<ReflectReference>) -> Box<dyn PartialReflect>
fn into_partial_reflect(self: Box<ReflectReference>) -> Box<dyn PartialReflect>
Source§fn as_partial_reflect(&self) -> &(dyn PartialReflect + 'static)
fn as_partial_reflect(&self) -> &(dyn PartialReflect + 'static)
Source§fn as_partial_reflect_mut(&mut self) -> &mut (dyn PartialReflect + 'static)
fn as_partial_reflect_mut(&mut self) -> &mut (dyn PartialReflect + 'static)
Source§fn apply(&mut self, value: &(dyn PartialReflect + 'static))
fn apply(&mut self, value: &(dyn PartialReflect + 'static))
Source§fn reflect_hash(&self) -> Option<u64>
fn reflect_hash(&self) -> Option<u64>
Source§fn reflect_partial_eq(
&self,
_value: &(dyn PartialReflect + 'static),
) -> Option<bool>
fn reflect_partial_eq( &self, _value: &(dyn PartialReflect + 'static), ) -> Option<bool>
Source§fn debug(&self, f: &mut Formatter<'_>) -> Result<(), Error>
fn debug(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Source§fn serializable(&self) -> Option<Serializable<'_>>
fn serializable(&self) -> Option<Serializable<'_>>
Source§fn is_dynamic(&self) -> bool
fn is_dynamic(&self) -> bool
Source§impl Reflect for ReflectReference
impl Reflect for ReflectReference
Source§fn into_any(self: Box<ReflectReference>) -> Box<dyn Any>
fn into_any(self: Box<ReflectReference>) -> Box<dyn Any>
Box<dyn Any>
. Read moreSource§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut dyn Any
. Read moreSource§fn into_reflect(self: Box<ReflectReference>) -> Box<dyn Reflect>
fn into_reflect(self: Box<ReflectReference>) -> Box<dyn Reflect>
Source§fn as_reflect(&self) -> &(dyn Reflect + 'static)
fn as_reflect(&self) -> &(dyn Reflect + 'static)
Source§fn as_reflect_mut(&mut self) -> &mut (dyn Reflect + 'static)
fn as_reflect_mut(&mut self) -> &mut (dyn Reflect + 'static)
Source§impl TypePath for ReflectReference
impl TypePath for ReflectReference
Source§fn type_path() -> &'static str
fn type_path() -> &'static str
Source§fn short_type_path() -> &'static str
fn short_type_path() -> &'static str
Source§fn type_ident() -> Option<&'static str>
fn type_ident() -> Option<&'static str>
Source§fn crate_name() -> Option<&'static str>
fn crate_name() -> Option<&'static str>
Source§impl Typed for ReflectReference
impl Typed for ReflectReference
Source§impl TypedThrough for ReflectReference
impl TypedThrough for ReflectReference
Source§fn through_type_info() -> ThroughTypeInfo
fn through_type_info() -> ThroughTypeInfo
ThroughTypeInfo
for the type.impl Eq for ReflectReference
impl StructuralPartialEq for ReflectReference
Auto Trait Implementations§
impl Freeze for ReflectReference
impl RefUnwindSafe for ReflectReference
impl Send for ReflectReference
impl Sync for ReflectReference
impl Unpin for ReflectReference
impl UnwindSafe for ReflectReference
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
. Box<dyn Any>
can
then be further downcast
into Box<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>
. Rc<Any>
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> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> DynamicTypePath for Twhere
T: TypePath,
impl<T> DynamicTypePath for Twhere
T: TypePath,
Source§fn reflect_type_path(&self) -> &str
fn reflect_type_path(&self) -> &str
TypePath::type_path
.Source§fn reflect_short_type_path(&self) -> &str
fn reflect_short_type_path(&self) -> &str
Source§fn reflect_type_ident(&self) -> Option<&str>
fn reflect_type_ident(&self) -> Option<&str>
TypePath::type_ident
.Source§fn reflect_crate_name(&self) -> Option<&str>
fn reflect_crate_name(&self) -> Option<&str>
TypePath::crate_name
.Source§fn reflect_module_path(&self) -> Option<&str>
fn reflect_module_path(&self) -> Option<&str>
Source§impl<T> DynamicTyped for Twhere
T: Typed,
impl<T> DynamicTyped for Twhere
T: Typed,
Source§fn reflect_type_info(&self) -> &'static TypeInfo
fn reflect_type_info(&self) -> &'static TypeInfo
Typed::type_info
.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self
using default()
.
Source§impl<T> GetPath for T
impl<T> GetPath for T
Source§fn reflect_path<'p>(
&self,
path: impl ReflectPath<'p>,
) -> Result<&(dyn PartialReflect + 'static), ReflectPathError<'p>>
fn reflect_path<'p>( &self, path: impl ReflectPath<'p>, ) -> Result<&(dyn PartialReflect + 'static), ReflectPathError<'p>>
path
. Read moreSource§fn reflect_path_mut<'p>(
&mut self,
path: impl ReflectPath<'p>,
) -> Result<&mut (dyn PartialReflect + 'static), ReflectPathError<'p>>
fn reflect_path_mut<'p>( &mut self, path: impl ReflectPath<'p>, ) -> Result<&mut (dyn PartialReflect + 'static), ReflectPathError<'p>>
path
. Read moreSource§fn path<'p, T>(
&self,
path: impl ReflectPath<'p>,
) -> Result<&T, ReflectPathError<'p>>where
T: Reflect,
fn path<'p, T>(
&self,
path: impl ReflectPath<'p>,
) -> Result<&T, ReflectPathError<'p>>where
T: Reflect,
path
. Read moreSource§fn path_mut<'p, T>(
&mut self,
path: impl ReflectPath<'p>,
) -> Result<&mut T, ReflectPathError<'p>>where
T: Reflect,
fn path_mut<'p, T>(
&mut self,
path: impl ReflectPath<'p>,
) -> Result<&mut T, ReflectPathError<'p>>where
T: Reflect,
path
. Read moreSource§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> IntoNamespace for Twhere
T: 'static + ?Sized,
impl<T> IntoNamespace for Twhere
T: 'static + ?Sized,
Source§fn into_namespace() -> Namespace
fn into_namespace() -> Namespace
Namespace
Source§impl<T> PartialReflectExt for Twhere
T: PartialReflect + ?Sized,
impl<T> PartialReflectExt for Twhere
T: PartialReflect + ?Sized,
Source§fn from_reflect_or_clone(
reflect: &(dyn PartialReflect + 'static),
world: WorldAccessGuard<'_>,
) -> Box<dyn PartialReflect>
fn from_reflect_or_clone( reflect: &(dyn PartialReflect + 'static), world: WorldAccessGuard<'_>, ) -> Box<dyn PartialReflect>
Try creating an owned partial reflect from a reference. Will try using ReflectFromReflect
first, and if that fails, will clone the value using PartialReflect::clone_value
.
Source§fn is_type(&self, crate_name: Option<&str>, type_ident: &str) -> bool
fn is_type(&self, crate_name: Option<&str>, type_ident: &str) -> bool
Source§fn expect_type(
&self,
crate_name: Option<&str>,
type_ident: &str,
) -> Result<(), InteropError>
fn expect_type( &self, crate_name: Option<&str>, type_ident: &str, ) -> Result<(), InteropError>
PartialReflectExt::is_type
but returns an appropriate error if the type is not the expected one.Source§fn as_option(
&self,
) -> Result<Option<&(dyn PartialReflect + 'static)>, InteropError>
fn as_option( &self, ) -> Result<Option<&(dyn PartialReflect + 'static)>, InteropError>
Source§fn as_option_mut(
&mut self,
) -> Result<Option<&mut (dyn PartialReflect + 'static)>, InteropError>
fn as_option_mut( &mut self, ) -> Result<Option<&mut (dyn PartialReflect + 'static)>, InteropError>
PartialReflectExt::as_option
but for mutable references.Source§fn as_list(
&self,
) -> Result<impl Iterator<Item = &(dyn PartialReflect + 'static)>, InteropError>
fn as_list( &self, ) -> Result<impl Iterator<Item = &(dyn PartialReflect + 'static)>, InteropError>
Source§fn set_as_list<F>(
&mut self,
other: Box<dyn PartialReflect>,
apply: F,
) -> Result<(), InteropError>where
F: Fn(&mut (dyn PartialReflect + 'static), &(dyn PartialReflect + 'static)) -> Result<(), InteropError>,
fn set_as_list<F>(
&mut self,
other: Box<dyn PartialReflect>,
apply: F,
) -> Result<(), InteropError>where
F: Fn(&mut (dyn PartialReflect + 'static), &(dyn PartialReflect + 'static)) -> Result<(), InteropError>,
Source§fn as_usize(&self) -> Result<usize, InteropError>
fn as_usize(&self) -> Result<usize, InteropError>
Source§fn try_insert_boxed(
&mut self,
key: Box<dyn PartialReflect>,
value: Box<dyn PartialReflect>,
) -> Result<(), InteropError>
fn try_insert_boxed( &mut self, key: Box<dyn PartialReflect>, value: Box<dyn PartialReflect>, ) -> Result<(), InteropError>
Source§fn try_push_boxed(
&mut self,
value: Box<dyn PartialReflect>,
) -> Result<(), InteropError>
fn try_push_boxed( &mut self, value: Box<dyn PartialReflect>, ) -> Result<(), InteropError>
end
of the container.
For lists, this is the length of the list.
For sets, this will simply insert the value into the set.
For maps, there is no natural end
, so the push will error out