pub struct OnionASTObject { /* private fields */ }Expand description
AST 节点的 VM 对象包装器。
将 AST 节点包装为 Onion VM 可操作的自定义对象,实现 VM 对象接口, 支持相等性比较、序列化、运算符重载、类型查询等。
Implementations§
Source§impl OnionASTObject
impl OnionASTObject
Sourcepub fn from_onion(object: &OnionObject) -> Result<ASTNode, RuntimeError>
pub fn from_onion(object: &OnionObject) -> Result<ASTNode, RuntimeError>
Trait Implementations§
Source§impl Clone for OnionASTObject
impl Clone for OnionASTObject
Source§fn clone(&self) -> OnionASTObject
fn clone(&self) -> OnionASTObject
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OnionASTObject
impl Debug for OnionASTObject
Source§impl GCTraceable<OnionObjectCell> for OnionASTObject
impl GCTraceable<OnionObjectCell> for OnionASTObject
Source§impl OnionObjectExt for OnionASTObject
impl OnionObjectExt for OnionASTObject
fn as_any(&self) -> &dyn Any
fn upgrade(&self, _: &mut Vec<GCArc<OnionObjectCell>>)
fn equals(&self, other: &OnionObject) -> Result<bool, RuntimeError>
fn key_of(&self) -> Result<OnionStaticObject, RuntimeError>
fn value_of(&self) -> Result<OnionStaticObject, RuntimeError>
fn len(&self) -> Result<OnionStaticObject, RuntimeError>
fn apply(&self, value: &OnionObject) -> Result<OnionStaticObject, RuntimeError>
fn with_attribute( &self, key: &OnionObject, f: &mut dyn FnMut(&OnionObject) -> Result<(), RuntimeError>, ) -> Result<(), RuntimeError>
fn type_of(&self) -> Result<String, RuntimeError>
fn to_string( &self, _ptrs: &Vec<*const OnionObject>, ) -> Result<String, RuntimeError>
fn repr(&self, _ptrs: &Vec<*const OnionObject>) -> Result<String, RuntimeError>
fn binary_shl( &self, other: &OnionObject, ) -> Result<OnionStaticObject, RuntimeError>
fn to_integer(&self) -> Result<i64, RuntimeError>
fn to_float(&self) -> Result<f64, RuntimeError>
fn to_bytes(&self) -> Result<Box<[u8]>, RuntimeError>
fn to_boolean(&self) -> Result<bool, RuntimeError>
fn contains(&self, other: &OnionObject) -> Result<bool, RuntimeError>
fn binary_eq(&self, other: &OnionObject) -> Result<bool, RuntimeError>
fn binary_lt(&self, other: &OnionObject) -> Result<bool, RuntimeError>
fn binary_gt(&self, other: &OnionObject) -> Result<bool, RuntimeError>
fn binary_add( &self, other: &OnionObject, ) -> Result<OnionStaticObject, RuntimeError>
fn binary_sub( &self, other: &OnionObject, ) -> Result<OnionStaticObject, RuntimeError>
fn binary_mul( &self, other: &OnionObject, ) -> Result<OnionStaticObject, RuntimeError>
fn binary_div( &self, other: &OnionObject, ) -> Result<OnionStaticObject, RuntimeError>
fn binary_mod( &self, other: &OnionObject, ) -> Result<OnionStaticObject, RuntimeError>
fn binary_pow( &self, other: &OnionObject, ) -> Result<OnionStaticObject, RuntimeError>
fn binary_and( &self, other: &OnionObject, ) -> Result<OnionStaticObject, RuntimeError>
fn binary_or( &self, other: &OnionObject, ) -> Result<OnionStaticObject, RuntimeError>
fn binary_xor( &self, other: &OnionObject, ) -> Result<OnionStaticObject, RuntimeError>
fn binary_shr( &self, other: &OnionObject, ) -> Result<OnionStaticObject, RuntimeError>
fn unary_neg(&self) -> Result<OnionStaticObject, RuntimeError>
fn unary_plus(&self) -> Result<OnionStaticObject, RuntimeError>
fn unary_not(&self) -> Result<OnionStaticObject, RuntimeError>
Auto Trait Implementations§
impl Freeze for OnionASTObject
impl RefUnwindSafe for OnionASTObject
impl Send for OnionASTObject
impl Sync for OnionASTObject
impl Unpin for OnionASTObject
impl UnsafeUnpin for OnionASTObject
impl UnwindSafe for OnionASTObject
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