pub struct Value(pub VALUE);
Expand description
A Ruby value.
Tuple Fields§
§0: VALUE
Implementations§
Source§impl Value
impl Value
Sourcepub fn boolean_true() -> Value
pub fn boolean_true() -> Value
Gets the boolean true
value.
Sourcepub fn boolean_false() -> Value
pub fn boolean_false() -> Value
Gets the boolean false
value.
Sourcepub fn nested_class<S>(self, name: S) -> Class
pub fn nested_class<S>(self, name: S) -> Class
Creates a nested class.
Sourcepub fn nested_module<S>(self, name: S) -> Module
pub fn nested_module<S>(self, name: S) -> Module
Creates a nested module.
Sourcepub fn display_string(&self) -> String
pub fn display_string(&self) -> String
The value of Object#to_s
.
Sourcepub fn inspect_string(&self) -> String
pub fn inspect_string(&self) -> String
The value of Object#inspect
.
Sourcepub fn class_name(&self) -> String
pub fn class_name(&self) -> String
Gets the name of the class of the object.
Sourcepub fn is_integer(&self) -> bool
pub fn is_integer(&self) -> bool
Checks if the value is an Integer
type.
Sourcepub fn is_complex_number(&self) -> bool
pub fn is_complex_number(&self) -> bool
Checks if the value is a complex number.
Sourcepub fn is_rational(&self) -> bool
pub fn is_rational(&self) -> bool
Checks if the value is a rational number.
Sourcepub fn is_equal_to(&self, other: Value) -> Value
pub fn is_equal_to(&self, other: Value) -> Value
Ruby’s version of ‘==’
Sourcepub fn as_string(&self) -> Option<String>
pub fn as_string(&self) -> Option<String>
Converts a Ruby String
into a Rust String
.
Returns None
if the value is not a Ruby String
.
Sourcepub fn call_no_args(&self, method_name: &str) -> Value
pub fn call_no_args(&self, method_name: &str) -> Value
Calls a method with no args.
Trait Implementations§
impl Copy for Value
impl Eq for Value
Auto 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