pub enum ReflectKind {
Struct,
TupleStruct,
Tuple,
List,
Array,
Map,
Set,
Enum,
Opaque,
}
Expand description
An enumeration of the “kinds” of a reflected type.
Each kind corresponds to a specific reflection trait,
such as Struct
or List
,
which itself corresponds to the kind or structure of a type.
A ReflectKind
is obtained via PartialReflect::reflect_kind
,
or via ReflectRef::kind
,ReflectMut::kind
or ReflectOwned::kind
.
Variants§
Struct
A struct-like type.
TupleStruct
A tuple-struct-like type.
Tuple
A tuple-like type.
List
A list-like type.
Array
An array-like type.
Map
A map-like type.
Set
A set-like type.
Enum
An enum-like type.
Opaque
An opaque type.
This most often represents a type where it is either impossible, difficult, or unuseful to reflect the type further.
This includes types like String
and Instant
.
Despite not technically being opaque types,
primitives like u32
i32
are considered opaque for the purposes of reflection.
Additionally, any type that derives Reflect
with the #[reflect(opaque)]
attribute
will be considered an opaque type.
Trait Implementations§
source§impl Clone for ReflectKind
impl Clone for ReflectKind
source§fn clone(&self) -> ReflectKind
fn clone(&self) -> ReflectKind
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ReflectKind
impl Debug for ReflectKind
source§impl Display for ReflectKind
impl Display for ReflectKind
source§impl From<ReflectMut<'_>> for ReflectKind
impl From<ReflectMut<'_>> for ReflectKind
source§fn from(value: ReflectMut<'_>) -> Self
fn from(value: ReflectMut<'_>) -> Self
source§impl From<ReflectOwned> for ReflectKind
impl From<ReflectOwned> for ReflectKind
source§fn from(value: ReflectOwned) -> Self
fn from(value: ReflectOwned) -> Self
source§impl From<ReflectRef<'_>> for ReflectKind
impl From<ReflectRef<'_>> for ReflectKind
source§fn from(value: ReflectRef<'_>) -> Self
fn from(value: ReflectRef<'_>) -> Self
source§impl PartialEq for ReflectKind
impl PartialEq for ReflectKind
impl Copy for ReflectKind
impl Eq for ReflectKind
impl StructuralPartialEq for ReflectKind
Auto Trait Implementations§
impl Freeze for ReflectKind
impl RefUnwindSafe for ReflectKind
impl Send for ReflectKind
impl Sync for ReflectKind
impl Unpin for ReflectKind
impl UnwindSafe for ReflectKind
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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.