Struct rurust::builder::klass::Class [−][src]
A class builder.
Implementations
impl Class
[src]
pub fn new<S>(name: S) -> Self where
S: Into<String>,
[src]
S: Into<String>,
pub fn new_under<S>(name: S, parent: Option<Value>) -> Self where
S: Into<String>,
[src]
S: Into<String>,
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]
self,
name: S,
func_addr: *mut extern "C" fn() -> Value,
arg_count: i8
) -> Self where
S: Into<String>,
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]
self,
name: S,
func_addr: *mut extern "C" fn() -> Value,
arg_count: i8
) -> Self where
S: Into<String>,
Defines a singleton method.
pub fn constant<S>(self, name: S, value: Value) -> Self where
S: Into<String>,
[src]
S: Into<String>,
Defines a constant.
pub 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.
pub fn attr_accessor<S>(self, name: S) -> Self where
S: Into<String>,
[src]
S: Into<String>,
Creates getter and setter methods for an ivar.
pub fn attr_reader<S>(self, name: S) -> Self where
S: Into<String>,
[src]
S: Into<String>,
Creates a getter method for an ivar.
pub fn attr_writer<S>(self, name: S) -> Self where
S: Into<String>,
[src]
S: Into<String>,
Creates a setter method for an ivar.
pub fn build(self) -> Value
[src]
Builds the class.
Auto Trait Implementations
impl RefUnwindSafe for Class
[src]
impl !Send for Class
[src]
impl !Sync for Class
[src]
impl Unpin for Class
[src]
impl UnwindSafe for Class
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,