Struct rurust::builder::klass::Class
[−]
[src]
pub struct Class { /* fields omitted */ }
A class builder.
Methods
impl Class
[src]
fn new<S>(name: S) -> Self where
S: Into<String>,
[src]
S: Into<String>,
fn new_under<S>(name: S, parent: Option<Value>) -> Self where
S: Into<String>,
[src]
S: Into<String>,
fn under(self, parent: Value) -> Self
[src]
Creates the class under a value. This may be a class, a module, etc.
fn extend(self, base_class: Value) -> Self
[src]
Sets the base class.
fn include(self, module: Value) -> Self
[src]
Includes a module.
fn prepend(self, module: Value) -> Self
[src]
Prepends a module.
fn method<S>(
self,
name: S,
func_addr: *mut extern "C" fn() -> Value,
arg_count: i8
) -> Self where
S: Into<String>,
[src]
self,
name: S,
func_addr: *mut extern "C" fn() -> Value,
arg_count: i8
) -> Self where
S: Into<String>,
Defines a method.
fn singleton_method<S>(
self,
name: S,
func_addr: *mut extern "C" fn() -> Value,
arg_count: i8
) -> Self where
S: Into<String>,
[src]
self,
name: S,
func_addr: *mut extern "C" fn() -> Value,
arg_count: i8
) -> Self where
S: Into<String>,
Defines a singleton method.
fn constant<S>(self, name: S, value: Value) -> Self where
S: Into<String>,
[src]
S: Into<String>,
Defines a constant.
fn alias<S1, S2>(self, new_name: S1, original_name: S2) -> Self where
S1: Into<String>,
S2: Into<String>,
[src]
S1: Into<String>,
S2: Into<String>,
Creates an alias method.
fn attr_accessor<S>(self, name: S) -> Self where
S: Into<String>,
[src]
S: Into<String>,
Creates getter and setter methods for an ivar.
fn attr_reader<S>(self, name: S) -> Self where
S: Into<String>,
[src]
S: Into<String>,
Creates a getter method for an ivar.
fn attr_writer<S>(self, name: S) -> Self where
S: Into<String>,
[src]
S: Into<String>,
Creates a setter method for an ivar.
fn build(self) -> Value
[src]
Builds the class.