Struct go_vm::types::GosValue

source ·
pub struct GosValue { /* private fields */ }

Implementations§

source§

impl GosValue

source

pub fn typ(&self) -> ValueType

source

pub fn t_elem(&self) -> ValueType

source

pub fn copyable(&self) -> bool

source

pub fn comparable(&self) -> bool

source

pub fn nilable(&self) -> bool

source

pub fn new_slice<T>(obj: SliceObj<T>, t_elem: ValueType) -> GosValuewhere T: Element,

source

pub fn as_bool(&self) -> &bool

source

pub fn as_int(&self) -> &isize

source

pub fn as_int8(&self) -> &i8

source

pub fn as_int16(&self) -> &i16

source

pub fn as_int32(&self) -> &i32

source

pub fn as_int64(&self) -> &i64

source

pub fn as_uint(&self) -> &usize

source

pub fn as_uint_ptr(&self) -> &usize

source

pub fn as_uint8(&self) -> &u8

source

pub fn as_uint16(&self) -> &u16

source

pub fn as_uint32(&self) -> &u32

source

pub fn as_uint64(&self) -> &u64

source

pub fn as_float32(&self) -> &F32

source

pub fn as_float64(&self) -> &F64

source

pub fn as_complex64(&self) -> &Complex64

source

pub fn as_function(&self) -> &FunctionKey

source

pub fn as_package(&self) -> &PackageKey

source

pub fn as_metadata(&self) -> &Meta

source

pub fn as_complex128(&self) -> &Complex128

source

pub fn as_string(&self) -> &StringObj

source

pub fn as_gos_array(&self) -> &(GosArrayObj, RCount)

source

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

source

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

source

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

source

pub fn as_unsafe_ptr(&self) -> Option<&UnsafePtrObj>

source

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

source

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

source

pub fn as_gos_slice(&self) -> Option<&(SliceObj<GosElem>, RCount)>

source

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

source

pub fn as_interface(&self) -> Option<&InterfaceObj>

source

pub fn as_non_nil_pointer(&self) -> RuntimeResult<&PointerObj>

source

pub fn as_non_nil_unsafe_ptr(&self) -> RuntimeResult<&UnsafePtrObj>

source

pub fn as_non_nil_closure(&self) -> RuntimeResult<&(ClosureObj, RCount)>

source

pub fn as_non_nil_slice<T>(&self) -> RuntimeResult<&(SliceObj<T>, RCount)>

source

pub fn as_non_nil_map(&self) -> RuntimeResult<&(MapObj, RCount)>

source

pub fn as_non_nil_interface(&self) -> RuntimeResult<&InterfaceObj>

source

pub fn slice_swap(&self, i: usize, j: usize) -> RuntimeResult<()>

source

pub fn is_nil(&self) -> bool

source

pub fn cast_copyable(&self, from: ValueType, to: ValueType) -> GosValue

source

pub fn as_index(&self) -> usize

source

pub fn as_addr(&self) -> *const usize

source

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

source

pub fn slice_string( s: &GosValue, begin: isize, end: isize, max: isize ) -> RuntimeResult<GosValue>

source

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

source

pub fn len(&self) -> usize

source

pub fn cap(&self) -> usize

source

pub fn ref_sub_one(&self)

for gc

Trait Implementations§

source§

impl AsPrimitive<String> for GosValue

source§

fn as_(&self) -> String

Convert a value to another, using the as operator.
source§

impl AsPrimitive<bool> for GosValue

source§

fn as_(&self) -> bool

Convert a value to another, using the as operator.
source§

impl AsPrimitive<f32> for GosValue

source§

fn as_(&self) -> f32

Convert a value to another, using the as operator.
source§

impl AsPrimitive<f64> for GosValue

source§

fn as_(&self) -> f64

Convert a value to another, using the as operator.
source§

impl AsPrimitive<i16> for GosValue

source§

fn as_(&self) -> i16

Convert a value to another, using the as operator.
source§

impl AsPrimitive<i32> for GosValue

source§

fn as_(&self) -> i32

Convert a value to another, using the as operator.
source§

impl AsPrimitive<i64> for GosValue

source§

fn as_(&self) -> i64

Convert a value to another, using the as operator.
source§

impl AsPrimitive<i8> for GosValue

source§

fn as_(&self) -> i8

Convert a value to another, using the as operator.
source§

impl AsPrimitive<isize> for GosValue

source§

fn as_(&self) -> isize

Convert a value to another, using the as operator.
source§

impl AsPrimitive<u16> for GosValue

source§

fn as_(&self) -> u16

Convert a value to another, using the as operator.
source§

impl AsPrimitive<u32> for GosValue

source§

fn as_(&self) -> u32

Convert a value to another, using the as operator.
source§

impl AsPrimitive<u64> for GosValue

source§

fn as_(&self) -> u64

Convert a value to another, using the as operator.
source§

impl AsPrimitive<u8> for GosValue

source§

fn as_(&self) -> u8

Convert a value to another, using the as operator.
source§

impl AsPrimitive<usize> for GosValue

source§

fn as_(&self) -> usize

Convert a value to another, using the as operator.
source§

impl Clone for GosValue

source§

fn clone(&self) -> Self

Returns a copy 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 Drop for GosValue

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl From<String> for GosValue

source§

fn from(s: String) -> Self

Converts to this type from the input type.
source§

impl From<bool> for GosValue

source§

fn from(b: bool) -> Self

Converts to this type from the input type.
source§

impl From<f32> for GosValue

source§

fn from(f: f32) -> Self

Converts to this type from the input type.
source§

impl From<f64> for GosValue

source§

fn from(f: f64) -> Self

Converts to this type from the input type.
source§

impl From<i16> for GosValue

source§

fn from(i: i16) -> Self

Converts to this type from the input type.
source§

impl From<i32> for GosValue

source§

fn from(i: i32) -> Self

Converts to this type from the input type.
source§

impl From<i64> for GosValue

source§

fn from(i: i64) -> Self

Converts to this type from the input type.
source§

impl From<i8> for GosValue

source§

fn from(i: i8) -> Self

Converts to this type from the input type.
source§

impl From<isize> for GosValue

source§

fn from(i: isize) -> Self

Converts to this type from the input type.
source§

impl From<u16> for GosValue

source§

fn from(i: u16) -> Self

Converts to this type from the input type.
source§

impl From<u32> for GosValue

source§

fn from(i: u32) -> Self

Converts to this type from the input type.
source§

impl From<u64> for GosValue

source§

fn from(i: u64) -> Self

Converts to this type from the input type.
source§

impl From<u8> for GosValue

source§

fn from(i: u8) -> Self

Converts to this type from the input type.
source§

impl From<usize> for GosValue

source§

fn from(i: usize) -> Self

Converts to this type from the input type.
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) -> Selfwhere Self: Sized,

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

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

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

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

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

impl PartialEq<GosValue> for GosValue

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<GosValue> 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

This method 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

This method 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

This method 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

This method 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 Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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 Twhere T: Clone,

§

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 Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

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

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

§

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 Twhere U: TryFrom<T>,

§

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.