Struct emacs::OnceGlobalRef
source · pub struct OnceGlobalRef { /* private fields */ }
Expand description
A GlobalRef
that can be initialized once. This is useful for long-lived values that should
be initialized when the dynamic module is loaded. A typical use case is specifying
frequently-used symbols, which can be done with the help of the macro use_symbols!
.
Implementations§
source§impl OnceGlobalRef
impl OnceGlobalRef
Methods from Deref<Target = GlobalRef>§
sourcepub fn call<'e, A>(&'e self, env: &'e Env, args: A) -> Result<Value<'_>>where
A: IntoLispArgs<'e>,
pub fn call<'e, A>(&'e self, env: &'e Env, args: A) -> Result<Value<'_>>where
A: IntoLispArgs<'e>,
Calls this reference’s value with the given arguments. An error is signaled if it is actually not a Lisp’s callable.
args
should be an array/slice of Value
, or a tuple of different types, each implementing
IntoLisp
.
sourcepub unsafe fn call_unprotected<'e, A>(
&'e self,
env: &'e Env,
args: A
) -> Result<Value<'_>>where
A: IntoLispArgs<'e>,
pub unsafe fn call_unprotected<'e, A>(
&'e self,
env: &'e Env,
args: A
) -> Result<Value<'_>>where
A: IntoLispArgs<'e>,
Trait Implementations§
source§impl Debug for OnceGlobalRef
impl Debug for OnceGlobalRef
source§impl Deref for OnceGlobalRef
impl Deref for OnceGlobalRef
Auto Trait Implementations§
impl !Freeze for OnceGlobalRef
impl RefUnwindSafe for OnceGlobalRef
impl Send for OnceGlobalRef
impl Sync for OnceGlobalRef
impl Unpin for OnceGlobalRef
impl UnwindSafe for OnceGlobalRef
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more