Crate jyafn_ext

Crate jyafn_ext 

Source
Expand description

This crate is intended to help extension authors. It exposes a minimal version of jyafn and many convenience macros to generate all the boilerplate involved.

Re-exports§

pub use serde_json;

Macros§

declare_methods
This macro provides a standard implementation for the Resource::get_method function from a list of methods.
extension
Generates the boilerplate code for a jyafn extension.
get_method_ptr
A convenience macro to get references to methods created with method.
layout
Builds a Layout usng the jyafn layout display notation.
method
A safe convenience macro for method call. This macro does three things for you:
paste
Reexporting from the paste crate. This is neeede because we have to programatically generate new identifiers to be used as symbols in the final shared object.
resource
Declares a single resource for this extension, given a type. This writes all the boilerplate code thar corresponds to the extension side of the API.
struct
Builds a Struct layout out of a collection of keys and values.
struct_field
Builds a Struct field, given a key and a value layout.

Structs§

Input
A convenience wrapper over the input data pointer, given the information on its size.
InputReader
A reader over an Input, which may help you in reading chunks of data from the input.
Method
A description on the method signature, to guide jyafn to generate the correct method call on this resource.
OutputBuilder
A convenience wrapper over the output data pointer, given the information on its size.
Struct
A struct is a kind of layout of ordered key-value pairs. Each value is layed out sequentially in memory.

Enums§

Layout
A layout is a how jyafn makes the correspondence of structured data (like, but not necessarily exactly JSON) and buffers of binary data.
Outcome
A type-erased result-like type to transport information on fallible operations safely across the FFI boundary.

Constants§

ISOFORMAT
The strptime format for ISO 8601, the standard used in the Layout::DateTime variant.

Traits§

Resource
A Resource is an amount of data associated with “methods”, much like an object in OO languages, but simpler. Specifically, resources shoud not (ever!) support mutation. Resources are immutable pices of data.