pub enum RubyValue {
Nil,
Boolean(bool),
Integer(i32),
Float(f64),
String(String),
Symbol(String),
Array(Vec<RubyValue>),
Hash(HashMap<String, RubyValue>),
Object(String, HashMap<String, RubyValue>),
Closure(usize),
}Expand description
Ruby value type
Variantsยง
Nil
Nil value
Boolean(bool)
Boolean value
Integer(i32)
Integer value
Float(f64)
Float value
String(String)
String value
Symbol(String)
Symbol value
Array(Vec<RubyValue>)
Array value
Hash(HashMap<String, RubyValue>)
Hash value
Object(String, HashMap<String, RubyValue>)
Object value
Closure(usize)
Closure value
Implementationsยง
Sourceยงimpl RubyValue
impl RubyValue
Sourcepub fn mark(&self, marked: &mut HashSet<*const RubyValue>)
pub fn mark(&self, marked: &mut HashSet<*const RubyValue>)
Mark this value and all referenced values
Sourcepub fn array_length(&self) -> Option<usize>
pub fn array_length(&self) -> Option<usize>
Get array length
Sourcepub fn array_set(&mut self, index: usize, value: RubyValue) -> Option<()>
pub fn array_set(&mut self, index: usize, value: RubyValue) -> Option<()>
Set array element at index
Sourcepub fn hash_values(&self) -> Option<Vec<RubyValue>>
pub fn hash_values(&self) -> Option<Vec<RubyValue>>
Get hash values
Sourcepub fn object_get(&self, field: &str) -> Option<RubyValue>
pub fn object_get(&self, field: &str) -> Option<RubyValue>
Get object field
Trait Implementationsยง
Sourceยงimpl<'de> Deserialize<'de> for RubyValue
impl<'de> Deserialize<'de> for RubyValue
Sourceยงfn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for RubyValue
Auto Trait Implementationsยง
impl Freeze for RubyValue
impl RefUnwindSafe for RubyValue
impl Send for RubyValue
impl Sync for RubyValue
impl Unpin for RubyValue
impl UnsafeUnpin for RubyValue
impl UnwindSafe for RubyValue
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