pub struct MetaCallClass { /* private fields */ }Expand description
Represents MetaCall Class. You can get this type when returned by a function or get a class by its name with from_name.
Implementations§
Source§impl MetaCallClass
impl MetaCallClass
Sourcepub fn from_name(
name: impl ToString,
) -> Result<Self, MetaCallClassFromNameError>
pub fn from_name( name: impl ToString, ) -> Result<Self, MetaCallClassFromNameError>
Gets a class by its name.
Sourcepub fn create_object<T: MetaCallValue>(
&self,
name: impl ToString,
constructor_args: impl IntoIterator<Item = T>,
) -> Result<MetaCallObject, MetaCallStringConversionError>
pub fn create_object<T: MetaCallValue>( &self, name: impl ToString, constructor_args: impl IntoIterator<Item = T>, ) -> Result<MetaCallObject, MetaCallStringConversionError>
Creates an object of the class wtih constructor arguments.
Sourcepub fn create_object_no_arg(
&self,
name: impl ToString,
) -> Result<MetaCallObject, MetaCallStringConversionError>
pub fn create_object_no_arg( &self, name: impl ToString, ) -> Result<MetaCallObject, MetaCallStringConversionError>
Creates an object of the class wtihout constructor arguments.
Sourcepub fn get_attribute_untyped(
&self,
name: impl ToString,
) -> Result<Box<dyn MetaCallValue>, MetaCallGetAttributeError>
pub fn get_attribute_untyped( &self, name: impl ToString, ) -> Result<Box<dyn MetaCallValue>, MetaCallGetAttributeError>
Gets static attribute from a class without type casting(MetaCallValue).
Sourcepub fn get_attribute<T: MetaCallValue>(
&self,
name: impl ToString,
) -> Result<T, MetaCallGetAttributeError>
pub fn get_attribute<T: MetaCallValue>( &self, name: impl ToString, ) -> Result<T, MetaCallGetAttributeError>
Gets static attribute from a class.
Sourcepub fn set_attribute(
&self,
key: impl ToString,
value: impl MetaCallValue,
) -> Result<(), MetaCallSetAttributeError>
pub fn set_attribute( &self, key: impl ToString, value: impl MetaCallValue, ) -> Result<(), MetaCallSetAttributeError>
Sets static class attribute.
Sourcepub fn call_method_untyped<T: MetaCallValue>(
&self,
name: impl ToString,
args: impl IntoIterator<Item = T>,
) -> Result<Box<dyn MetaCallValue>, MetaCallError>
pub fn call_method_untyped<T: MetaCallValue>( &self, name: impl ToString, args: impl IntoIterator<Item = T>, ) -> Result<Box<dyn MetaCallValue>, MetaCallError>
Calls a static class method witout type casting(MetaCallValue).
Sourcepub fn call_method_untyped_no_arg<T: MetaCallValue>(
&self,
name: impl ToString,
) -> Result<Box<dyn MetaCallValue>, MetaCallError>
pub fn call_method_untyped_no_arg<T: MetaCallValue>( &self, name: impl ToString, ) -> Result<Box<dyn MetaCallValue>, MetaCallError>
Calls a static class method witout type casting(MetaCallValue) and without passing arguments.
Sourcepub fn call_method<T: MetaCallValue, U: MetaCallValue>(
&self,
name: impl ToString,
args: impl IntoIterator<Item = U>,
) -> Result<T, MetaCallError>
pub fn call_method<T: MetaCallValue, U: MetaCallValue>( &self, name: impl ToString, args: impl IntoIterator<Item = U>, ) -> Result<T, MetaCallError>
Calls a static class method.
Sourcepub fn call_method_no_arg<T: MetaCallValue>(
&self,
name: impl ToString,
) -> Result<T, MetaCallError>
pub fn call_method_no_arg<T: MetaCallValue>( &self, name: impl ToString, ) -> Result<T, MetaCallError>
Calls a static class method without passing arguments.
Trait Implementations§
Source§impl Clone for MetaCallClass
impl Clone for MetaCallClass
Source§impl Debug for MetaCallClass
impl Debug for MetaCallClass
Source§impl Drop for MetaCallClass
impl Drop for MetaCallClass
impl MetaCallValue for MetaCallClass
Equivalent to MetaCall class type.
impl Send for MetaCallClass
impl Sync for MetaCallClass
Auto Trait Implementations§
impl Freeze for MetaCallClass
impl RefUnwindSafe for MetaCallClass
impl Unpin for MetaCallClass
impl UnwindSafe for MetaCallClass
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
Mutably borrows from an owned value. Read more