[−][src]Struct glsp_engine::Obj
The obj
primitive type.
Note that CallableOps
is implemented for Root<Class>
, so an
Obj
can be constructed from a Class
using glsp::call
.
Objects are always stored on the garbage-collected heap, so they're normally represented by
the type Root<Obj>
.
Implementations
impl Obj
[src]
pub fn kill(&self) -> GResult<()>
[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: ToSym>(&self, key: S) -> GResult<bool>
[src]
Returns true
if the given name is currently bound to a field, constant or property.
Equivalent to (has? ob key)
.
pub fn has_met<S: ToSym>(&self, key: S) -> GResult<bool>
[src]
Returns true
if the given name is currently bound to a method.
Equivalent to (has-met? ob key)
.
pub fn get<S: ToSym, V: FromVal>(&self, key: S) -> GResult<V>
[src]
Accesses the value of a field, constant or property.
Equivalent to [ob key]
.
pub fn get_if_present<S: ToSym, V: FromVal>(&self, key: S) -> GResult<Option<V>>
[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) -> GResult<R> where
S: ToSym,
A: IntoCallArgs,
R: FromVal,
[src]
S: ToSym,
A: IntoCallArgs,
R: FromVal,
Invokes a method.
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 ob key ..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]
S: ToSym,
A: IntoCallArgs,
R: FromVal,
Invokes a method, if it exists.
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 ob (? key) ..args)
.
pub fn set<S: ToSym, V: IntoVal>(&self, key: S, value: V) -> GResult<()>
[src]
Mutates the field or property bound to the given name.
Equivalent to (= [ob key] value)
.
pub fn set_if_present<S: ToSym, V: IntoVal>(
&self,
key: S,
value: V
) -> GResult<bool>
[src]
&self,
key: S,
value: V
) -> GResult<bool>
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: ToSym>(&self, state_name: S) -> GResult<bool>
[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: ToSym>(&self, state_name: S) -> GResult<bool>
[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) -> GResult<()> where
S: ToSym,
A: Clone + IntoCallArgs,
[src]
S: ToSym,
A: Clone + IntoCallArgs,
Enables a state.
Equivalent to (enab! ob state-name)
.
pub fn disab<S: ToSym>(&self, state_name: S) -> GResult<()>
[src]
Disables a state.
Equivalent to (disab! ob state-name)
.
pub fn try_eq(&self, other: &Root<Obj>) -> GResult<bool>
[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
Auto Trait Implementations
impl !RefUnwindSafe for Obj
[src]
impl !Send for Obj
[src]
impl !Sync for Obj
[src]
impl Unpin for Obj
[src]
impl !UnwindSafe for Obj
[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> Erased for 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> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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>,