Struct yksom::vm::objects::ArbInt [−][src]
pub struct ArbInt { /* fields omitted */ }
A boxed arbitrary sized BigInt
.
Implementations
impl ArbInt
[src]
pub fn new(vm: &mut VM, val: BigInt) -> Val
[src]
Create a Val
representing the BigInt
integer val
. Note that this will create the most
efficient integer representation that can represent val
(i.e. this might create a tagged
isize
, a boxed isize
, or a boxed BigInt
) – the VM relies, in various places, on this
property (e.g. an ArbInt
with a value 1
would cause odd errors elsewhere).
pub fn bigint(&self) -> &BigInt
[src]
pub fn to_f64(&self, vm: &VM) -> Result<f64, Box<VMError>>
[src]
If this ArbInt
can be represented as a finite f64
, return that value; otherwise return
Err(CantRepresentAsDouble)
.
Trait Implementations
impl Debug for ArbInt
[src]
impl NotUnboxable for ArbInt
[src]
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>>
fn to_array(self: Gc<Self>) -> Result<Gc<dyn Array>, Box<VMError>> where
Self: Send,
[src]
Self: Send,
fn num_inst_vars(self: Gc<Self>, _: &VM) -> usize where
Self: Send,
[src]
Self: Send,
fn inst_var_at(self: Gc<Self>, vm: &VM, i: usize) -> Result<Val, Box<VMError>> where
Self: Send,
[src]
Self: Send,
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,
unsafe fn unchecked_inst_var_get(self: Gc<Self>, _: &VM, _: usize) -> Val where
Self: Send,
[src]
Self: Send,
unsafe fn unchecked_inst_var_set(self: Gc<Self>, _: &VM, _: usize, _: Val) where
Self: Send,
[src]
Self: Send,
fn length(self: Gc<Self>) -> usize where
Self: Send,
[src]
Self: Send,
fn hashcode(self: Gc<Self>) -> u64 where
Self: Send,
[src]
Self: Send,
impl StaticObjType for ArbInt
[src]
fn static_objtype() -> ObjType
[src]
Auto Trait Implementations
impl NoTrace for ArbInt
impl RefUnwindSafe for ArbInt
impl Send for ArbInt
impl Sync for ArbInt
impl Unpin for ArbInt
impl UnwindSafe for ArbInt
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,