[][src]Struct rbx_reflection::RbxClassDescriptor

pub struct RbxClassDescriptor { /* fields omitted */ }

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]

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]

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]

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]

impl Debug for RbxClassDescriptor[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]