mz_repr/
lib.rs

1// Copyright Materialize, Inc. and contributors. All rights reserved.
2//
3// Use of this software is governed by the Business Source License
4// included in the LICENSE file.
5//
6// As of the Change Date specified in that file, in accordance with
7// the Business Source License, use of this software will be governed
8// by the Apache License, Version 2.0.
9
10//! Fundamental data representation.
11//!
12//! This module contains the types for representing data in Materialize that all
13//! layers of the stack can understand. Think of it as the _lingua franca_:
14//! individual layers may use different representations internally, but they all
15//! agree to use this representation at their boundaries.
16//!
17//! * The core value type is the [`Datum`] enum, which represents a literal value.
18//! * [`Row`] extends a `Datum` horizontally, and has features for efficiently
19//!   doing so.
20//! * [`RelationDesc`] describes what it takes to extend a `Row` vertically, and
21//!   corresponds most closely to what is returned from querying our dataflows
22
23#![warn(missing_debug_implementations)]
24// TODO(parkmycar): Remove this allow.
25#![allow(unsafe_op_in_unsafe_fn)]
26
27mod datum_vec;
28mod diff;
29mod relation;
30mod relation_and_scalar;
31mod row;
32mod scalar;
33
34pub mod adt;
35pub mod antichain;
36pub mod bytes;
37pub mod catalog_item_id;
38pub mod explain;
39pub mod fixed_length;
40pub mod global_id;
41pub mod namespaces;
42pub mod network_policy_id;
43pub mod optimize;
44pub mod refresh_schedule;
45pub mod role_id;
46pub mod stats;
47pub mod strconv;
48pub mod timestamp;
49pub mod url;
50pub mod user;
51
52pub use crate::catalog_item_id::CatalogItemId;
53pub use crate::datum_vec::{DatumVec, DatumVecBorrow};
54pub use crate::diff::Diff;
55pub use crate::global_id::GlobalId;
56pub use crate::relation::{
57    ColumnIndex, ColumnName, ColumnType, NotNullViolation, PropRelationDescDiff, ProtoColumnName,
58    ProtoColumnType, ProtoRelationDesc, ProtoRelationType, RelationDesc, RelationDescBuilder,
59    RelationType, RelationVersion, RelationVersionSelector, VersionedRelationDesc,
60    arb_relation_desc_diff, arb_relation_desc_projection, arb_row_for_relation,
61};
62pub use crate::row::encode::{RowColumnarDecoder, RowColumnarEncoder, preserves_order};
63pub use crate::row::iter::{IntoRowIterator, RowIterator};
64pub use crate::row::{
65    DatumList, DatumMap, ProtoNumeric, ProtoRow, Row, RowArena, RowPacker, RowRef, SharedRow,
66    datum_list_size, datum_size, datums_size, read_datum, row_size,
67};
68pub use crate::scalar::{
69    ArrayRustType, AsColumnType, Datum, DatumType, PropArray, PropDatum, PropDict, PropList,
70    ProtoScalarType, ScalarBaseType, ScalarType, arb_datum, arb_datum_for_column,
71    arb_datum_for_scalar, arb_range_type,
72};
73pub use crate::timestamp::{Timestamp, TimestampManipulation};