Enum ruby_marshal::Value
source · pub enum Value {
Nil(NilValue),
Bool(BoolValue),
Fixnum(FixnumValue),
Symbol(SymbolValue),
Array(ArrayValue),
Hash(HashValue),
Object(ObjectValue),
String(StringValue),
UserDefined(UserDefinedValue),
}
Expand description
A Ruby Value
Variants§
Nil(NilValue)
Nil
Bool(BoolValue)
A Bool
Fixnum(FixnumValue)
A Fixnum
Symbol(SymbolValue)
A Symbol
Array(ArrayValue)
An Array
Hash(HashValue)
A hash value
Object(ObjectValue)
An Object
String(StringValue)
A String
UserDefined(UserDefinedValue)
A User Defined Value
Implementations§
source§impl Value
impl Value
sourcepub fn as_symbol(&self) -> Option<&SymbolValue>
pub fn as_symbol(&self) -> Option<&SymbolValue>
Get a ref to the SymbolValue
, if it is a symbol.
sourcepub fn as_object(&self) -> Option<&ObjectValue>
pub fn as_object(&self) -> Option<&ObjectValue>
Get a ref to the ObjectValue
, if it is an object.
sourcepub fn as_string(&self) -> Option<&StringValue>
pub fn as_string(&self) -> Option<&StringValue>
Get a ref to the StringValue
, if it is a string.
Trait Implementations§
source§impl From<ArrayValue> for Value
impl From<ArrayValue> for Value
source§fn from(value: ArrayValue) -> Self
fn from(value: ArrayValue) -> Self
Converts to this type from the input type.
source§impl From<FixnumValue> for Value
impl From<FixnumValue> for Value
source§fn from(value: FixnumValue) -> Self
fn from(value: FixnumValue) -> Self
Converts to this type from the input type.
source§impl From<ObjectValue> for Value
impl From<ObjectValue> for Value
source§fn from(value: ObjectValue) -> Self
fn from(value: ObjectValue) -> Self
Converts to this type from the input type.
source§impl From<StringValue> for Value
impl From<StringValue> for Value
source§fn from(value: StringValue) -> Self
fn from(value: StringValue) -> Self
Converts to this type from the input type.
source§impl From<SymbolValue> for Value
impl From<SymbolValue> for Value
source§fn from(value: SymbolValue) -> Self
fn from(value: SymbolValue) -> Self
Converts to this type from the input type.
source§impl From<UserDefinedValue> for Value
impl From<UserDefinedValue> for Value
source§fn from(value: UserDefinedValue) -> Self
fn from(value: UserDefinedValue) -> Self
Converts to this type from the input type.
source§impl<'a> FromValue<'a> for &'a Value
impl<'a> FromValue<'a> for &'a Value
source§fn from_value(
_ctx: &FromValueContext<'a>,
value: &'a Value,
) -> Result<Self, FromValueError>
fn from_value( _ctx: &FromValueContext<'a>, value: &'a Value, ) -> Result<Self, FromValueError>
Create this type from the given value from the
ValueArena
. Read moreAuto Trait Implementations§
impl Freeze for Value
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