Struct rurust::builder::klass::Class[][src]

pub struct Class { /* fields omitted */ }

A class builder.

Implementations

impl Class[src]

pub fn new<S>(name: S) -> Self where
    S: Into<String>, 
[src]

pub fn new_under<S>(name: S, parent: Option<Value>) -> Self where
    S: Into<String>, 
[src]

pub fn under(self, parent: Value) -> Self[src]

Creates the class under a value. This may be a class, a module, etc.

pub fn extend(self, base_class: Value) -> Self[src]

Sets the base class.

pub fn include(self, module: Value) -> Self[src]

Includes a module.

pub fn prepend(self, module: Value) -> Self[src]

Prepends a module.

pub fn method<S>(
    self,
    name: S,
    func_addr: *mut extern "C" fn() -> Value,
    arg_count: i8
) -> Self where
    S: Into<String>, 
[src]

Defines a method.

pub fn singleton_method<S>(
    self,
    name: S,
    func_addr: *mut extern "C" fn() -> Value,
    arg_count: i8
) -> Self where
    S: Into<String>, 
[src]

Defines a singleton method.

pub fn constant<S>(self, name: S, value: Value) -> Self where
    S: Into<String>, 
[src]

Defines a constant.

pub fn alias<S1, S2>(self, new_name: S1, original_name: S2) -> Self where
    S1: Into<String>,
    S2: Into<String>, 
[src]

Creates an alias method.

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

Creates getter and setter methods for an ivar.

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

Creates a getter method for an ivar.

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

Creates a setter method for an ivar.

pub fn build(self) -> Value[src]

Builds the class.

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, 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.