Struct rurust::value::Value[][src]

#[repr(transparent)]pub struct Value(pub VALUE);

A Ruby value.

Implementations

impl Value[src]

pub fn nil() -> Self[src]

Gets nil.

pub fn boolean(b: bool) -> Self[src]

Gets a boolean value.

pub fn boolean_true() -> Self[src]

Gets the boolean true value.

pub fn boolean_false() -> Self[src]

Gets the boolean false value.

pub fn symbol<S>(name: S) -> Self where
    S: AsRef<str>, 
[src]

Creates a new symbol.

pub fn string<S>(s: S) -> Self where
    S: AsRef<str>, 
[src]

Creates a new String.

pub fn integer<I>(v: I) -> Self where
    I: Into<i64>, 
[src]

Creates a new Integer.

pub fn float<F>(v: F) -> Self where
    F: Into<f64>, 
[src]

Creates a new Float.

pub fn to_sym(&self) -> Value[src]

Converts the value into a symbol.

pub fn to_i64(&self) -> i64[src]

Converts the value to a 64-bit signed integer.

pub fn to_u64(&self) -> u64[src]

Converts the value to a 64-bit unsigned integer.

pub fn to_f64(&self) -> f64[src]

Converts the value into a 64-bit float.

pub fn class(&self) -> Value[src]

Gets the class.

pub fn nested_class<S>(self, name: S) -> Class where
    S: Into<String>, 
[src]

Creates a nested class.

pub fn nested_module<S>(self, name: S) -> Module where
    S: Into<String>, 
[src]

Creates a nested module.

pub fn display_string(&self) -> String[src]

The value of Object#to_s.

pub fn inspect_string(&self) -> String[src]

The value of Object#inspect.

pub fn class_name(&self) -> String[src]

Gets the name of the class of the object.

pub fn is_nil(&self) -> bool[src]

Checks if the value is nil.

pub fn is_true(&self) -> bool[src]

Checks if the value is true.

pub fn is_false(&self) -> bool[src]

Checks if the value is false.

pub fn is_string(&self) -> bool[src]

Checks if the value is a String type.

pub fn is_regex(&self) -> bool[src]

Checks if the value is a regex.

pub fn is_integer(&self) -> bool[src]

Checks if the value is an Integer type.

pub fn is_complex_number(&self) -> bool[src]

Checks if the value is a complex number.

pub fn is_rational(&self) -> bool[src]

Checks if the value is a rational number.

pub fn is_symbol(&self) -> bool[src]

Checks if the value is a symbol.

pub fn is_float(&self) -> bool[src]

Checks if the value is a float.

pub fn is_array(&self) -> bool[src]

Checks if the value is an array.

pub fn is_hash(&self) -> bool[src]

Checks if the value is a hash.

pub fn is_object(&self) -> bool[src]

Checks if the value is an object.

pub fn is_class(&self) -> bool[src]

Checks if the value is a class.

pub fn is_struct(&self) -> bool[src]

Checks if the value is a Struct.

pub fn is_module(&self) -> bool[src]

Checks if the value is a module.

pub fn is_equal_to(&self, other: Self) -> Self[src]

Ruby's version of '=='

pub fn as_string(&self) -> Option<String>[src]

Converts a Ruby String into a Rust String. Returns None if the value is not a Ruby String.

pub fn call_no_args(&self, method_name: &str) -> Self[src]

Calls a method with no args.

pub fn send(&self, method_name: &str, args: &[Self]) -> Self[src]

Sends a message to the value.

pub fn get_ivar(&self, name: &str) -> Self[src]

Gets the value of an instance variable by name. Returns nil if it doesn't exist.

pub fn set_ivar(&self, name: &str, value: Self) -> Self[src]

Sets the value of an instance variable (or creates a new one).

Trait Implementations

impl Clone for Value[src]

impl Copy for Value[src]

impl Debug for Value[src]

impl Display for Value[src]

impl Eq for Value[src]

impl From<VALUE> for Value[src]

impl PartialEq<Value> for Value[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.