pub enum Value {
Void,
Null,
True,
False,
Int(i64),
Float(f64),
Addr(usize),
Object(BoxedObject),
}
Variants
Void
Null
True
False
Int(i64)
Float(f64)
Addr(usize)
Object(BoxedObject)
Implementations
sourceimpl Value
impl Value
sourcepub fn object_mut<T: Any>(&mut self) -> Option<&mut T>
pub fn object_mut<T: Any>(&mut self) -> Option<&mut T>
Return mutable reference to object of type T.
sourcepub fn into_object<T: Any>(self) -> Option<T>
pub fn into_object<T: Any>(self) -> Option<T>
Extract object of type T from Val.
pub fn bool(
args: Vec<RefValue>,
nargs: Option<Dict>
) -> Result<RefValue, String>
pub fn tokay_method_bool(
_context: Option<&mut Context<'_, '_, '_, '_>>,
args: Vec<RefValue>,
nargs: Option<Dict>
) -> Result<Accept, Reject>
pub fn int(args: Vec<RefValue>, nargs: Option<Dict>) -> Result<RefValue, String>
pub fn tokay_method_int(
_context: Option<&mut Context<'_, '_, '_, '_>>,
args: Vec<RefValue>,
nargs: Option<Dict>
) -> Result<Accept, Reject>
pub fn float(
args: Vec<RefValue>,
nargs: Option<Dict>
) -> Result<RefValue, String>
pub fn tokay_method_float(
_context: Option<&mut Context<'_, '_, '_, '_>>,
args: Vec<RefValue>,
nargs: Option<Dict>
) -> Result<Accept, Reject>
pub fn addr(
args: Vec<RefValue>,
nargs: Option<Dict>
) -> Result<RefValue, String>
pub fn tokay_method_addr(
_context: Option<&mut Context<'_, '_, '_, '_>>,
args: Vec<RefValue>,
nargs: Option<Dict>
) -> Result<Accept, Reject>
pub fn float_ceil(
args: Vec<RefValue>,
nargs: Option<Dict>
) -> Result<RefValue, String>
pub fn tokay_method_float_ceil(
_context: Option<&mut Context<'_, '_, '_, '_>>,
args: Vec<RefValue>,
nargs: Option<Dict>
) -> Result<Accept, Reject>
pub fn float_trunc(
args: Vec<RefValue>,
nargs: Option<Dict>
) -> Result<RefValue, String>
pub fn tokay_method_float_trunc(
_context: Option<&mut Context<'_, '_, '_, '_>>,
args: Vec<RefValue>,
nargs: Option<Dict>
) -> Result<Accept, Reject>
pub fn float_fract(
args: Vec<RefValue>,
nargs: Option<Dict>
) -> Result<RefValue, String>
pub fn tokay_method_float_fract(
_context: Option<&mut Context<'_, '_, '_, '_>>,
args: Vec<RefValue>,
nargs: Option<Dict>
) -> Result<Accept, Reject>
Trait Implementations
sourceimpl Object for Value
impl Object for Value
sourcefn is_callable(&self, without_arguments: bool) -> bool
fn is_callable(&self, without_arguments: bool) -> bool
Check whether the object is callable.
sourcefn is_consuming(&self) -> bool
fn is_consuming(&self) -> bool
Check whether the object is consuming
sourcefn is_nullable(&self) -> bool
fn is_nullable(&self) -> bool
Check whether the object is nullable
sourceimpl PartialOrd<Value> for Value
impl PartialOrd<Value> for Value
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
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 · sourcefn lt(&self, other: &Rhs) -> bool
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 · sourcefn le(&self, other: &Rhs) -> bool
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
impl StructuralPartialEq for Value
Auto Trait Implementations
impl !RefUnwindSafe for Value
impl !Send for Value
impl !Sync for Value
impl Unpin for Value
impl !UnwindSafe for Value
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