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_methodfunction from a list of methods. - extension
- Generates the boilerplate code for a
jyafnextension. - get_
method_ ptr - A convenience macro to get references to methods created with
method. - layout
- Builds a
Layoutusng the jyafn layout display notation. - method
- A safe convenience macro for method call. This macro does three things for you:
- paste
- Reexporting from the
pastecrate. 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
Structlayout out of a collection of keys and values. - struct_
field - Builds a
Structfield, given a key and a value layout.
Structs§
- Input
- A convenience wrapper over the input data pointer, given the information on its size.
- Input
Reader - 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.
- Output
Builder - 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
strptimeformat for ISO 8601, the standard used in theLayout::DateTimevariant.
Traits§
- Resource
- A
Resourceis 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.