zerodds_ast/node/exception.rs
1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2026 ZeroDDS Contributors
3//! Exceptions. Spec §3.4.
4
5use crate::facet::Facets;
6use crate::node::member::MemberNode;
7use crate::node::module::ModuleNode;
8use alloc::string::String;
9use alloc::vec::Vec;
10use zerodds_ast_core::{Id, NodeId};
11
12/// An exception. Spec §3.4.
13///
14/// Structurally an aggregate, but not a `TypeKind`: an exception cannot
15/// appear as a member type, so giving it its own kind keeps the type
16/// space honest.
17#[derive(Debug, Clone, PartialEq, Eq)]
18pub struct ExceptionNode {
19 /// Stable identity.
20 pub node_id: NodeId,
21 /// Simple name.
22 pub name: String,
23 /// Enclosing module.
24 pub module: Id<ModuleNode>,
25 /// The interface or value type this is declared in, when it is not
26 /// declared directly in a module (OMG IDL 4.2 §7.4.3.4: an interface
27 /// body holds type, constant and exception declarations). Its name is
28 /// a segment of the scoped name and of the repository id:
29 /// `CosNaming::NamingContext::NotFound`.
30 pub scope: Option<String>,
31 /// Members in declaration order.
32 pub members: Vec<Id<MemberNode>>,
33 /// Per-source information. Spec §4.
34 pub facets: Facets,
35}