parse_rust_core/lib.rs
1//! Parse type system, JSON encoding and error codes. No I/O.
2//!
3//! This crate is the bottom of the workspace: it depends on no other parse-rust crate and
4//! performs no I/O, so everything in it is directly testable without a server or a database.
5//!
6//! The contract for the whole project is **wire compatibility**: an unmodified Parse SDK
7//! pointed at parse-rust must see the same bytes it sees from parse-server. That is why this
8//! crate carries an ECMAScript number formatter, an order-preserving map, and a hand-written
9//! equality predicate rather than the obvious Rust defaults for each. See
10//! the modules below, each of which states the upstream behavior it reproduces.
11//!
12//! Citations of the form `File.js:LINE` refer to parse-server at pin `ca75b1fe`, recorded in
13//! `PIN` at the repository root. Read them with `git -C ../parse-server show ca75b1fe:<path>`.
14
15#![forbid(unsafe_code)]
16// "No `unwrap()` or `panic!()` in request paths": a malformed request from an untrusted client
17// must never take down a worker. Scoped to non-test builds on purpose. A test that cannot
18// assert with `unwrap` is a test written to satisfy a lint rather than to catch a bug, and the
19// invariant being protected is about serving traffic, not about test code.
20#![cfg_attr(
21 not(test),
22 deny(clippy::unwrap_used, clippy::expect_used, clippy::panic)
23)]
24
25pub mod acl;
26pub mod date;
27pub mod decode;
28pub mod error;
29pub mod js_number;
30pub mod object_id;
31pub mod op;
32pub mod value;
33
34pub use acl::{Acl, Permissions, Principal};
35pub use date::ParseDate;
36pub use decode::classify;
37pub use error::{ErrorCode, ParseError};
38pub use object_id::new_object_id;
39pub use op::Op;
40pub use value::{deep_strict_eq, ParseMap, ParseValue};