uqa_core/catalog_identity.rs
1//
2// Unified Query Algebra
3//
4// Copyright (c) 2023-2026 Cognica, Inc.
5//
6
7//! A catalog object's durable incarnation and public address, independent of its display name.
8
9#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
10#[serde(deny_unknown_fields)]
11pub struct CatalogObjectIdentity {
12 pub object_id: [u8; 16],
13 pub oid: i64,
14}
15
16impl CatalogObjectIdentity {
17 pub fn is_valid(self) -> bool {
18 self.object_id != [0; 16] && u32::try_from(self.oid).is_ok_and(|oid| oid != 0)
19 }
20}