Skip to main content

nanvm_lib/vm/object/
mod.rs

1mod index;
2mod member_access;
3mod own_entries;
4mod own_property;
5mod partial_eq;
6
7pub mod property;
8pub mod to_object;
9
10use crate::vm::IVm;
11
12/// ```
13/// use nanvm_lib::{vm::{Object, ToObject, IVm, Array, Any, ToAny}, naive::Naive};
14/// fn object_test<A: IVm>() {
15///     let b: Object<A> = [("a".into(), true.to_any())].to_object();
16///     let b1: Object<A> = [("a".into(), true.to_any())].to_object();
17///     assert_eq!(b, b);
18///     assert_ne!(b, b1);
19///     let ac: Any<A> = b.clone().to_any();
20///     let d: Object<A> = ac.try_into().unwrap();
21///     assert_eq!(d, b);
22/// }
23///
24/// object_test::<Naive>();
25/// ```
26#[derive(Clone)]
27pub struct Object<A: IVm>(A::InternalObject);