Trait emacs::Transfer[][src]

pub trait Transfer: Sized {
    fn type_name() -> &'static str;

    unsafe extern "C" fn finalizer(ptr: *mut c_void) { ... }
}

Allowing a type to be exposed to Lisp, where its values appear as opaque objects, or "embedded user pointers" (printed as #<user-ptr ...>).

When a (boxed) value of this type is transferred to Lisp, the GC becomes its owner. Afterwards, module code can only access it through immutable references.

Required Methods

Returns the name of this type. This is used to report runtime type error, when a function expects this type, but some Lisp code passes a different type of "user pointer".

Provided Methods

Finalizes a value. This is called by the GC when it discards a value of this type. Module code that needs custom destructor logic should implement Drop, instead of overriding this.

This function also serves as a form of runtime type tag.

Implementations on Foreign Types

impl<T> Transfer for RefCell<T>
[src]

impl<T> Transfer for Mutex<T>
[src]

impl<T> Transfer for RwLock<T>
[src]

Implementors