pub enum Value {
Void,
Null,
True,
False,
Int(BigInt),
Float(f64),
Object(BoxedObject),
}
Variants§
Implementations§
source§impl 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, Error>
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, Error>
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, Error>
pub fn tokay_method_float( 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, Error>
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, Error>
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, Error>
pub fn tokay_method_float_fract( context: Option<&mut Context<'_, '_, '_, '_>>, args: Vec<RefValue>, nargs: Option<Dict> ) -> Result<Accept, Reject>
Trait Implementations§
source§impl Object for Value
impl Object for Value
source§fn is_callable(&self, without_arguments: bool) -> bool
fn is_callable(&self, without_arguments: bool) -> bool
Check whether the object is callable.
source§fn is_consuming(&self) -> bool
fn is_consuming(&self) -> bool
Check whether the object is consuming
source§fn is_nullable(&self) -> bool
fn is_nullable(&self) -> bool
Check whether the object is nullable
source§fn is_mutable(&self) -> bool
fn is_mutable(&self) -> bool
Check whether the object is mutable in itself. Read more
source§fn is_hashable(&self) -> bool
fn is_hashable(&self) -> bool
Check whether the object is hashable. Read more
source§fn call(
&self,
context: Option<&mut Context<'_, '_, '_, '_>>,
args: Vec<RefValue>,
nargs: Option<Dict>
) -> Result<Accept, Reject>
fn call( &self, context: Option<&mut Context<'_, '_, '_, '_>>, args: Vec<RefValue>, nargs: Option<Dict> ) -> Result<Accept, Reject>
Call object with optional context, arguments and named arguments set.
source§impl Ord for Value
impl Ord for Value
source§impl PartialEq for Value
impl PartialEq for Value
source§impl PartialOrd for Value
impl PartialOrd for Value
1.0.0 · source§fn 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 moreimpl Eq for Value
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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.