[][src]Struct rosy::Float

#[repr(transparent)]
pub struct Float(_);

An instance of Ruby's Float class.

Methods

impl Float[src]

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

Performs a lossless conversion of self into an f64.

pub fn to_f32(self) -> f32[src]

Performs a lossy conversion of self into an f32.

Trait Implementations

impl Object for Float[src]

unsafe fn from_raw(raw: usize) -> Self[src]

Creates a new object from raw without checking. Read more

unsafe fn cast_unchecked(obj: impl Object) -> Self[src]

Casts obj to Self without checking its type.

fn into_any_object(self) -> AnyObject[src]

Returns self as an AnyObject.

fn as_any_object(&self) -> &AnyObject[src]

Returns a reference to self as an AnyObject.

fn as_any_slice(&self) -> &[AnyObject][src]

Returns self as a reference to a single-element slice.

fn raw(self) -> usize[src]

Returns the raw object pointer.

unsafe fn as_unchecked<O: Object>(&self) -> &O[src]

Casts self to O without checking whether it is one.

unsafe fn into_unchecked<O: Object>(self) -> O[src]

Converts self to O without checking whether it is one.

fn id(self) -> u64[src]

Returns the object's identifier.

fn class(self) -> Class<Self>[src]

Returns the Class for self. Read more

fn singleton_class(self) -> Class<Self>[src]

Returns the singleton Class of self, creating one if it doesn't exist already. Read more

fn mark(self)[src]

Marks self for Ruby to avoid garbage collecting it.

unsafe fn force_recycle(self)[src]

Forces the garbage collector to free the contents of self. Read more

fn def_singleton_method<N, F>(self, name: N, f: F) -> Result where
    N: Into<SymbolId>,
    F: MethodFn<Self>, 
[src]

Defines a method for name on the singleton class of self that calls f when invoked. Read more

unsafe fn def_singleton_method_unchecked<N, F>(self, name: N, f: F) where
    N: Into<SymbolId>,
    F: MethodFn<Self>, 
[src]

Defines a method for name on the singleton class of self that calls f when invoked. Read more

unsafe fn call(self, method: impl Into<SymbolId>) -> AnyObject[src]

Calls method on self and returns its output. Read more

unsafe fn call_protected(self, method: impl Into<SymbolId>) -> Result<AnyObject>[src]

Calls method on self and returns its output, or an exception if one is raised. Read more

unsafe fn call_with(
    self,
    method: impl Into<SymbolId>,
    args: &[impl Object]
) -> AnyObject
[src]

Calls method on self with args and returns its output. Read more

unsafe fn call_with_protected(
    self,
    method: impl Into<SymbolId>,
    args: &[impl Object]
) -> Result<AnyObject>
[src]

Calls method on self with args and returns its output, or an exception if one is raised. Read more

unsafe fn call_public(self, method: impl Into<SymbolId>) -> AnyObject[src]

Calls the public method on self and returns its output. Read more

unsafe fn call_public_protected(
    self,
    method: impl Into<SymbolId>
) -> Result<AnyObject>
[src]

Calls the public method on self and returns its output, or an exception if one is raised. Read more

unsafe fn call_public_with(
    self,
    method: impl Into<SymbolId>,
    args: &[impl Object]
) -> AnyObject
[src]

Calls the public method on self with args and returns its output. Read more

unsafe fn call_public_with_protected(
    self,
    method: impl Into<SymbolId>,
    args: &[impl Object]
) -> Result<AnyObject>
[src]

Calls the public method on self with args and returns its output, or an exception if one is raised. Read more

fn inspect(self) -> String[src]

Returns a printable string representation of self. Read more

fn to_s(self) -> String[src]

Returns the result of calling the to_s method on self.

fn is_frozen(self) -> bool[src]

Returns whether modifications can be made to self.

fn freeze(self)[src]

Freezes self, preventing any further mutations.

fn is_eql<O: Object>(self, other: &O) -> bool[src]

Returns whether self is equal to other in terms of the eql? method. Read more

fn get_attr<N: Into<SymbolId>>(self, name: N) -> AnyObject[src]

Returns the value for the attribute of self associated with name.

unsafe fn eval(self, args: impl EvalArgs) -> AnyObject[src]

Evaluates args in the context of self. Read more

unsafe fn eval_protected(self, args: impl EvalArgs) -> Result<AnyObject>[src]

Evaluates args in the context of self, returning any raised exceptions. Read more

impl PartialEq<Float> for Float[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl PartialEq<AnyObject> for Float[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl PartialEq<f64> for Float[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl PartialEq<f32> for Float[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl PartialEq<Float> for f64[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl PartialEq<Float> for f32[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl PartialEq<Integer> for Float[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl Copy for Float[src]

impl Clone for Float[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl PartialOrd<Float> for Float[src]

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl PartialOrd<f64> for Float[src]

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl PartialOrd<f32> for Float[src]

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl PartialOrd<Float> for f64[src]

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl PartialOrd<Float> for f32[src]

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl PartialOrd<Integer> for Float[src]

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl PartialOrd<Float> for Integer[src]

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl AsRef<AnyObject> for Float[src]

impl From<Float> for AnyObject[src]

impl From<f64> for Float[src]

impl From<f32> for Float[src]

impl From<Float> for f64[src]

impl From<u32> for Float[src]

impl From<i32> for Float[src]

impl From<u16> for Float[src]

impl From<i16> for Float[src]

impl From<u8> for Float[src]

impl From<i8> for Float[src]

impl Debug for Float[src]

impl Display for Float[src]

impl Sub<Float> for Float[src]

type Output = Self

The resulting type after applying the - operator.

impl Sub<f64> for Float[src]

type Output = Self

The resulting type after applying the - operator.

impl Sub<Float> for f64[src]

type Output = Float

The resulting type after applying the - operator.

impl Add<Float> for Float[src]

type Output = Self

The resulting type after applying the + operator.

impl Add<f64> for Float[src]

type Output = Self

The resulting type after applying the + operator.

impl Add<Float> for f64[src]

type Output = Float

The resulting type after applying the + operator.

impl Mul<Float> for Float[src]

type Output = Self

The resulting type after applying the * operator.

impl Mul<f64> for Float[src]

type Output = Self

The resulting type after applying the * operator.

impl Mul<Float> for f64[src]

type Output = Float

The resulting type after applying the * operator.

impl Div<Float> for Float[src]

type Output = Self

The resulting type after applying the / operator.

impl Div<f64> for Float[src]

type Output = Self

The resulting type after applying the / operator.

impl Div<Float> for f64[src]

type Output = Float

The resulting type after applying the / operator.

impl Rem<Float> for Float[src]

type Output = Self

The resulting type after applying the % operator.

impl Rem<f64> for Float[src]

type Output = Self

The resulting type after applying the % operator.

impl Rem<Float> for f64[src]

type Output = Float

The resulting type after applying the % operator.

Auto Trait Implementations

impl !Send for Float

impl !Sync for Float

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

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

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

impl<T> From<T> for T[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.

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

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

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