smithy4rs_core/lib.rs
1#![cfg_attr(rustfmt, rustfmt_skip)]
2#![deny(missing_docs)]
3
4//! Core library for the `Smithy4rs` framework for [Smithy] in Rust.
5//!
6//! This library provides the common functionality required for
7//! all generate clients, servers, and shapes using the `smithy4rs` framework.
8//!
9//! # Usage
10//! TODO
11//!
12//! #
13//!
14//!
15//! [Smithy]: https://smithy.io/
16
17/// Schemas used to describe and (de)serialize generated shapes
18/// with metadata from a Smithy model.
19pub mod schema;
20
21/// Schema-enabled (De)serialization
22pub mod serde;
23
24// Don't list macros as a module in generated docs
25#[doc(hidden)]
26pub mod macros;
27
28/// Common cheaply-copyable reference type.
29/// Defined as a common type so Arc type could be swapped out.
30pub type Ref<T> = std::sync::Arc<T>;
31
32pub use schema::prelude;
33
34// =================================================================
35// Re-exports of dependency types
36// =================================================================
37
38// Base types
39#[doc(hidden)]
40pub use bigdecimal::BigDecimal;
41#[doc(hidden)]
42pub use bytebuffer::ByteBuffer;
43#[doc(hidden)]
44pub use indexmap::IndexMap;
45#[doc(hidden)]
46pub use num_bigint::BigInt;
47#[doc(hidden)]
48pub use temporal_rs::Instant;
49
50// For public macros
51#[doc(hidden)]
52pub use std::sync::LazyLock;
53#[doc(hidden)]
54pub use pastey;
55
56// =================================================================
57// Re-export Derive macros
58// =================================================================
59pub use smithy4rs_core_derive as derive;
60
61// =================================================================
62// High performance hashmaps
63// -------------------------
64// Faster Map and Set implementations used for internal types and Schemas.
65//
66// NOTE: These should _not_ be used in serialized/deserialized types
67// as they are not resistant to DOS attacks.
68// =================================================================
69use rustc_hash::FxBuildHasher;
70use indexmap::IndexSet;
71
72pub(crate) type FxIndexMap<K, V> = IndexMap<K, V, FxBuildHasher>;
73pub(crate) type FxIndexSet<T> = IndexSet<T, FxBuildHasher>;