Enum roost_lang::interpreter::value::Value
source · [−]pub enum Value<'tree> {
Number(Decimal),
Bool(bool),
String(String),
Range {
start: Option<i128>,
end: Option<i128>,
},
List(Vec<WrappedValue<'tree>>),
Function {
args: &'tree [String],
block: &'tree Block,
},
BuiltIn(BuiltIn),
Class {
statics: HashMap<&'tree str, WrappedValue<'tree>>,
non_statics: Vec<&'tree MemberKind>,
},
Object(HashMap<&'tree str, WrappedValue<'tree>>),
Null,
}
Variants
Number(Decimal)
Bool(bool)
String(String)
Range
List(Vec<WrappedValue<'tree>>)
Function
BuiltIn(BuiltIn)
Class
Object(HashMap<&'tree str, WrappedValue<'tree>>)
Null
Implementations
sourceimpl Value<'_>
impl Value<'_>
pub fn shl(&self, other: &Self, span: &Span) -> Result<Self, Error>
pub fn shr(&self, other: &Self, span: &Span) -> Result<Self, Error>
pub fn or(&self, other: &Self, span: &Span) -> Result<Self, Error>
pub fn xor(&self, other: &Self, span: &Span) -> Result<Self, Error>
pub fn and(&self, other: &Self, span: &Span) -> Result<Self, Error>
sourceimpl<'tree> Value<'tree>
impl<'tree> Value<'tree>
pub fn index(
this: &WrappedValue<'tree>,
index: &WrappedValue<'tree>,
span: &Span
) -> Result<WrappedValue<'tree>, Error>
sourceimpl Value<'_>
impl Value<'_>
pub fn add(&self, other: &Self, span: &Span) -> Result<Self, Error>
pub fn sub(&self, other: &Self, span: &Span) -> Result<Self, Error>
pub fn mul(&self, other: &Self, span: &Span) -> Result<Self, Error>
pub fn div(&self, other: &Self, span: &Span) -> Result<Self, Error>
pub fn pow(&self, other: &Self, span: &Span) -> Result<Self, Error>
pub fn rem(&self, other: &Self, span: &Span) -> Result<Self, Error>
pub fn div_floor(&self, other: &Self, span: &Span) -> Result<Self, Error>
sourceimpl<'tree> Value<'tree>
impl<'tree> Value<'tree>
pub fn get_field(
this: &WrappedValue<'tree>,
name: &str,
built_in_methods: &BuiltInMethods<'tree>,
span: &Span
) -> Result<WrappedValue<'tree>, Error>
sourceimpl<'tree> Value<'tree>
impl<'tree> Value<'tree>
pub fn wrapped(self) -> WrappedValue<'tree>
Trait Implementations
impl<'tree> StructuralPartialEq for Value<'tree>
Auto Trait Implementations
impl<'tree> !RefUnwindSafe for Value<'tree>
impl<'tree> !Send for Value<'tree>
impl<'tree> !Sync for Value<'tree>
impl<'tree> Unpin for Value<'tree>
impl<'tree> !UnwindSafe for Value<'tree>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more