refactor: extract core objects into a standalone package
Verify databases and deploy Aster VM / verify-and-deploy (push) Successful in 7m34s

This commit is contained in:
2026-10-19 13:33:24 +08:00
parent 78fc859825
commit f77b8370ea
40 changed files with 631 additions and 202 deletions
+41
View File
@@ -0,0 +1,41 @@
//! Core Endor objects, values, validated executable data and object storage.
//! This crate has no VM evaluator or external dependencies. Handles, reference
//! accounting and mutable payload replacement remain encapsulated here.
//!
//! ```
//! use objects::{ObjectStore, Value};
//! let mut store = ObjectStore::new()?;
//! let object = store.new_object()?;
//! store.set_attr(object, "name", Value::Text("Endor".into()))?;
//! assert_eq!(store.get_attr(object, "name")?, Value::Text("Endor".into()));
//! store.release(object)?;
//! assert_eq!(store.object_count(), 0);
//! # Ok::<(), objects::VmError>(())
//! ```
mod builtins;
mod code;
mod error;
mod heap;
mod instruction;
mod number;
mod object;
mod store;
mod store_builtins;
pub use builtins::{
EndorBaseExceptionObject, EndorCellObject, EndorDictObject, EndorFunctionObject,
EndorStringObject, EndorTracebackEntry,
};
pub use code::{CodeLayout, EndorCode, EndorCodeObject};
pub use error::VmError;
pub use heap::ObjectRef;
pub use instruction::{DecodedInstruction, Instruction, Opcode};
pub use number::{
EndorDecimal, EndorInteger, EndorNumber, EndorNumberObject, EndorRational, EndorReal,
};
pub use object::{
CompareOp, EndorNativeCall, EndorNativeFunctionObject, EndorObject, NativeCall, NativeFunction,
ObjectHeader, ObjectPayload, Record, Value,
};
pub use store::ObjectStore;