pub struct DynObject { /* private fields */ }
Expand description
Type-erased version of Object
Implementations§
Source§impl DynObject
impl DynObject
Sourcepub fn repr(&self) -> ObjectRepr
pub fn repr(&self) -> ObjectRepr
Calls Object::repr
of the underlying boxed value.
Sourcepub fn get_value(&self, key: &Value) -> Option<Value>
pub fn get_value(&self, key: &Value) -> Option<Value>
Calls Object::get_value
of the underlying boxed value.
Sourcepub fn enumerate(&self) -> Enumerator
pub fn enumerate(&self) -> Enumerator
Calls Object::enumerate
of the underlying boxed value.
Sourcepub fn is_true(&self) -> bool
pub fn is_true(&self) -> bool
Calls Object::is_true
of the underlying boxed value.
Sourcepub fn enumerator_len(&self) -> Option<usize>
pub fn enumerator_len(&self) -> Option<usize>
Calls Object::enumerator_len
of the underlying boxed value.
Sourcepub fn call(
&self,
state: &State<'_, '_>,
args: &[Value],
) -> Result<Value, Error>
pub fn call( &self, state: &State<'_, '_>, args: &[Value], ) -> Result<Value, Error>
Calls Object::call
of the underlying boxed value.
Sourcepub fn call_method(
&self,
state: &State<'_, '_>,
method: &str,
args: &[Value],
) -> Result<Value, Error>
pub fn call_method( &self, state: &State<'_, '_>, method: &str, args: &[Value], ) -> Result<Value, Error>
Calls Object::call_method
of the underlying boxed value.
Sourcepub fn render(&self, f: &mut Formatter<'_>) -> Result
pub fn render(&self, f: &mut Formatter<'_>) -> Result
Calls Object::render
of the underlying boxed value.
Sourcepub fn downcast_ref<T: 'static>(&self) -> Option<&T>
pub fn downcast_ref<T: 'static>(&self) -> Option<&T>
Downcast to T
if the boxed value holds a T
.
This works like Any::downcast_ref
.
Trait Implementations§
impl Send for DynObject
impl Sync for DynObject
Auto Trait Implementations§
impl Freeze for DynObject
impl RefUnwindSafe for DynObject
impl Unpin for DynObject
impl UnwindSafe for DynObject
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