pub struct OpaqueInfo { /* private fields */ }
Expand description
A container for compile-time info related to reflection-opaque types, including primitives.
This typically represents a type which cannot be broken down any further. This is often due to technical reasons (or by definition), but it can also be a purposeful choice.
For example, i32
cannot be broken down any further, so it is represented by an OpaqueInfo
.
And while String
itself is a struct, its fields are private, so we don’t really treat
it as a struct. It therefore makes more sense to represent it as an OpaqueInfo
.
Implementations§
Source§impl OpaqueInfo
impl OpaqueInfo
pub fn new<T: Reflect + TypePath + ?Sized>() -> Self
Sourcepub fn type_path(&self) -> &'static str
pub fn type_path(&self) -> &'static str
The stable, full type path of this type.
Use type_path_table
if you need access to the other methods on TypePath
.
Sourcepub fn type_path_table(&self) -> &TypePathTable
pub fn type_path_table(&self) -> &TypePathTable
A representation of the type path of this type.
Provides dynamic access to all methods on TypePath
.
Sourcepub fn with_generics(self, generics: Generics) -> Self
pub fn with_generics(self, generics: Generics) -> Self
Sets the generic parameters for this type.
Trait Implementations§
Source§impl Clone for OpaqueInfo
impl Clone for OpaqueInfo
Source§fn clone(&self) -> OpaqueInfo
fn clone(&self) -> OpaqueInfo
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for OpaqueInfo
impl !RefUnwindSafe for OpaqueInfo
impl Send for OpaqueInfo
impl Sync for OpaqueInfo
impl Unpin for OpaqueInfo
impl !UnwindSafe for OpaqueInfo
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.