pub enum Variant {
Nil,
BoolTrue,
BoolFalse,
Integer(IntType),
Float(FloatType),
InternStr(StringSymbol),
InlineStr(InlineStr),
GCStr(Gc<str>),
Tuple(Tuple),
Function(Gc<Function>),
NativeFunction(Gc<NativeFunction>),
UserData(Gc<dyn UserData>),
}
Variants
Nil
BoolTrue
BoolFalse
Integer(IntType)
Float(FloatType)
InternStr(StringSymbol)
InlineStr(InlineStr)
GCStr(Gc<str>)
Tuple(Tuple)
Function(Gc<Function>)
NativeFunction(Gc<NativeFunction>)
UserData(Gc<dyn UserData>)
Implementations
sourceimpl Variant
impl Variant
pub fn apply_neg(&self) -> ExecResult<Variant>
pub fn apply_pos(&self) -> ExecResult<Variant>
pub fn apply_inv(&self) -> ExecResult<Variant>
pub fn apply_not(&self) -> ExecResult<Variant>
pub fn apply_mul(&self, rhs: &Variant) -> ExecResult<Variant>
pub fn apply_div(&self, rhs: &Variant) -> ExecResult<Variant>
pub fn apply_mod(&self, rhs: &Variant) -> ExecResult<Variant>
pub fn apply_add(&self, rhs: &Variant) -> ExecResult<Variant>
pub fn apply_sub(&self, rhs: &Variant) -> ExecResult<Variant>
pub fn apply_and(&self, rhs: &Variant) -> ExecResult<Variant>
pub fn apply_xor(&self, rhs: &Variant) -> ExecResult<Variant>
pub fn apply_or(&self, rhs: &Variant) -> ExecResult<Variant>
pub fn apply_shl(&self, rhs: &Variant) -> ExecResult<Variant>
pub fn apply_shr(&self, rhs: &Variant) -> ExecResult<Variant>
pub fn cmp_eq(&self, other: &Variant) -> ExecResult<bool>
pub fn cmp_ne(&self, other: &Variant) -> ExecResult<bool>
pub fn cmp_lt(&self, other: &Variant) -> ExecResult<bool>
pub fn cmp_le(&self, other: &Variant) -> ExecResult<bool>
pub fn cmp_gt(&self, other: &Variant) -> ExecResult<bool>
pub fn cmp_ge(&self, other: &Variant) -> ExecResult<bool>
sourceimpl Variant
impl Variant
pub fn as_meta(&self) -> impl MetaObject + '_
pub fn type_tag(&self) -> Type
pub fn type_name(&self) -> ExecResult<StringValue>
sourceimpl Variant
impl Variant
pub fn as_bool(&self) -> ExecResult<bool>
pub fn as_bits(&self) -> ExecResult<IntType>
pub fn as_int(&self) -> ExecResult<IntType>
pub fn as_float(&self) -> ExecResult<FloatType>
pub fn len(&self) -> ExecResult<usize>
pub fn is_empty(&self) -> ExecResult<bool>
pub fn invoke(&self, args: &[Variant]) -> ExecResult<Call>
pub fn fmt_echo(&self) -> ExecResult<StringValue>
pub fn fmt_str(&self) -> ExecResult<StringValue>
Trait Implementations
sourceimpl From<NativeFunction> for Variant
impl From<NativeFunction> for Variant
sourcefn from(func: NativeFunction) -> Self
fn from(func: NativeFunction) -> Self
Converts to this type from the input type.
sourceimpl From<StringSymbol> for Variant
impl From<StringSymbol> for Variant
sourcefn from(symbol: StringSymbol) -> Self
fn from(symbol: StringSymbol) -> Self
Converts to this type from the input type.
sourceimpl From<StringValue> for Variant
impl From<StringValue> for Variant
sourcefn from(value: StringValue) -> Self
fn from(value: StringValue) -> Self
Converts to this type from the input type.
sourceimpl<'a> TryFrom<&'a Variant> for VariantKey<'a>
impl<'a> TryFrom<&'a Variant> for VariantKey<'a>
type Error = Box<RuntimeError, Global>
type Error = Box<RuntimeError, Global>
The type returned in the event of a conversion error.
sourcefn try_from(value: &'a Variant) -> ExecResult<Self>
fn try_from(value: &'a Variant) -> ExecResult<Self>
Performs the conversion.
impl Copy for Variant
Auto Trait Implementations
impl !RefUnwindSafe for Variant
impl !Send for Variant
impl !Sync for Variant
impl Unpin for Variant
impl !UnwindSafe for Variant
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more