[][src]Struct glsp::Obj

pub struct Obj { /* fields omitted */ }

The obj primitive type.

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

Implementations

impl Obj[src]

pub fn kill(&self) -> Result<(), GError>[src]

Kills the object.

Equivalent to (obj-kill! ob).

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

Returns true if the object has been killed.

Equivalent to (obj-killed? ob).

pub fn freeze(&self)[src]

Makes the object immutable.

Equivalent to (freeze! ob).

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

Returns true if the object has been frozen.

pub fn class(&self) -> Root<Class>[src]

Returns the object's class.

Equivalent to (class-of ob).

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

Returns true if the object is an instance of the given class or mixin.

Equivalent to (is? ob cls).

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

Returns true if the given name is currently bound to a field, constant or property.

Equivalent to (has? ob key).

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

Returns true if the given name is currently bound to a method.

Equivalent to (has-meth? ob key).

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

Accesses the value of a field, constant or property.

Equivalent to [ob 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 field, constant or property, if it exists.

Equivalent to [ob (? key)].

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

Creates an indexing iterator for this collection.

Equivalent to [ob iter].

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

Equivalent to (call-meth ob key ..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]

Invokes a method, if it exists.

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

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

Mutates the field or property bound to the given name.

Equivalent to (= [ob key] value).

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

Mutates the field or property bound to the given name, if any. Returns true if the field or property exists.

Equivalent to (= [ob (? key)] value).

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

Returns true if the object's class defines a state with the given name, even if it's not currently enabled.

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

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

Returns true if a state is currently enabled.

Equivalent to (enab? ob state-name).

pub fn enab<S, A>(&self, state_name: S, args: &A) -> Result<(), GError> where
    A: ToCallArgs + ?Sized,
    S: ToSym
[src]

Enables a state.

Equivalent to (enab! ob state-name).

pub fn disab<S>(&self, state_name: S) -> Result<(), GError> where
    S: ToSym
[src]

Disables a state.

Equivalent to (disab! ob state-name).

pub fn try_eq(&self, other: &Root<Obj>) -> Result<bool, GError>[src]

Equivalent to (eq? self other).

Note that, because this may invoke an op-eq? method, it can potentially fail.

The same is true for PartialEq comparisons between objects using Rust's == operator. In that case, if an error occurs, the operator will panic.

Trait Implementations

impl Debug for Obj[src]

impl Display for Obj[src]

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

impl PartialEq<Root<Obj>> for Obj[src]

Auto Trait Implementations

impl !GSend for Obj

impl GStore for Obj

impl !RefUnwindSafe for Obj

impl !Send for Obj

impl !Sync for Obj

impl Unpin for Obj

impl !UnwindSafe for Obj

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.