Skip to main content

Plistable

Trait Plistable 

Source
pub trait Plistable {
    // Required methods
    fn from_plist(
        ctx: &mut TulispContext,
        obj: &TulispObject,
    ) -> Result<Self, Error>
       where Self: Sized;
    fn into_plist(self, ctx: &mut TulispContext) -> TulispObject;
}
Expand description

Conversion between a Rust struct and a Lisp plist.

Implement this trait to use a struct as the argument type of a defun-registered function via Plist<T>.

The AsPlist! macro generates this implementation automatically from a struct definition.

Required Methods§

Source

fn from_plist( ctx: &mut TulispContext, obj: &TulispObject, ) -> Result<Self, Error>
where Self: Sized,

Deserialize obj (a Lisp plist) into Self.

Source

fn into_plist(self, ctx: &mut TulispContext) -> TulispObject

Serialize self into a Lisp plist.

Implementors§