Crate openmath

Source
Expand description

A comprehensive Rust library for handling OpenMath objects, providing

  • An OpenMath data structure and
  • almost zero-copy (de)serialization for various OpenMath formats, including specification-compliant XML, JSON, and arbitrary other formats via serde.

§Serialization & Deserialization

  • OMSerializable trait for converting Rust types to OpenMath
  • OMDeserializable trait for parsing OpenMath into Rust types
  • (with serde feature enabled:) support for serde-based formats (JSON, etc.) following the OpenMath JSON specification (see openmath_serde and OMFromSerde).
  • specification-conform XML (de)serialization

§TODO

  • structure sharing via OMR
  • binary format
  • official errors

§Features

  • serde — Adds serde support

Re-exports§

pub use ser::OMSerializable;
pub use de::OM;
pub use de::OMDeserializable;
pub use either;

Modules§

base64
Opinionated implementation of Base64 encoding/decoding as adapters over Iterators, rather than on pre-allocated byte slices/Vecs/string types
de
OpenMath Deserialization; OMDeserializable and related types
ser
OpenMath Serialization; OMSerializable and related types

Structs§

Attr
An attribute in an OMATTR
BoundVariable
A bound variable in an OMBIND
Int
An arbitrary precision integer optimized for small values.

Enums§

OMKind
All OpenMath tags/kinds
OMMaybeForeign
Either an OpenMath Expression or an OMFOREIGN.
OpenMath
Enum representing all possible OᴘᴇɴMᴀᴛʜ objects.

Constants§

CD_BASE
The base URI of official OᴘᴇɴMᴀᴛʜ dictionaries (http://www.openmath.org/cd)
XML_NS
XML namespace for OpenMath elements