[][src]Struct glsp_engine::Class

pub struct Class { /* fields omitted */ }

The class primitive type.

Note that CallableOps is implemented for Root<Class>, so an Obj can be constructed from a Class using glsp::call.

Classes are always stored on the garbage-collected heap, so they're normally represented by the type Root<Class>.

Implementations

impl Class[src]

pub fn get<S: ToSym, V: FromVal>(&self, key: S) -> GResult<V>[src]

Accesses the value of a constant.

Equivalent to [cls key].

pub fn get_if_present<S: ToSym, V: FromVal>(&self, key: S) -> GResult<Option<V>>[src]

Accesses the value of a constant if it's defined.

Equivalent to [cls (? key)].

pub fn call<S, A, R>(&self, key: S, args: A) -> GResult<R> where
    S: ToSym,
    A: IntoCallArgs,
    R: FromVal
[src]

Invokes a callable value stored in a constant.

Note that the args are passed by reference. They should be a reference to (), a tuple, a slice, or a fixed-size array.

Equivalent to (call-met key cls ..args).

pub fn call_if_present<S, A, R>(&self, key: S, args: A) -> GResult<Option<R>> where
    S: ToSym,
    A: IntoCallArgs,
    R: FromVal
[src]

If a constant with the given name is defined, and if it stores a callable value, invokes it as a function and returns its result. Otherwise, returns None.

Note that the args are passed by reference. They should be a reference to (), a tuple, a slice, or a fixed-size array.

Equivalent to (call-met (? key) cls ..args).

pub fn has_met<S: ToSym>(&self, key: S) -> GResult<bool>[src]

Returns true if the given name is bound to a constant with a callable value.

Equivalent to (has-met? cls key).

pub fn access_giter(class: &Root<Class>, giter: &Root<GIter>) -> Root<GIter>

Notable traits for Root<GIter>

impl Iterator for Root<GIter> type Item = GResult<Val>;
[src]

Creates an indexing iterator for this collection.

Equivalent to [cls iter].

pub fn has<S: ToSym>(&self, key: S) -> GResult<bool>[src]

Returns true if the given name is bound to a constant.

Equivalent to (has? cls key).

pub fn name(&self) -> Option<Sym>[src]

Returns the name of the class, if any.

Equivalent to (class-name cls).

pub fn has_state<S: ToSym>(&self, state_name: S) -> GResult<bool>[src]

Returns true if the class defines a state with the given name.

Equivalent to (has-state? cls state-name).

pub fn has_mixin(&self, mixin: &Root<Class>) -> bool[src]

Returns true if the class incorporated the given class as a mixin.

Equivalent to (class-has-mixin? cls mixin).

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

Returns true if the class is a mixin.

Equivalent to (mixin? cls).

pub fn mixins(&self) -> Root<Arr>

Notable traits for Root<GIter>

impl Iterator for Root<GIter> type Item = GResult<Val>;
[src]

Returns all of the class' mixins, as an Arr.

Equivalent to (class-mixins cls).

Trait Implementations

impl Debug for Class[src]

impl Display for Class[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> Erased for T[src]

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

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

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.