[][src]Struct emacs::Env

pub struct Env { /* fields omitted */ }

Main point of interaction with the Lisp runtime.

Methods

impl Env[src]

Public APIs.

pub fn intern(&self, name: &str) -> Result<Value>[src]

pub fn type_of(&self, value: Value) -> Result<Value>[src]

pub fn is_not_nil(&self, value: Value) -> bool[src]

Deprecated since 0.10.0:

Please use value.is_not_nil() instead

pub fn eq(&self, a: Value, b: Value) -> bool[src]

Deprecated since 0.10.0:

Please use value1.eq(value2) instead

pub fn provide(&self, name: &str) -> Result<Value>[src]

pub fn message<T: AsRef<str>>(&self, text: T) -> Result<Value>[src]

impl Env[src]

pub fn call<'e, F, A>(&'e self, func: F, args: A) -> Result<Value> where
    F: IntoLispCallable<'e>,
    A: IntoLispArgs<'e>, 
[src]

Calls a Lisp function, passing the given arguments.

  • func should be a string, or a Lisp's callable Value (in which case func.call is preferable). An error is signaled otherwise.
  • args should be an array/slice of Value, or a tuple of different types, each implementing IntoLisp.

Examples

#[defun]
fn listify_vec(vector: Vector) -> Result<Value> {
    let env = vector.0.env;
    let mut args = vec![];
    for i in 0..vector.size()? {
        args.push(vector.get(i)?)
    }
    env.call("list", &args)
}

pub fn list<'e, A>(&'e self, args: A) -> Result<Value> where
    A: IntoLispArgs<'e>, 
[src]

Trait Implementations

impl Drop for Env[src]

impl Debug for Env[src]

Auto Trait Implementations

impl !Sync for Env

impl !Send for Env

impl Unpin for Env

impl !RefUnwindSafe for Env

impl UnwindSafe for Env

Blanket Implementations

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[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.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]