54 lines
1.8 KiB
Rust
54 lines
1.8 KiB
Rust
//! 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 changes;
|
|
mod code;
|
|
mod error;
|
|
mod heap;
|
|
mod instruction;
|
|
mod native;
|
|
mod number;
|
|
mod object;
|
|
mod store;
|
|
mod store_builtins;
|
|
mod types;
|
|
|
|
pub use builtins::{
|
|
EndorBaseExceptionObject, EndorCellObject, EndorDictObject, EndorFunctionObject,
|
|
EndorStringObject, EndorTracebackEntry,
|
|
};
|
|
pub use changes::{ChangeBatch, ChangeKey, ObjectChange};
|
|
pub use code::{CodeLayout, EndorCode, EndorCodeObject, SourceSignature};
|
|
pub use error::VmError;
|
|
pub use heap::{ObjectRef, ReadAccess, WeakObjectRef};
|
|
pub use instruction::{DecodedInstruction, Instruction, Opcode};
|
|
pub use native::{
|
|
CallArity, CallEffect, CallSignature, CallType, ContextNativeFunction, NativeCallable,
|
|
NativeContext, NativeResult,
|
|
};
|
|
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;
|
|
pub use types::{
|
|
AnnotationType, ClassField, EndorTraitObject, EndorTypeObject, MethodRequirement, RootTypes,
|
|
TypeConstructor, TypedMethodRequirement,
|
|
};
|