Trait spaik::FromLisp

source ·
pub trait FromLisp<T>: Sized {
    // Required method
    fn from_lisp(self, mem: &mut Arena) -> Result<T, Error>;
}
Expand description

The mem parameter is necessary here, because some of the conversions may need to create an SPV reference-counter

Required Methods§

source

fn from_lisp(self, mem: &mut Arena) -> Result<T, Error>

Implementors§

source§

impl<T> FromLisp<Gc<T>> for PVwhere T: Userdata,

Safety

This is safe for Userdata, because of the additional indirection. They are not stored inline by the GC, the GC only has a pointer to it. This means that unlike other PV ref-types the pointer does not move, and it is therefore sufficient to keep an SPV reference-counter to avoid dangling-pointer references.

source§

impl<T> FromLisp<Promise<T>> for PVwhere T: DeserializeOwned,

source§

impl<T> FromLisp<T> for PVwhere T: TryFrom<PV, Error = Error>,