Skip to main content

Module serialize

Module serialize 

Source
Expand description

GNU R serialization — reading and writing RDS files.

Implements both the XDR binary format (format ‘X’) and the ASCII text format (format ‘A’) used by readRDS()/saveRDS(). See R-ints.texi “Serialization Formats” for the spec.

Structs§

AsciiReader 🔒
Line-oriented reader for the ASCII serialization format (format ‘A’).
AsciiWriter 🔒
Line-oriented writer for the ASCII serialization format (format ‘A’).
XdrReader 🔒
Cursor-based reader for big-endian (XDR) binary data.
XdrWriter 🔒
Cursor-based writer for big-endian (XDR) binary data.

Constants§

BASEENV_SXP 🔒
BASENAMESPACE_SXP 🔒
BUILTINSXP 🔒
CHARSXP 🔒
CLOSXP 🔒
CPLXSXP 🔒
EMPTYENV_SXP 🔒
ENVSXP 🔒
EXPRSXP 🔒
GLOBALENV_SXP 🔒
HAS_ATTR_MASK 🔒
HAS_TAG_MASK 🔒
INTSXP 🔒
LANGSXP 🔒
LGLSXP 🔒
LISTSXP 🔒
MISSINGARG_SXP 🔒
NAMESPACESXP 🔒
NILSXP 🔒
NILVALUE_SXP 🔒
PROMSXP 🔒
RAWSXP 🔒
REALSXP 🔒
REFSXP 🔒
R_NA_INTEGER 🔒
R’s NA_INTEGER is i32::MIN
R_NA_LOGICAL 🔒
R’s NA_LOGICAL is also i32::MIN in serialization
R_NA_REAL_BITS 🔒
R’s NA_REAL bit pattern: 0x7FF00000000007A2 (a specific NaN)
SPECIALSXP 🔒
STRSXP 🔒
SYMSXP 🔒
UNBOUNDVALUE_SXP 🔒
VECSXP 🔒

Functions§

format_hex_float 🔒
Format a f64 as a C-style hex float string (matching R’s %a format).
is_binary_rds
Check if bytes look like a GNU R binary RDS file.
is_bzip2_data
Check for bzip2 magic number (“BZh”).
is_gzip_data
Check for gzip magic number (0x1f 0x8b).
parse_ascii_double 🔒
Parse a double from R’s ASCII serialization format.
parse_hex_float 🔒
Parse a C-style hex float string like “0x1.999999999999ap-4” into f64.
serialize_ascii
Serialize an R value to ASCII text format (version 2).
serialize_rdata
Serialize named bindings to GNU R binary .RData format (RDX2).
serialize_rds
Serialize an R value to an RDS byte stream, optionally gzip-compressed.
serialize_xdr
Serialize an R value to XDR binary format (version 2).
unserialize_rds
Decompress gzip data and then deserialize.
unserialize_xdr
Deserialize an R object from either XDR binary or ASCII format bytes.