Trait hexagon::object::Object
[−]
[src]
pub trait Object: Send { fn get_children(&self) -> Vec<usize>; fn as_any(&self) -> &Any; fn as_any_mut(&mut self) -> &mut Any; fn finalize(&self, _pool: &mut ObjectPool) { ... } fn initialize(&mut self, _pool: &mut ObjectPool) { ... } fn call(&self, _executor: &mut ExecutorImpl) -> Value { ... } fn call_field(&self, field_name: &str, executor: &mut ExecutorImpl) -> Value { ... } fn get_field(&self, _pool: &ObjectPool, _name: &str) -> Option<Value> { ... } fn set_field(&self, _name: &str, _value_ref: Value) { ... } fn must_get_field(&self, pool: &ObjectPool, name: &str) -> Value { ... } fn has_const_field(&self, _pool: &ObjectPool, _name: &str) -> bool { ... } fn compare(&self, _other: &ValueContext) -> Option<Ordering> { ... } fn test_eq(&self, _other: &ValueContext) -> bool { ... } fn typename(&self) -> &str { ... } fn to_i64(&self) -> i64 { ... } fn to_f64(&self) -> f64 { ... } fn to_str(&self) -> &str { ... } fn to_string(&self) -> String { ... } fn to_bool(&self) -> bool { ... } }
A heap-allocated object.
This is the core abstraction in the Hexagon VM type system. After creating, an object must be pinned to the object pool for use in the virtual environment.
If any initialization is required before the object is pinned
to object pool, it should be done in the initialize
method,
which takes a mutable reference to the object pool and makes
it possible to do preparations e.g. creating built-in fields.
Required Methods
Provided Methods
fn finalize(&self, _pool: &mut ObjectPool)
fn initialize(&mut self, _pool: &mut ObjectPool)
fn call(&self, _executor: &mut ExecutorImpl) -> Value
fn call_field(&self, field_name: &str, executor: &mut ExecutorImpl) -> Value
fn get_field(&self, _pool: &ObjectPool, _name: &str) -> Option<Value>
fn set_field(&self, _name: &str, _value_ref: Value)
fn must_get_field(&self, pool: &ObjectPool, name: &str) -> Value
fn has_const_field(&self, _pool: &ObjectPool, _name: &str) -> bool
fn compare(&self, _other: &ValueContext) -> Option<Ordering>
fn test_eq(&self, _other: &ValueContext) -> bool
fn typename(&self) -> &str
fn to_i64(&self) -> i64
fn to_f64(&self) -> f64
fn to_str(&self) -> &str
fn to_string(&self) -> String
fn to_bool(&self) -> bool
Implementations on Foreign Types
impl Object for String
[src]
fn get_children(&self) -> Vec<usize>
[src]
fn typename(&self) -> &str
[src]
fn as_any(&self) -> &Any
[src]
fn as_any_mut(&mut self) -> &mut Any
[src]
fn to_i64(&self) -> i64
[src]
fn to_f64(&self) -> f64
[src]
fn to_str(&self) -> &str
[src]
fn to_bool(&self) -> bool
[src]
fn test_eq(&self, other: &ValueContext) -> bool
[src]
fn compare(&self, other: &ValueContext) -> Option<Ordering>
[src]
fn call_field(&self, field_name: &str, executor: &mut ExecutorImpl) -> Value
[src]
fn finalize(&self, _pool: &mut ObjectPool)
[src]
fn initialize(&mut self, _pool: &mut ObjectPool)
[src]
fn call(&self, _executor: &mut ExecutorImpl) -> Value
[src]
fn get_field(&self, _pool: &ObjectPool, _name: &str) -> Option<Value>
[src]
fn set_field(&self, _name: &str, _value_ref: Value)
[src]
fn must_get_field(&self, pool: &ObjectPool, name: &str) -> Value
[src]
fn has_const_field(&self, _pool: &ObjectPool, _name: &str) -> bool
[src]
fn to_string(&self) -> String
[src]
Implementors
impl Object for Array
impl Object for DynamicObject
impl<T: TypedArrayElement> Object for TypedArray<T>
impl Object for BuiltinObject
impl Object for DynamicTrait
impl Object for ValidateError
impl Object for ParseError
impl Object for RuntimeError
impl Object for FieldNotFoundError
impl Object for Function
impl Object for StaticRoot