[−][src]Struct mtots::Eval
Implementations
impl Eval
[src]
pub fn classof(
globals: &'a mut Globals,
value: &'a Value
) -> Result<&'a Rc<Class>, ErrorIndicator>
[src]
globals: &'a mut Globals,
value: &'a Value
) -> Result<&'a Rc<Class>, ErrorIndicator>
pub fn expect_int(
globals: &mut Globals,
value: &Value
) -> Result<i64, ErrorIndicator>
[src]
globals: &mut Globals,
value: &Value
) -> Result<i64, ErrorIndicator>
pub fn expect_index(
globals: &mut Globals,
value: &Value,
len: usize
) -> Result<usize, ErrorIndicator>
[src]
globals: &mut Globals,
value: &Value,
len: usize
) -> Result<usize, ErrorIndicator>
pub fn expect_float(
globals: &mut Globals,
value: &Value
) -> Result<f64, ErrorIndicator>
[src]
globals: &mut Globals,
value: &Value
) -> Result<f64, ErrorIndicator>
pub fn expect_floatlike(
globals: &mut Globals,
value: &Value
) -> Result<f64, ErrorIndicator>
[src]
globals: &mut Globals,
value: &Value
) -> Result<f64, ErrorIndicator>
pub fn expect_symbol(
globals: &mut Globals,
value: &Value
) -> Result<Symbol, ErrorIndicator>
[src]
globals: &mut Globals,
value: &Value
) -> Result<Symbol, ErrorIndicator>
pub fn expect_symbollike(
globals: &mut Globals,
value: &Value
) -> Result<Symbol, ErrorIndicator>
[src]
globals: &mut Globals,
value: &Value
) -> Result<Symbol, ErrorIndicator>
pub fn expect_string(
globals: &mut Globals,
value: &'a Value
) -> Result<&'a RcStr, ErrorIndicator>
[src]
globals: &mut Globals,
value: &'a Value
) -> Result<&'a RcStr, ErrorIndicator>
pub fn move_string_or_clone(
globals: &mut Globals,
value: Value
) -> Result<String, ErrorIndicator>
[src]
globals: &mut Globals,
value: Value
) -> Result<String, ErrorIndicator>
pub fn expect_bytes(
globals: &mut Globals,
value: &'a Value
) -> Result<&'a Vec<u8>, ErrorIndicator>
[src]
globals: &mut Globals,
value: &'a Value
) -> Result<&'a Vec<u8>, ErrorIndicator>
pub fn expect_path(
globals: &mut Globals,
value: &'a Value
) -> Result<&'a RcPath, ErrorIndicator>
[src]
globals: &mut Globals,
value: &'a Value
) -> Result<&'a RcPath, ErrorIndicator>
pub fn expect_pathlike(
globals: &mut Globals,
value: &Value
) -> Result<RcPath, ErrorIndicator>
[src]
globals: &mut Globals,
value: &Value
) -> Result<RcPath, ErrorIndicator>
pub fn expect_list(
globals: &mut Globals,
value: &'a Value
) -> Result<&'a Vec<Value>, ErrorIndicator>
[src]
globals: &mut Globals,
value: &'a Value
) -> Result<&'a Vec<Value>, ErrorIndicator>
pub fn try_move_list(
globals: &mut Globals,
value: Value
) -> Result<Option<Vec<Value>>, ErrorIndicator>
[src]
globals: &mut Globals,
value: Value
) -> Result<Option<Vec<Value>>, ErrorIndicator>
Expects the given value to be the only holder of a list -- and moves the vector out
pub fn move_list(
globals: &mut Globals,
value: Value
) -> Result<Vec<Value>, ErrorIndicator>
[src]
globals: &mut Globals,
value: Value
) -> Result<Vec<Value>, ErrorIndicator>
pub fn expect_table(
globals: &mut Globals,
value: &'a Value
) -> Result<&'a Table, ErrorIndicator>
[src]
globals: &mut Globals,
value: &'a Value
) -> Result<&'a Table, ErrorIndicator>
pub fn move_table_or_clone(
globals: &mut Globals,
value: Value
) -> Result<Table, ErrorIndicator>
[src]
globals: &mut Globals,
value: Value
) -> Result<Table, ErrorIndicator>
pub fn try_move_table(
globals: &mut Globals,
value: Value
) -> Result<Option<Table>, ErrorIndicator>
[src]
globals: &mut Globals,
value: Value
) -> Result<Option<Table>, ErrorIndicator>
pub fn move_table(
globals: &mut Globals,
value: Value
) -> Result<Table, ErrorIndicator>
[src]
globals: &mut Globals,
value: Value
) -> Result<Table, ErrorIndicator>
pub fn expect_map(
globals: &mut Globals,
value: &'a Value
) -> Result<&'a GMap<Globals, Value, Value, Eval, Eval, ErrorIndicator>, ErrorIndicator>
[src]
globals: &mut Globals,
value: &'a Value
) -> Result<&'a GMap<Globals, Value, Value, Eval, Eval, ErrorIndicator>, ErrorIndicator>
pub fn move_exc(
globals: &mut Globals,
value: Value
) -> Result<Exception, ErrorIndicator>
[src]
globals: &mut Globals,
value: Value
) -> Result<Exception, ErrorIndicator>
pub fn expect_module(
globals: &mut Globals,
value: &'a Value
) -> Result<&'a Rc<Module>, ErrorIndicator>
[src]
globals: &mut Globals,
value: &'a Value
) -> Result<&'a Rc<Module>, ErrorIndicator>
pub fn expect_opaque<T>(
globals: &mut Globals,
value: &'a Value
) -> Result<Ref<'a, T>, ErrorIndicator> where
T: 'static,
[src]
globals: &mut Globals,
value: &'a Value
) -> Result<Ref<'a, T>, ErrorIndicator> where
T: 'static,
pub fn move_opaque<T>(
globals: &mut Globals,
value: &'a Value
) -> Result<T, ErrorIndicator> where
T: 'static,
[src]
globals: &mut Globals,
value: &'a Value
) -> Result<T, ErrorIndicator> where
T: 'static,
pub fn expect_mutable_string(
globals: &mut Globals,
value: &'a Value
) -> Result<&'a Rc<RefCell<String>>, ErrorIndicator>
[src]
globals: &mut Globals,
value: &'a Value
) -> Result<&'a Rc<RefCell<String>>, ErrorIndicator>
pub fn expect_mutable_list(
globals: &mut Globals,
value: &'a Value
) -> Result<&'a Rc<RefCell<Vec<Value>>>, ErrorIndicator>
[src]
globals: &mut Globals,
value: &'a Value
) -> Result<&'a Rc<RefCell<Vec<Value>>>, ErrorIndicator>
pub fn expect_mutable_map(
globals: &mut Globals,
value: &'a Value
) -> Result<&'a Rc<RefCell<GMap<Globals, Value, Value, Eval, Eval, ErrorIndicator>>>, ErrorIndicator>
[src]
globals: &mut Globals,
value: &'a Value
) -> Result<&'a Rc<RefCell<GMap<Globals, Value, Value, Eval, Eval, ErrorIndicator>>>, ErrorIndicator>
pub fn expect_class(
globals: &mut Globals,
value: &'a Value
) -> Result<&'a Rc<Class>, ErrorIndicator>
[src]
globals: &mut Globals,
value: &'a Value
) -> Result<&'a Rc<Class>, ErrorIndicator>
pub fn expect_exception_kind(
globals: &mut Globals,
value: &'a Value
) -> Result<&'a Rc<ExceptionKind>, ErrorIndicator>
[src]
globals: &mut Globals,
value: &'a Value
) -> Result<&'a Rc<ExceptionKind>, ErrorIndicator>
pub fn try_<T, E>(
globals: &mut Globals,
result: Result<T, E>
) -> Result<T, ErrorIndicator> where
E: Into<EvalError>,
[src]
globals: &mut Globals,
result: Result<T, E>
) -> Result<T, ErrorIndicator> where
E: Into<EvalError>,
pub fn osstr_to_str(
globals: &mut Globals,
osstr: &'a OsStr
) -> Result<&'a str, ErrorIndicator>
[src]
globals: &mut Globals,
osstr: &'a OsStr
) -> Result<&'a str, ErrorIndicator>
pub fn truthy(
globals: &mut Globals,
value: &Value
) -> Result<bool, ErrorIndicator>
[src]
globals: &mut Globals,
value: &Value
) -> Result<bool, ErrorIndicator>
pub fn truthy0(
globals: &mut Globals,
value: &Value,
Option<(&Code, usize)>
) -> Result<bool, ErrorIndicator>
[src]
globals: &mut Globals,
value: &Value,
Option<(&Code, usize)>
) -> Result<bool, ErrorIndicator>
Verison of truthy that will accept an optional debuginfo argument
This is so that we only add debug information to the stacktrace if we need to make
a jump. If we don't need to make a jump, the globals.trace_push/trace_pop
might
cost as much as the operation itself
pub fn eq(
globals: &mut Globals,
a: &Value,
b: &Value
) -> Result<bool, ErrorIndicator>
[src]
globals: &mut Globals,
a: &Value,
b: &Value
) -> Result<bool, ErrorIndicator>
pub fn eq0(
globals: &mut Globals,
a: &Value,
b: &Value,
debuginfo: Option<(&Code, usize)>
) -> Result<bool, ErrorIndicator>
[src]
globals: &mut Globals,
a: &Value,
b: &Value,
debuginfo: Option<(&Code, usize)>
) -> Result<bool, ErrorIndicator>
Verison of eq that will accept an optional debuginfo argument
This is so that we only add debug information to the stacktrace if we need to make
a jump. If we don't need to make a jump, the globals.trace_push/trace_pop
might
cost as much as the comparison itself
pub fn neg(globals: &mut Globals, x: &Value) -> Result<Value, ErrorIndicator>
[src]
pub fn pos(globals: &mut Globals, x: &Value) -> Result<Value, ErrorIndicator>
[src]
pub fn lt(
globals: &mut Globals,
a: &Value,
b: &Value
) -> Result<bool, ErrorIndicator>
[src]
globals: &mut Globals,
a: &Value,
b: &Value
) -> Result<bool, ErrorIndicator>
pub fn hash(globals: &mut Globals, x: &Value) -> Result<u64, ErrorIndicator>
[src]
pub fn add(
globals: &mut Globals,
a: Value,
b: Value
) -> Result<Value, ErrorIndicator>
[src]
globals: &mut Globals,
a: Value,
b: Value
) -> Result<Value, ErrorIndicator>
pub fn add0(
globals: &mut Globals,
a: Value,
b: Value,
debuginfo: Option<(&Code, usize)>
) -> Result<Value, ErrorIndicator>
[src]
globals: &mut Globals,
a: Value,
b: Value,
debuginfo: Option<(&Code, usize)>
) -> Result<Value, ErrorIndicator>
pub fn sub(
globals: &mut Globals,
a: Value,
b: Value
) -> Result<Value, ErrorIndicator>
[src]
globals: &mut Globals,
a: Value,
b: Value
) -> Result<Value, ErrorIndicator>
pub fn sub0(
globals: &mut Globals,
a: Value,
b: Value,
debuginfo: Option<(&Code, usize)>
) -> Result<Value, ErrorIndicator>
[src]
globals: &mut Globals,
a: Value,
b: Value,
debuginfo: Option<(&Code, usize)>
) -> Result<Value, ErrorIndicator>
pub fn mul(
globals: &mut Globals,
a: Value,
b: Value
) -> Result<Value, ErrorIndicator>
[src]
globals: &mut Globals,
a: Value,
b: Value
) -> Result<Value, ErrorIndicator>
pub fn mul0(
globals: &mut Globals,
a: Value,
b: Value,
debuginfo: Option<(&Code, usize)>
) -> Result<Value, ErrorIndicator>
[src]
globals: &mut Globals,
a: Value,
b: Value,
debuginfo: Option<(&Code, usize)>
) -> Result<Value, ErrorIndicator>
pub fn div(
globals: &mut Globals,
a: Value,
b: Value
) -> Result<Value, ErrorIndicator>
[src]
globals: &mut Globals,
a: Value,
b: Value
) -> Result<Value, ErrorIndicator>
pub fn div0(
globals: &mut Globals,
a: Value,
b: Value,
debuginfo: Option<(&Code, usize)>
) -> Result<Value, ErrorIndicator>
[src]
globals: &mut Globals,
a: Value,
b: Value,
debuginfo: Option<(&Code, usize)>
) -> Result<Value, ErrorIndicator>
pub fn floordiv(
globals: &mut Globals,
a: Value,
b: Value
) -> Result<Value, ErrorIndicator>
[src]
globals: &mut Globals,
a: Value,
b: Value
) -> Result<Value, ErrorIndicator>
pub fn floordiv0(
globals: &mut Globals,
a: Value,
b: Value,
debuginfo: Option<(&Code, usize)>
) -> Result<Value, ErrorIndicator>
[src]
globals: &mut Globals,
a: Value,
b: Value,
debuginfo: Option<(&Code, usize)>
) -> Result<Value, ErrorIndicator>
pub fn mod_(
globals: &mut Globals,
a: Value,
b: Value
) -> Result<Value, ErrorIndicator>
[src]
globals: &mut Globals,
a: Value,
b: Value
) -> Result<Value, ErrorIndicator>
pub fn mod0(
globals: &mut Globals,
a: Value,
b: Value,
debuginfo: Option<(&Code, usize)>
) -> Result<Value, ErrorIndicator>
[src]
globals: &mut Globals,
a: Value,
b: Value,
debuginfo: Option<(&Code, usize)>
) -> Result<Value, ErrorIndicator>
pub fn truncdiv(
globals: &mut Globals,
a: Value,
b: Value
) -> Result<Value, ErrorIndicator>
[src]
globals: &mut Globals,
a: Value,
b: Value
) -> Result<Value, ErrorIndicator>
pub fn truncdiv0(
globals: &mut Globals,
a: Value,
b: Value,
debuginfo: Option<(&Code, usize)>
) -> Result<Value, ErrorIndicator>
[src]
globals: &mut Globals,
a: Value,
b: Value,
debuginfo: Option<(&Code, usize)>
) -> Result<Value, ErrorIndicator>
pub fn rem(
globals: &mut Globals,
a: Value,
b: Value
) -> Result<Value, ErrorIndicator>
[src]
globals: &mut Globals,
a: Value,
b: Value
) -> Result<Value, ErrorIndicator>
pub fn rem0(
globals: &mut Globals,
a: Value,
b: Value,
debuginfo: Option<(&Code, usize)>
) -> Result<Value, ErrorIndicator>
[src]
globals: &mut Globals,
a: Value,
b: Value,
debuginfo: Option<(&Code, usize)>
) -> Result<Value, ErrorIndicator>
pub fn call(
globals: &mut Globals,
f: &Value,
args: Vec<Value>
) -> Result<Value, ErrorIndicator>
[src]
globals: &mut Globals,
f: &Value,
args: Vec<Value>
) -> Result<Value, ErrorIndicator>
pub fn call_with_kwargs(
globals: &mut Globals,
f: &Value,
args: Vec<Value>,
kwargs: Option<HashMap<Symbol, Value, RandomState>>
) -> Result<Value, ErrorIndicator>
[src]
globals: &mut Globals,
f: &Value,
args: Vec<Value>,
kwargs: Option<HashMap<Symbol, Value, RandomState>>
) -> Result<Value, ErrorIndicator>
pub fn mcall(
globals: &mut Globals,
owner: &Value,
name: Symbol,
args: Vec<Value>
) -> Result<Value, ErrorIndicator>
[src]
globals: &mut Globals,
owner: &Value,
name: Symbol,
args: Vec<Value>
) -> Result<Value, ErrorIndicator>
pub fn get_method(
globals: &mut Globals,
owner: &Value,
name: Symbol
) -> Result<Value, ErrorIndicator>
[src]
globals: &mut Globals,
owner: &Value,
name: Symbol
) -> Result<Value, ErrorIndicator>
pub fn sort(
globals: &mut Globals,
vec: &mut [Value]
) -> Result<(), ErrorIndicator>
[src]
globals: &mut Globals,
vec: &mut [Value]
) -> Result<(), ErrorIndicator>
pub fn str(
globals: &mut Globals,
value: &Value
) -> Result<RcStr, ErrorIndicator>
[src]
globals: &mut Globals,
value: &Value
) -> Result<RcStr, ErrorIndicator>
pub fn repr(
globals: &mut Globals,
value: &Value
) -> Result<RcStr, ErrorIndicator>
[src]
globals: &mut Globals,
value: &Value
) -> Result<RcStr, ErrorIndicator>
pub fn getattr(&mut Globals, owner: &Value, name: Symbol) -> Option<Value>
[src]
pub fn setattr(
&mut Globals,
_owner: &Value,
_name: Symbol,
_value: Value
) -> Result<(), ()>
[src]
&mut Globals,
_owner: &Value,
_name: Symbol,
_value: Value
) -> Result<(), ()>
pub fn get_static_attr(
&mut Globals,
owner: &Value,
name: Symbol
) -> Option<Value>
[src]
&mut Globals,
owner: &Value,
name: Symbol
) -> Option<Value>
pub fn get_static_attr_or_err(
globals: &mut Globals,
owner: &Value,
name: Symbol
) -> Result<Value, ErrorIndicator>
[src]
globals: &mut Globals,
owner: &Value,
name: Symbol
) -> Result<Value, ErrorIndicator>
pub fn call_static_attr(
globals: &mut Globals,
owner: &Value,
name: Symbol,
args: Vec<Value>
) -> Result<Value, ErrorIndicator>
[src]
globals: &mut Globals,
owner: &Value,
name: Symbol,
args: Vec<Value>
) -> Result<Value, ErrorIndicator>
pub fn iter(
globals: &mut Globals,
iterable: &Value
) -> Result<Value, ErrorIndicator>
[src]
globals: &mut Globals,
iterable: &Value
) -> Result<Value, ErrorIndicator>
pub fn next(
globals: &mut Globals,
iterator: &Value
) -> Result<Option<Value>, ErrorIndicator>
[src]
globals: &mut Globals,
iterator: &Value
) -> Result<Option<Value>, ErrorIndicator>
pub fn resume(
globals: &mut Globals,
iterator: &Value,
value: Value
) -> GeneratorResult
[src]
globals: &mut Globals,
iterator: &Value,
value: Value
) -> GeneratorResult
pub fn list_from_iterable(
globals: &mut Globals,
iterable: &Value
) -> Result<Value, ErrorIndicator>
[src]
globals: &mut Globals,
iterable: &Value
) -> Result<Value, ErrorIndicator>
pub fn map_from_iterable(
globals: &mut Globals,
pairs: &Value
) -> Result<Value, ErrorIndicator>
[src]
globals: &mut Globals,
pairs: &Value
) -> Result<Value, ErrorIndicator>
pub fn mutable_list_from_iterable(
globals: &mut Globals,
iterable: &Value
) -> Result<Value, ErrorIndicator>
[src]
globals: &mut Globals,
iterable: &Value
) -> Result<Value, ErrorIndicator>
pub fn mutable_map_from_iterable(
globals: &mut Globals,
iterable: &Value
) -> Result<Value, ErrorIndicator>
[src]
globals: &mut Globals,
iterable: &Value
) -> Result<Value, ErrorIndicator>
pub fn from_iterable(
globals: &mut Globals,
type_: &Value,
iterable: Value
) -> Result<Value, ErrorIndicator>
[src]
globals: &mut Globals,
type_: &Value,
iterable: Value
) -> Result<Value, ErrorIndicator>
pub fn extend_from_iterable(
globals: &mut Globals,
vec: &mut Vec<Value>,
iterable: &Value
) -> Result<(), ErrorIndicator>
[src]
globals: &mut Globals,
vec: &mut Vec<Value>,
iterable: &Value
) -> Result<(), ErrorIndicator>
pub fn extend_str(
globals: &mut Globals,
s: &mut String,
strlike: &Value
) -> Result<(), ErrorIndicator>
[src]
globals: &mut Globals,
s: &mut String,
strlike: &Value
) -> Result<(), ErrorIndicator>
pub fn iterable_to_vec(
globals: &mut Globals,
iterable: &Value
) -> Result<Vec<Value>, ErrorIndicator>
[src]
globals: &mut Globals,
iterable: &Value
) -> Result<Vec<Value>, ErrorIndicator>
pub fn iterable_to_vmap(
globals: &mut Globals,
pairs: &Value
) -> Result<GMap<Globals, Value, Value, Eval, Eval, ErrorIndicator>, ErrorIndicator>
[src]
globals: &mut Globals,
pairs: &Value
) -> Result<GMap<Globals, Value, Value, Eval, Eval, ErrorIndicator>, ErrorIndicator>
pub fn unpack(
globals: &mut Globals,
iterable: &Value,
n: usize
) -> Result<Vec<Value>, ErrorIndicator>
[src]
globals: &mut Globals,
iterable: &Value,
n: usize
) -> Result<Vec<Value>, ErrorIndicator>
Auto Trait Implementations
impl RefUnwindSafe for Eval
impl Send for Eval
impl Sync for Eval
impl Unpin for Eval
impl UnwindSafe for Eval
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,
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.
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>,