Enum GosValue

Source
pub enum GosValue {
Show 29 variants Nil(GosMetadata), Bool(bool), Int(isize), Int8(i8), Int16(i16), Int32(i32), Int64(i64), Uint(usize), Uint8(u8), Uint16(u16), Uint32(u32), Uint64(u64), Float32(OrderedFloat<f32>), Float64(OrderedFloat<f64>), Complex64(OrderedFloat<f32>, OrderedFloat<f32>), Complex128(Box<(OrderedFloat<f64>, OrderedFloat<f64>)>), Function(FunctionKey), Package(PackageKey), Metadata(GosMetadata), Str(Rc<StringObj>), Array(Rc<(ArrayObj, RCount)>), Pointer(Box<PointerObj>), Closure(Rc<(RefCell<ClosureObj>, RCount)>), Slice(Rc<(SliceObj, RCount)>), Map(Rc<(MapObj, RCount)>), Interface(Rc<RefCell<InterfaceObj>>), Struct(Rc<(RefCell<StructObj>, RCount)>), Channel(Rc<ChannelObj>), Named(Box<(GosValue, GosMetadata)>),
}

Variants§

§

Nil(GosMetadata)

§

Bool(bool)

§

Int(isize)

§

Int8(i8)

§

Int16(i16)

§

Int32(i32)

§

Int64(i64)

§

Uint(usize)

§

Uint8(u8)

§

Uint16(u16)

§

Uint32(u32)

§

Uint64(u64)

§

Float32(OrderedFloat<f32>)

§

Float64(OrderedFloat<f64>)

§

Complex64(OrderedFloat<f32>, OrderedFloat<f32>)

§

Complex128(Box<(OrderedFloat<f64>, OrderedFloat<f64>)>)

§

Function(FunctionKey)

§

Package(PackageKey)

§

Metadata(GosMetadata)

§

Str(Rc<StringObj>)

§

Array(Rc<(ArrayObj, RCount)>)

§

Pointer(Box<PointerObj>)

§

Closure(Rc<(RefCell<ClosureObj>, RCount)>)

§

Slice(Rc<(SliceObj, RCount)>)

§

Map(Rc<(MapObj, RCount)>)

§

Interface(Rc<RefCell<InterfaceObj>>)

§

Struct(Rc<(RefCell<StructObj>, RCount)>)

§

Channel(Rc<ChannelObj>)

§

Named(Box<(GosValue, GosMetadata)>)

Implementations§

Source§

impl GosValue

Source

pub fn new_nil() -> GosValue

Source

pub fn new_str(s: String) -> GosValue

Source

pub fn new_pointer(v: PointerObj) -> GosValue

Source

pub fn array_with_size( size: usize, val: &GosValue, meta: GosMetadata, gcobjs: &GcoVec, ) -> GosValue

Source

pub fn array_with_val( val: Vec<GosValue>, meta: GosMetadata, gcobjs: &GcoVec, ) -> GosValue

Source

pub fn new_slice( len: usize, cap: usize, meta: GosMetadata, dval: Option<&GosValue>, gcobjs: &GcoVec, ) -> GosValue

Source

pub fn new_slice_nil(meta: GosMetadata, gcobjs: &GcoVec) -> GosValue

Source

pub fn slice_with_val( val: Vec<GosValue>, meta: GosMetadata, gcobjs: &GcoVec, ) -> GosValue

Source

pub fn slice_with_array( arr: &GosValue, begin: isize, end: isize, gcobjs: &GcoVec, ) -> GosValue

Source

pub fn new_map( meta: GosMetadata, default_val: GosValue, gcobjs: &GcoVec, ) -> GosValue

Source

pub fn new_map_nil( meta: GosMetadata, default_val: GosValue, gcobjs: &GcoVec, ) -> GosValue

Source

pub fn new_struct(obj: StructObj, gcobjs: &GcoVec) -> GosValue

Source

pub fn new_function( package: PackageKey, meta: GosMetadata, objs: &mut VMObjects, gcv: &GcoVec, flag: FuncFlag, ) -> GosValue

Source

pub fn new_closure(fkey: FunctionKey, fobjs: &FunctionObjs) -> GosValue

Source

pub fn new_runtime_closure(clsobj: ClosureObj, gcobjs: &GcoVec) -> GosValue

Source

pub fn new_iface(meta: GosMetadata, underlying: IfaceUnderlying) -> GosValue

Source

pub fn new_empty_iface(mdata: &Metadata, underlying: GosValue) -> GosValue

Source

pub fn new_channel(meta: GosMetadata, cap: usize) -> GosValue

Source

pub fn new_meta(t: MetadataType, metas: &mut MetadataObjs) -> GosValue

Source

pub fn as_bool(&self) -> &bool

Source

pub fn as_int(&self) -> &isize

Source

pub fn as_uint8(&self) -> &u8

Source

pub fn as_int32(&self) -> &i32

Source

pub fn as_int_mut(&mut self) -> &mut isize

Source

pub fn as_float(&self) -> &f64

Source

pub fn as_str(&self) -> &Rc<StringObj>

Source

pub fn as_array(&self) -> &Rc<(ArrayObj, RCount)>

Source

pub fn as_slice(&self) -> &Rc<(SliceObj, RCount)>

Source

pub fn as_map(&self) -> &Rc<(MapObj, RCount)>

Source

pub fn as_interface(&self) -> &Rc<RefCell<InterfaceObj>>

Source

pub fn as_channel(&self) -> &Rc<ChannelObj>

Source

pub fn as_function(&self) -> &FunctionKey

Source

pub fn as_package(&self) -> &PackageKey

Source

pub fn as_struct(&self) -> &Rc<(RefCell<StructObj>, RCount)>

Source

pub fn as_closure(&self) -> &Rc<(RefCell<ClosureObj>, RCount)>

Source

pub fn as_meta(&self) -> &GosMetadata

Source

pub fn as_pointer(&self) -> &Box<PointerObj>

Source

pub fn as_named(&self) -> &Box<(GosValue, GosMetadata)>

Source

pub fn is_nil(&self) -> bool

Source

pub fn try_get_struct(&self) -> Option<&Rc<(RefCell<StructObj>, RCount)>>

Source

pub fn try_get_map(&self) -> Option<&Rc<(MapObj, RCount)>>

Source

pub fn iface_underlying(&self) -> Option<GosValue>

Source

pub fn equals_nil(&self) -> bool

Source

pub fn get_type(&self) -> ValueType

Source

pub fn identical(&self, other: &GosValue) -> bool

Source

pub fn get_meta(&self, objs: &VMObjects, stack: &Stack) -> GosMetadata

Source

pub fn copy_semantic(&self, gcos: &GcoVec) -> GosValue

Source

pub fn deep_clone(&self, gcos: &GcoVec) -> GosValue

Source

pub fn add_str(a: &GosValue, b: &GosValue) -> GosValue

Source

pub fn ref_sub_one(&self)

for gc

Source

pub fn mark_dirty(&self, queue: &mut RCQueue)

for gc

Source

pub fn rc(&self) -> IRC

Source

pub fn set_rc(&self, rc: IRC)

Trait Implementations§

Source§

impl Clone for GosValue

Source§

fn clone(&self) -> GosValue

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GosValue

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for GosValue

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for GosValue

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for GosValue

Source§

fn cmp(&self, b: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for GosValue

Source§

fn eq(&self, b: &GosValue) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for GosValue

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Eq for GosValue

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V