Crate duper

Crate duper 

Source
Expand description

§Duper

The format that’s super!

Duper aims to be a human-friendly extension of JSON with quality-of-life improvements, extra types, and semantic identifiers.

DatabaseConfig({
  host: IPV4("127.0.0.1"),
  port: Port(5432),
  username: "admin",
  password: SecureString("encrypted_data"),
  pool_size: 10,
  timeout: Duration("30s"),
  ssl: SSLConfig({
    enabled: true,
    cert: Path("/etc/ssl/cert.pem"),
    verify: true,
  }),
  created_at: Timestamp(1704067200),
})

§Feature flags

  • ansi: Enables the [Ansi] module for printing Duper values to a console.
  • serde: Enables serde serialization/deserialization for DuperValue.

§Other crates

  • serde_duper: Provides full serialization/deserialization support between Duper and native data types.
  • axum_duper: Provides an extractor/response for use with axum.

Re-exports§

pub use ast::DuperArray;
pub use ast::DuperBytes;
pub use ast::DuperIdentifier;
pub use ast::DuperIdentifierTryFromError;
pub use ast::DuperInner;
pub use ast::DuperKey;
pub use ast::DuperObject;
pub use ast::DuperObjectTryFromError;
pub use ast::DuperString;
pub use ast::DuperTuple;
pub use ast::DuperValue;
pub use visitor::pretty_printer::PrettyPrinter;
pub use visitor::serializer::Serializer;

Modules§

ast
Types for interacting with Duper’s abstract syntax tree.
visitor
Utilities for using and implementing your own DuperVisitor.

Structs§

DuperParser
The pest-based parser for Duper.

Enums§

DuperRule
The parser rules used to build the Duper abstract syntax tree (AST).