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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)