[−][src]Struct rbx_reflection::RbxClassDescriptor
Describes a class of Roblox instance. Classes relate to eachother via inheritance and have properties attached to them.
All instance classes inherit directly or indirectly from Instance
.
Methods
impl RbxClassDescriptor
[src]
pub fn name(&self) -> &str
[src]
The name of the class as defined by Roblox.
pub fn superclass(&self) -> Option<&str>
[src]
The name of the class that this class inherits from, if it has one. The
only instance without a superclass is Instance
.
pub fn get_property_descriptor<'a>(
&'a self,
property_name: &str
) -> Option<&'a RbxPropertyDescriptor>
[src]
&'a self,
property_name: &str
) -> Option<&'a RbxPropertyDescriptor>
Locates the property descriptor on this class with the given name if it exists.
Note that property descriptors inherited from a superclass will not be present here. If you want a complete view of all property descriptors for a class, you'll need to traverse up the inheritance chain and check their property descriptor tables too.
pub fn iter_property_descriptors(
&self
) -> impl Iterator<Item = (&str, &RbxPropertyDescriptor)>
[src]
&self
) -> impl Iterator<Item = (&str, &RbxPropertyDescriptor)>
Returns an iterator over all property descriptors directly defined on this class.
See the note on get_property_descriptor
for caveats from inheritance.
pub fn get_default_value<'a>(
&'a self,
property_name: &str
) -> Option<&'a RbxValue>
[src]
&'a self,
property_name: &str
) -> Option<&'a RbxValue>
Returns the default value of the property with the given name, if one
could be found by rbx_reflection
.
This will return default values from inherited properties, since values can be specialized.
Not all properties will have default values due to the limitations of how rbx_reflection measures defaults.
pub fn iter_default_values(&self) -> impl Iterator<Item = (&str, &RbxValue)>
[src]
Returns an iterator over all default values on the class.
See notes on get_default_value
for inheritance interactions.
pub fn is_service(&self) -> bool
[src]
Whether this instance is a service or not.
Services can be loaded from ServiceProvider
instances like DataModel
using GetService
from Lua.
Trait Implementations
impl PartialEq<RbxClassDescriptor> for RbxClassDescriptor
[src]
fn eq(&self, other: &RbxClassDescriptor) -> bool
[src]
fn ne(&self, other: &RbxClassDescriptor) -> bool
[src]
impl Debug for RbxClassDescriptor
[src]
Auto Trait Implementations
impl Send for RbxClassDescriptor
impl Sync for RbxClassDescriptor
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,