Skip to main content

mz_repr/adt/
system.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//! System data types.
11
12#[cfg(any(test, feature = "proptest"))]
13use proptest_derive::Arbitrary;
14use serde::{Deserialize, Serialize};
15
16/// A Rust type representing a PostgreSQL "char".
17#[derive(Debug, Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Hash)]
18pub struct PgLegacyChar(pub u8);
19
20/// A Rust type representing a PostgreSQL object identifier (OID).
21#[derive(
22    Debug,
23    Clone,
24    Copy,
25    Eq,
26    PartialEq,
27    Ord,
28    PartialOrd,
29    Hash,
30    Serialize,
31    Deserialize
32)]
33#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
34pub struct Oid(pub u32);
35
36/// A Rust type representing the OID of a PostgreSQL class.
37#[derive(Debug, Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Hash)]
38pub struct RegClass(pub u32);
39
40/// A Rust type representing the OID of a PostgreSQL function name.
41#[derive(Debug, Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Hash)]
42pub struct RegProc(pub u32);
43
44/// A Rust type representing the OID of a PostgreSQL type.
45#[derive(Debug, Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Hash)]
46pub struct RegType(pub u32);