Skip to main content

rd_rds/
lib.rs

1//! Read-only reader for installed-package metadata, help databases, and
2//! selected CRAN-like repository indexes in R's RDS serialization format.
3//!
4//! [`parse`] reads a decompressed XDR serialization stream. [`mod@file`] provides
5//! the bounded standalone-file entry layer, including supported compression
6//! envelopes.
7//!
8//! See the crate README for the concrete repository-index profiles covered by
9//! deterministic fixtures and verified manually against real files.
10//!
11//! This crate is scoped to installed-R-package information and selected
12//! CRAN-like repository indexes. Strict decoding rejects unknown SEXP values.
13//! [`mod@inspection`] observes prefix facts without claiming full object
14//! validity. `RObject`/`RValue` are a
15//! supported advanced API with encapsulated fields and non-exhaustive enums;
16//! consumers must include wildcard match arms. The typed [`package`] views and
17//! general [`matrix::CharacterMatrix`] view are the stable convenience surface.
18//! `parse` accepts only decompressed XDR,
19//! while [`file::from_bytes`] accepts raw XDR, gzip, xz, bzip2, and zstd
20//! envelopes when enabled. Default resource limits are depth 5,000, vectors
21//! 8,000,000 elements, 16,000,000 total elements and references, and 256 MiB
22//! file inputs.
23
24mod cursor;
25mod decode;
26mod error;
27pub mod file;
28mod header;
29mod inspect;
30pub mod inspection;
31#[cfg(feature = "lazyload")]
32pub mod lazyload;
33pub mod matrix;
34pub mod package;
35mod value;
36mod wire;
37
38pub use cursor::ByteCursor;
39pub use decode::{
40    NativeEncodingPolicy, ParseOptions, parse, parse_with_limits, parse_with_options,
41};
42pub use error::Error;
43pub use header::{Header, RVersion};
44pub use value::{
45    Attribute, Attributes, EnvHandle, Limits, NativeEncodingSource, Persisted, REncoding, RObject,
46    RStr, RStrValue, RValue, SexpKind, Symbol,
47};