Struct 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) -> GosValue
where 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) -> &OrderedFloat<f32>

Source

pub fn as_float64(&self) -> &OrderedFloat<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) -> &SliceObj<CellElem<u8>>

Source

pub fn as_gos_array(&self) -> &(ArrayObj<GosElem>, Cell<i32>)

Source

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

Source

pub fn as_struct(&self) -> &(StructObj, Cell<i32>)

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, Cell<i32>)>

Source

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

Source

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

Source

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

Source

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

Source

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

Source

pub fn as_non_nil_pointer(&self) -> Result<&PointerObj, RuntimeError>

Source

pub fn as_non_nil_unsafe_ptr(&self) -> Result<&UnsafePtrObj, RuntimeError>

Source

pub fn as_non_nil_closure( &self, ) -> Result<&(ClosureObj, Cell<i32>), RuntimeError>

Source

pub fn as_non_nil_slice<T>( &self, ) -> Result<&(SliceObj<T>, Cell<i32>), RuntimeError>

Source

pub fn as_non_nil_map(&self) -> Result<&(MapObj, Cell<i32>), RuntimeError>

Source

pub fn as_non_nil_interface(&self) -> Result<&InterfaceObj, RuntimeError>

Source

pub fn as_non_nil_channel(&self) -> Result<&ChannelObj, RuntimeError>

Source

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

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) -> Result<Option<GosValue>, RuntimeError>

Source

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

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) -> GosValue

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<(), Error>

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

impl Display for GosValue

Source§

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

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) -> GosValue

Converts to this type from the input type.
Source§

impl From<bool> for GosValue

Source§

fn from(b: bool) -> GosValue

Converts to this type from the input type.
Source§

impl From<f32> for GosValue

Source§

fn from(f: f32) -> GosValue

Converts to this type from the input type.
Source§

impl From<f64> for GosValue

Source§

fn from(f: f64) -> GosValue

Converts to this type from the input type.
Source§

impl From<i16> for GosValue

Source§

fn from(i: i16) -> GosValue

Converts to this type from the input type.
Source§

impl From<i32> for GosValue

Source§

fn from(i: i32) -> GosValue

Converts to this type from the input type.
Source§

impl From<i64> for GosValue

Source§

fn from(i: i64) -> GosValue

Converts to this type from the input type.
Source§

impl From<i8> for GosValue

Source§

fn from(i: i8) -> GosValue

Converts to this type from the input type.
Source§

impl From<isize> for GosValue

Source§

fn from(i: isize) -> GosValue

Converts to this type from the input type.
Source§

impl From<u16> for GosValue

Source§

fn from(i: u16) -> GosValue

Converts to this type from the input type.
Source§

impl From<u32> for GosValue

Source§

fn from(i: u32) -> GosValue

Converts to this type from the input type.
Source§

impl From<u64> for GosValue

Source§

fn from(i: u64) -> GosValue

Converts to this type from the input type.
Source§

impl From<u8> for GosValue

Source§

fn from(i: u8) -> GosValue

Converts to this type from the input type.
Source§

impl From<usize> for GosValue

Source§

fn from(i: usize) -> GosValue

Converts to this type from the input type.
Source§

impl Hash for GosValue

Source§

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

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: &GosValue) -> 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: &GosValue) -> 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.