#![deny(rustdoc::missing_crate_level_docs)]
#![deny(missing_docs)]
#![deny(missing_debug_implementations)]
#![doc = include_str!("../Readme.md")]
#![doc(html_logo_url = "https://avatars.githubusercontent.com/u/11549616")]
#![doc(html_favicon_url = "https://avatars.githubusercontent.com/u/11549616")]
use num::BigInt;
use std::collections::BTreeMap;
mod error;
mod extensions;
mod functions;
mod traits;
mod utils;
pub use crate::{
error::{Result, WolframError},
extensions::*,
functions::WolframFunction,
utils::*,
};
pub trait ToWolfram {
fn to_wolfram(&self) -> WolframValue;
fn to_wolfram_string(&self) -> String {
self.to_wolfram().to_string()
}
fn to_wolfram_bytes(&self) -> Vec<u8> {
self.to_wolfram().to_bytes()
}
fn to_wolfram_solid(&self) -> Vec<u8> {
self.to_wolfram().to_compressed()
}
}
#[derive(Debug, Clone, PartialEq, Eq, Ord, PartialOrd)]
pub enum WolframValue {
Skip,
Function(Box<WolframFunction>),
Boolean(bool),
String(String),
Bytes(Vec<u8>),
Symbol(String),
Integer8(i8),
Integer16(i16),
Integer32(i32),
Integer64(i64),
BigInteger(BigInt),
Decimal64([u8; 8]),
BigDecimal(String),
PackedArray(Vec<WolframValue>),
NumericArray(Vec<WolframValue>),
Association(BTreeMap<WolframValue, (WolframValue, WolframValue)>),
Rule,
RuleDelayed,
}