[][src]Struct glsp::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.

Implementations

impl Class[src]

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

Accesses the value of a constant.

Equivalent to [cls key].

pub fn get_if_present<S, V>(&self, key: S) -> Result<Option<V>, GError> where
    S: ToSym,
    V: FromVal
[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) -> Result<R, GError> where
    A: ToCallArgs + ?Sized,
    R: FromVal,
    S: ToSym
[src]

Invokes a callable value stored in a constant.

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

pub fn call_if_present<S, A, R>(
    &self,
    key: S,
    args: &A
) -> Result<Option<R>, GError> where
    A: ToCallArgs + ?Sized,
    R: FromVal,
    S: ToSym
[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.

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

pub fn has_meth<S>(&self, key: S) -> Result<bool, GError> where
    S: ToSym
[src]

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

Equivalent to (has-meth? cls key).

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

Creates an indexing iterator for this collection.

Equivalent to [cls iter].

pub fn has<S>(&self, key: S) -> Result<bool, GError> where
    S: ToSym
[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>(&self, state_name: S) -> Result<bool, GError> where
    S: ToSym
[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>[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]

impl<'a, 'r> MakeArg<'a> for &'r Class where
    'a: 'r, 
[src]

Auto Trait Implementations

impl !GSend for Class

impl GStore for Class

impl !RefUnwindSafe for Class

impl !Send for Class

impl !Sync for Class

impl Unpin for Class

impl !UnwindSafe for Class

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

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.