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