Skip to main content

Crate parse_rust_core

Crate parse_rust_core 

Source
Expand description

Parse type system, JSON encoding and error codes. No I/O.

This crate is the bottom of the workspace: it depends on no other parse-rust crate and performs no I/O, so everything in it is directly testable without a server or a database.

The contract for the whole project is wire compatibility: an unmodified Parse SDK pointed at parse-rust must see the same bytes it sees from parse-server. That is why this crate carries an ECMAScript number formatter, an order-preserving map, and a hand-written equality predicate rather than the obvious Rust defaults for each. See the modules below, each of which states the upstream behavior it reproduces.

Citations of the form File.js:LINE refer to parse-server at pin ca75b1fe, recorded in PIN at the repository root. Read them with git -C ../parse-server show ca75b1fe:<path>.

Re-exports§

pub use acl::Acl;
pub use acl::Permissions;
pub use acl::Principal;
pub use date::ParseDate;
pub use decode::classify;
pub use error::ErrorCode;
pub use error::ParseError;
pub use object_id::new_object_id;
pub use op::Op;
pub use value::deep_strict_eq;
pub use value::ParseMap;
pub use value::ParseValue;

Modules§

acl
Parse ACLs, and the storage form they lower to.
date
Parse dates.
decode
classify: serde_json::Value to ParseValue.
error
Parse error codes.
js_number
ECMAScript Number::toString(x, 10), which is what JSON.stringify uses for numbers.
object_id
objectId generation.
op
Field operations: the {"__op":...} values a client sends instead of a literal.
value
The ParseValue model: every JSON value a client can send or receive in an object body.