Trait yksom::vm::objects::Obj [−][src]
pub trait Obj: Debug + Send {}Show methods
fn dyn_objtype(self: Gc<Self>) -> ObjType
where
Self: Send; fn get_class(self: Gc<Self>, vm: &mut VM) -> Val
where
Self: Send; fn to_array(self: Gc<Self>) -> Result<Gc<dyn Array>, Box<VMError>>
where
Self: Send, { ... } fn to_strval(self: Gc<Self>, _: &mut VM) -> Result<Val, Box<VMError>>
where
Self: Send, { ... } fn num_inst_vars(self: Gc<Self>, _: &VM) -> usize
where
Self: Send, { ... } fn inst_var_at(
self: Gc<Self>,
vm: &VM,
i: usize
) -> Result<Val, Box<VMError>>
where
Self: Send, { ... } fn inst_var_at_put(
self: Gc<Self>,
vm: &VM,
i: usize,
v: Val
) -> Result<(), Box<VMError>>
where
Self: Send, { ... } unsafe fn unchecked_inst_var_get(self: Gc<Self>, _: &VM, _: usize) -> Val
where
Self: Send, { ... } unsafe fn unchecked_inst_var_set(self: Gc<Self>, _: &VM, _: usize, _: Val)
where
Self: Send, { ... } fn length(self: Gc<Self>) -> usize
where
Self: Send, { ... } fn hashcode(self: Gc<Self>) -> u64
where
Self: Send, { ... } fn add(self: Gc<Self>, _: &mut VM, _: Val) -> Result<Val, Box<VMError>>
where
Self: Send, { ... } fn and(self: Gc<Self>, _: &mut VM, _: Val) -> Result<Val, Box<VMError>>
where
Self: Send, { ... } fn div(self: Gc<Self>, _: &mut VM, _: Val) -> Result<Val, Box<VMError>>
where
Self: Send, { ... } fn double_div(
self: Gc<Self>,
_: &mut VM,
_: Val
) -> Result<Val, Box<VMError>>
where
Self: Send, { ... } fn modulus(self: Gc<Self>, _: &mut VM, _: Val) -> Result<Val, Box<VMError>>
where
Self: Send, { ... } fn mul(self: Gc<Self>, _: &mut VM, _: Val) -> Result<Val, Box<VMError>>
where
Self: Send, { ... } fn remainder(
self: Gc<Self>,
_: &mut VM,
_: Val
) -> Result<Val, Box<VMError>>
where
Self: Send, { ... } fn shl(self: Gc<Self>, _: &mut VM, _: Val) -> Result<Val, Box<VMError>>
where
Self: Send, { ... } fn shr(self: Gc<Self>, _: &mut VM, _: Val) -> Result<Val, Box<VMError>>
where
Self: Send, { ... } fn sqrt(self: Gc<Self>, _: &mut VM) -> Result<Val, Box<VMError>>
where
Self: Send, { ... } fn sub(self: Gc<Self>, _: &mut VM, _: Val) -> Result<Val, Box<VMError>>
where
Self: Send, { ... } fn xor(self: Gc<Self>, _: &mut VM, _: Val) -> Result<Val, Box<VMError>>
where
Self: Send, { ... } fn ref_equals(
self: Gc<Self>,
vm: &mut VM,
other: Val
) -> Result<Val, Box<VMError>>
where
Self: Send, { ... } fn equals(self: Gc<Self>, _: &mut VM, _: Val) -> Result<Val, Box<VMError>>
where
Self: Send, { ... } fn not_equals(
self: Gc<Self>,
_: &mut VM,
_: Val
) -> Result<Val, Box<VMError>>
where
Self: Send, { ... } fn greater_than(
self: Gc<Self>,
_: &mut VM,
_: Val
) -> Result<Val, Box<VMError>>
where
Self: Send, { ... } fn greater_than_equals(
self: Gc<Self>,
_: &mut VM,
_: Val
) -> Result<Val, Box<VMError>>
where
Self: Send, { ... } fn less_than(
self: Gc<Self>,
_: &mut VM,
_: Val
) -> Result<Val, Box<VMError>>
where
Self: Send, { ... } fn less_than_equals(
self: Gc<Self>,
_: &mut VM,
_: Val
) -> Result<Val, Box<VMError>>
where
Self: Send, { ... }
The main SOM Object trait. Notice that code should almost never call these functions directly:
you should instead call the equivalent function in the Val
struct.
Required methods
fn dyn_objtype(self: Gc<Self>) -> ObjType where
Self: Send,
[src]
Self: Send,
What ObjType
does this Val
represent?
fn get_class(self: Gc<Self>, vm: &mut VM) -> Val where
Self: Send,
[src]
Self: Send,
What class is this object an instance of?
Provided methods
fn to_array(self: Gc<Self>) -> Result<Gc<dyn Array>, Box<VMError>> where
Self: Send,
[src]
Self: Send,
If (and only if) this object implements the Array trait then return a reference to this object as an Array trait object.
fn to_strval(self: Gc<Self>, _: &mut VM) -> Result<Val, Box<VMError>> where
Self: Send,
[src]
Self: Send,
Convert this object to a Val
that represents a SOM string.
fn num_inst_vars(self: Gc<Self>, _: &VM) -> usize where
Self: Send,
[src]
Self: Send,
How many instance variables does this object contain?
fn inst_var_at(self: Gc<Self>, vm: &VM, i: usize) -> Result<Val, Box<VMError>> where
Self: Send,
[src]
Self: Send,
Return the instance variable at i
(using SOM indexing).
fn inst_var_at_put(
self: Gc<Self>,
vm: &VM,
i: usize,
v: Val
) -> Result<(), Box<VMError>> where
Self: Send,
[src]
self: Gc<Self>,
vm: &VM,
i: usize,
v: Val
) -> Result<(), Box<VMError>> where
Self: Send,
Return the instance variable at i
(using SOM indexing).
unsafe fn unchecked_inst_var_get(self: Gc<Self>, _: &VM, _: usize) -> Val where
Self: Send,
[src]
Self: Send,
Lookup an instance variable in this object. If usize
exceeds the number of instance
variables this will lead to undefined behaviour.
unsafe fn unchecked_inst_var_set(self: Gc<Self>, _: &VM, _: usize, _: Val) where
Self: Send,
[src]
Self: Send,
Set an instance variable in this object. If usize
exceeds the number of instance
variables this will lead to undefined behaviour.
fn length(self: Gc<Self>) -> usize where
Self: Send,
[src]
Self: Send,
What is this object’s length?
fn hashcode(self: Gc<Self>) -> u64 where
Self: Send,
[src]
Self: Send,
What is this object’s hashcode?
fn add(self: Gc<Self>, _: &mut VM, _: Val) -> Result<Val, Box<VMError>> where
Self: Send,
[src]
Self: Send,
Produce a new Val
which adds other
to this.
fn and(self: Gc<Self>, _: &mut VM, _: Val) -> Result<Val, Box<VMError>> where
Self: Send,
[src]
Self: Send,
Produce a new Val
which performs a bitwise and with other
and this.
fn div(self: Gc<Self>, _: &mut VM, _: Val) -> Result<Val, Box<VMError>> where
Self: Send,
[src]
Self: Send,
Produce a new Val
which divides other
from this.
fn double_div(self: Gc<Self>, _: &mut VM, _: Val) -> Result<Val, Box<VMError>> where
Self: Send,
[src]
Self: Send,
fn modulus(self: Gc<Self>, _: &mut VM, _: Val) -> Result<Val, Box<VMError>> where
Self: Send,
[src]
Self: Send,
Produce a new Val
which performs a mod operation on this with other
.
fn mul(self: Gc<Self>, _: &mut VM, _: Val) -> Result<Val, Box<VMError>> where
Self: Send,
[src]
Self: Send,
Produce a new Val
which multiplies other
to this.
fn remainder(self: Gc<Self>, _: &mut VM, _: Val) -> Result<Val, Box<VMError>> where
Self: Send,
[src]
Self: Send,
Produce a new Val
which returns the remainder of dividing this with other
.
fn shl(self: Gc<Self>, _: &mut VM, _: Val) -> Result<Val, Box<VMError>> where
Self: Send,
[src]
Self: Send,
Produce a new Val
which shifts self
other
bits to the left.
fn shr(self: Gc<Self>, _: &mut VM, _: Val) -> Result<Val, Box<VMError>> where
Self: Send,
[src]
Self: Send,
Produce a new Val
which shifts self
other
bits to the right, treating self
as if it
did not have a sign bit.
fn sqrt(self: Gc<Self>, _: &mut VM) -> Result<Val, Box<VMError>> where
Self: Send,
[src]
Self: Send,
Produces a new Val
which is the square root of this.
fn sub(self: Gc<Self>, _: &mut VM, _: Val) -> Result<Val, Box<VMError>> where
Self: Send,
[src]
Self: Send,
Produce a new Val
which subtracts other
from this.
fn xor(self: Gc<Self>, _: &mut VM, _: Val) -> Result<Val, Box<VMError>> where
Self: Send,
[src]
Self: Send,
Produce a new Val
which performs a bitwise xor with other
and this
fn ref_equals(
self: Gc<Self>,
vm: &mut VM,
other: Val
) -> Result<Val, Box<VMError>> where
Self: Send,
[src]
self: Gc<Self>,
vm: &mut VM,
other: Val
) -> Result<Val, Box<VMError>> where
Self: Send,
Is this Val
reference equality equal to other
? Only immutable SOM types are likely to
want to override this.
fn equals(self: Gc<Self>, _: &mut VM, _: Val) -> Result<Val, Box<VMError>> where
Self: Send,
[src]
Self: Send,
Does this Val
equal other
?
fn not_equals(self: Gc<Self>, _: &mut VM, _: Val) -> Result<Val, Box<VMError>> where
Self: Send,
[src]
Self: Send,
Does this Val
not equal other
?
fn greater_than(self: Gc<Self>, _: &mut VM, _: Val) -> Result<Val, Box<VMError>> where
Self: Send,
[src]
Self: Send,
Is this Val
greater than other
?
fn greater_than_equals(
self: Gc<Self>,
_: &mut VM,
_: Val
) -> Result<Val, Box<VMError>> where
Self: Send,
[src]
self: Gc<Self>,
_: &mut VM,
_: Val
) -> Result<Val, Box<VMError>> where
Self: Send,
Is this Val
greater than or equal to other
?
fn less_than(self: Gc<Self>, _: &mut VM, _: Val) -> Result<Val, Box<VMError>> where
Self: Send,
[src]
Self: Send,
Is this Val
less than other
?
fn less_than_equals(
self: Gc<Self>,
_: &mut VM,
_: Val
) -> Result<Val, Box<VMError>> where
Self: Send,
[src]
self: Gc<Self>,
_: &mut VM,
_: Val
) -> Result<Val, Box<VMError>> where
Self: Send,
Is this Val
less than or equal to other
?
Implementors
impl Obj for ArbInt
[src]
fn dyn_objtype(self: Gc<Self>) -> ObjType
[src]
fn get_class(self: Gc<Self>, vm: &mut VM) -> Val
[src]
fn to_strval(self: Gc<Self>, vm: &mut VM) -> Result<Val, Box<VMError>>
[src]
fn add(self: Gc<Self>, vm: &mut VM, other: Val) -> Result<Val, Box<VMError>>
[src]
fn and(self: Gc<Self>, vm: &mut VM, other: Val) -> Result<Val, Box<VMError>>
[src]
fn div(self: Gc<Self>, vm: &mut VM, other: Val) -> Result<Val, Box<VMError>>
[src]
fn double_div(
self: Gc<Self>,
vm: &mut VM,
other: Val
) -> Result<Val, Box<VMError>>
[src]
self: Gc<Self>,
vm: &mut VM,
other: Val
) -> Result<Val, Box<VMError>>
fn modulus(self: Gc<Self>, vm: &mut VM, other: Val) -> Result<Val, Box<VMError>>
[src]
fn mul(self: Gc<Self>, vm: &mut VM, other: Val) -> Result<Val, Box<VMError>>
[src]
fn remainder(
self: Gc<Self>,
_vm: &mut VM,
_other: Val
) -> Result<Val, Box<VMError>>
[src]
self: Gc<Self>,
_vm: &mut VM,
_other: Val
) -> Result<Val, Box<VMError>>
fn shl(self: Gc<Self>, vm: &mut VM, other: Val) -> Result<Val, Box<VMError>>
[src]
fn shr(self: Gc<Self>, vm: &mut VM, other: Val) -> Result<Val, Box<VMError>>
[src]
fn sqrt(self: Gc<Self>, vm: &mut VM) -> Result<Val, Box<VMError>>
[src]
fn sub(self: Gc<Self>, vm: &mut VM, other: Val) -> Result<Val, Box<VMError>>
[src]
fn xor(self: Gc<Self>, vm: &mut VM, other: Val) -> Result<Val, Box<VMError>>
[src]
fn ref_equals(
self: Gc<Self>,
vm: &mut VM,
other: Val
) -> Result<Val, Box<VMError>>
[src]
self: Gc<Self>,
vm: &mut VM,
other: Val
) -> Result<Val, Box<VMError>>
fn equals(self: Gc<Self>, vm: &mut VM, other: Val) -> Result<Val, Box<VMError>>
[src]
fn not_equals(
self: Gc<Self>,
vm: &mut VM,
other: Val
) -> Result<Val, Box<VMError>>
[src]
self: Gc<Self>,
vm: &mut VM,
other: Val
) -> Result<Val, Box<VMError>>
fn greater_than(
self: Gc<Self>,
vm: &mut VM,
other: Val
) -> Result<Val, Box<VMError>>
[src]
self: Gc<Self>,
vm: &mut VM,
other: Val
) -> Result<Val, Box<VMError>>
fn greater_than_equals(
self: Gc<Self>,
vm: &mut VM,
other: Val
) -> Result<Val, Box<VMError>>
[src]
self: Gc<Self>,
vm: &mut VM,
other: Val
) -> Result<Val, Box<VMError>>
fn less_than(
self: Gc<Self>,
vm: &mut VM,
other: Val
) -> Result<Val, Box<VMError>>
[src]
self: Gc<Self>,
vm: &mut VM,
other: Val
) -> Result<Val, Box<VMError>>
fn less_than_equals(
self: Gc<Self>,
vm: &mut VM,
other: Val
) -> Result<Val, Box<VMError>>
[src]
self: Gc<Self>,
vm: &mut VM,
other: Val
) -> Result<Val, Box<VMError>>
impl Obj for Block
[src]
fn dyn_objtype(self: Gc<Self>) -> ObjType
[src]
fn get_class(self: Gc<Self>, vm: &mut VM) -> Val
[src]
fn hashcode(self: Gc<Self>) -> u64
[src]
impl Obj for Class
[src]
fn dyn_objtype(self: Gc<Self>) -> ObjType
[src]
fn get_class(self: Gc<Self>, _: &mut VM) -> Val
[src]
fn num_inst_vars(self: Gc<Self>, _: &VM) -> usize
[src]
unsafe fn unchecked_inst_var_get(self: Gc<Self>, vm: &VM, n: usize) -> Val
[src]
unsafe fn unchecked_inst_var_set(self: Gc<Self>, vm: &VM, n: usize, v: Val)
[src]
fn hashcode(self: Gc<Self>) -> u64
[src]
impl Obj for Double
[src]
fn dyn_objtype(self: Gc<Self>) -> ObjType
[src]
fn get_class(self: Gc<Self>, vm: &mut VM) -> Val
[src]
fn to_strval(self: Gc<Self>, vm: &mut VM) -> Result<Val, Box<VMError>>
[src]
fn hashcode(self: Gc<Self>) -> u64
[src]
fn add(self: Gc<Self>, vm: &mut VM, other: Val) -> Result<Val, Box<VMError>>
[src]
fn double_div(
self: Gc<Self>,
vm: &mut VM,
other: Val
) -> Result<Val, Box<VMError>>
[src]
self: Gc<Self>,
vm: &mut VM,
other: Val
) -> Result<Val, Box<VMError>>
fn modulus(self: Gc<Self>, vm: &mut VM, other: Val) -> Result<Val, Box<VMError>>
[src]
fn mul(self: Gc<Self>, vm: &mut VM, other: Val) -> Result<Val, Box<VMError>>
[src]
fn sqrt(self: Gc<Self>, vm: &mut VM) -> Result<Val, Box<VMError>>
[src]
fn sub(self: Gc<Self>, vm: &mut VM, other: Val) -> Result<Val, Box<VMError>>
[src]
fn ref_equals(
self: Gc<Self>,
vm: &mut VM,
other: Val
) -> Result<Val, Box<VMError>>
[src]
self: Gc<Self>,
vm: &mut VM,
other: Val
) -> Result<Val, Box<VMError>>
fn equals(self: Gc<Self>, vm: &mut VM, other: Val) -> Result<Val, Box<VMError>>
[src]
fn less_than(
self: Gc<Self>,
vm: &mut VM,
other: Val
) -> Result<Val, Box<VMError>>
[src]
self: Gc<Self>,
vm: &mut VM,
other: Val
) -> Result<Val, Box<VMError>>
impl Obj for Inst
[src]
fn dyn_objtype(self: Gc<Self>) -> ObjType
[src]
fn get_class(self: Gc<Self>, _: &mut VM) -> Val
[src]
fn num_inst_vars(self: Gc<Self>, vm: &VM) -> usize
[src]
unsafe fn unchecked_inst_var_get(self: Gc<Self>, vm: &VM, n: usize) -> Val
[src]
unsafe fn unchecked_inst_var_set(self: Gc<Self>, vm: &VM, n: usize, v: Val)
[src]
fn hashcode(self: Gc<Self>) -> u64
[src]
impl Obj for Int
[src]
fn dyn_objtype(self: Gc<Self>) -> ObjType
[src]
fn get_class(self: Gc<Self>, vm: &mut VM) -> Val
[src]
fn to_strval(self: Gc<Self>, vm: &mut VM) -> Result<Val, Box<VMError>>
[src]
fn add(self: Gc<Self>, vm: &mut VM, other: Val) -> Result<Val, Box<VMError>>
[src]
fn div(self: Gc<Self>, vm: &mut VM, other: Val) -> Result<Val, Box<VMError>>
[src]
fn mul(self: Gc<Self>, vm: &mut VM, other: Val) -> Result<Val, Box<VMError>>
[src]
fn sub(self: Gc<Self>, vm: &mut VM, other: Val) -> Result<Val, Box<VMError>>
[src]
impl Obj for Method
[src]
fn dyn_objtype(self: Gc<Self>) -> ObjType
[src]
fn get_class(self: Gc<Self>, vm: &mut VM) -> Val
[src]
fn hashcode(self: Gc<Self>) -> u64
[src]
impl Obj for MethodsArray
[src]
fn dyn_objtype(self: Gc<Self>) -> ObjType where
Self: Send,
[src]
Self: Send,
fn get_class(self: Gc<Self>, vm: &mut VM) -> Val where
Self: Send,
[src]
Self: Send,
fn to_array(self: Gc<Self>) -> Result<Gc<dyn Array>, Box<VMError>> where
Self: Send,
[src]
Self: Send,
fn hashcode(self: Gc<Self>) -> u64 where
Self: Send,
[src]
Self: Send,
fn length(self: Gc<Self>) -> usize where
Self: Send,
[src]
Self: Send,
impl Obj for NormalArray
[src]
fn dyn_objtype(self: Gc<Self>) -> ObjType
[src]
fn get_class(self: Gc<Self>, vm: &mut VM) -> Val
[src]
fn to_array(self: Gc<Self>) -> Result<Gc<dyn Array>, Box<VMError>>
[src]
fn hashcode(self: Gc<Self>) -> u64
[src]
fn length(self: Gc<Self>) -> usize
[src]
impl Obj for String_
[src]
fn dyn_objtype(self: Gc<Self>) -> ObjType
[src]
fn get_class(self: Gc<Self>, _: &mut VM) -> Val
[src]
fn to_strval(self: Gc<Self>, _: &mut VM) -> Result<Val, Box<VMError>>
[src]
fn hashcode(self: Gc<Self>) -> u64
[src]
fn length(self: Gc<Self>) -> usize
[src]
fn ref_equals(
self: Gc<Self>,
vm: &mut VM,
other: Val
) -> Result<Val, Box<VMError>>
[src]
self: Gc<Self>,
vm: &mut VM,
other: Val
) -> Result<Val, Box<VMError>>