// generated by codegen, do not edit #![cfg_attr(any(), rustfmt::skip)] use crate::trap; #[derive(Debug)] pub struct File { _unused: () } impl trap::TrapClass for File { fn class_name() -> &'static str { "File" } } #[derive(Debug)] pub struct Element { _unused: () } impl trap::TrapClass for Element { fn class_name() -> &'static str { "Element" } } #[derive(Debug)] pub struct ExtractorStep { pub id: trap::TrapId, pub action: String, pub file: Option>, pub duration_ms: usize, } impl trap::TrapEntry for ExtractorStep { fn extract_id(&mut self) -> trap::TrapId { std::mem::replace(&mut self.id, trap::TrapId::Star) } fn emit(self, id: trap::Label, out: &mut trap::Writer) { out.add_tuple("extractor_steps", vec![id.into(), self.action.into(), self.duration_ms.into()]); if let Some(v) = self.file { out.add_tuple("extractor_step_files", vec![id.into(), v.into()]); } } } impl trap::TrapClass for ExtractorStep { fn class_name() -> &'static str { "ExtractorStep" } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme ExtractorStep is a subclass of Element unsafe { Self::from_untyped(value.as_untyped()) } } } #[derive(Debug)] pub struct Locatable { _unused: () } impl trap::TrapClass for Locatable { fn class_name() -> &'static str { "Locatable" } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme Locatable is a subclass of Element unsafe { Self::from_untyped(value.as_untyped()) } } } #[derive(Debug)] pub struct NamedCrate { pub id: trap::TrapId, pub name: String, pub crate_: trap::Label, } impl trap::TrapEntry for NamedCrate { fn extract_id(&mut self) -> trap::TrapId { std::mem::replace(&mut self.id, trap::TrapId::Star) } fn emit(self, id: trap::Label, out: &mut trap::Writer) { out.add_tuple("named_crates", vec![id.into(), self.name.into(), self.crate_.into()]); } } impl trap::TrapClass for NamedCrate { fn class_name() -> &'static str { "NamedCrate" } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme NamedCrate is a subclass of Element unsafe { Self::from_untyped(value.as_untyped()) } } } #[derive(Debug)] pub struct Unextracted { _unused: () } impl trap::TrapClass for Unextracted { fn class_name() -> &'static str { "Unextracted" } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme Unextracted is a subclass of Element unsafe { Self::from_untyped(value.as_untyped()) } } } #[derive(Debug)] pub struct AstNode { _unused: () } impl trap::TrapClass for AstNode { fn class_name() -> &'static str { "AstNode" } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme AstNode is a subclass of Locatable unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme AstNode is a subclass of Element unsafe { Self::from_untyped(value.as_untyped()) } } } #[derive(Debug)] pub struct Crate { pub id: trap::TrapId, pub name: Option, pub version: Option, pub cfg_options: Vec, pub named_dependencies: Vec>, } impl trap::TrapEntry for Crate { fn extract_id(&mut self) -> trap::TrapId { std::mem::replace(&mut self.id, trap::TrapId::Star) } fn emit(self, id: trap::Label, out: &mut trap::Writer) { out.add_tuple("crates", vec![id.into()]); if let Some(v) = self.name { out.add_tuple("crate_names", vec![id.into(), v.into()]); } if let Some(v) = self.version { out.add_tuple("crate_versions", vec![id.into(), v.into()]); } for (i, v) in self.cfg_options.into_iter().enumerate() { out.add_tuple("crate_cfg_options", vec![id.into(), i.into(), v.into()]); } for (i, v) in self.named_dependencies.into_iter().enumerate() { out.add_tuple("crate_named_dependencies", vec![id.into(), i.into(), v.into()]); } } } impl trap::TrapClass for Crate { fn class_name() -> &'static str { "Crate" } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme Crate is a subclass of Locatable unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme Crate is a subclass of Element unsafe { Self::from_untyped(value.as_untyped()) } } } #[derive(Debug)] pub struct Missing { pub id: trap::TrapId, } impl trap::TrapEntry for Missing { fn extract_id(&mut self) -> trap::TrapId { std::mem::replace(&mut self.id, trap::TrapId::Star) } fn emit(self, id: trap::Label, out: &mut trap::Writer) { out.add_tuple("missings", vec![id.into()]); } } impl trap::TrapClass for Missing { fn class_name() -> &'static str { "Missing" } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme Missing is a subclass of Unextracted unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme Missing is a subclass of Element unsafe { Self::from_untyped(value.as_untyped()) } } } #[derive(Debug)] pub struct Unimplemented { pub id: trap::TrapId, } impl trap::TrapEntry for Unimplemented { fn extract_id(&mut self) -> trap::TrapId { std::mem::replace(&mut self.id, trap::TrapId::Star) } fn emit(self, id: trap::Label, out: &mut trap::Writer) { out.add_tuple("unimplementeds", vec![id.into()]); } } impl trap::TrapClass for Unimplemented { fn class_name() -> &'static str { "Unimplemented" } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme Unimplemented is a subclass of Unextracted unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme Unimplemented is a subclass of Element unsafe { Self::from_untyped(value.as_untyped()) } } } #[derive(Debug)] pub struct Abi { pub id: trap::TrapId, pub abi_string: Option, } impl trap::TrapEntry for Abi { fn extract_id(&mut self) -> trap::TrapId { std::mem::replace(&mut self.id, trap::TrapId::Star) } fn emit(self, id: trap::Label, out: &mut trap::Writer) { out.add_tuple("abis", vec![id.into()]); if let Some(v) = self.abi_string { out.add_tuple("abi_abi_strings", vec![id.into(), v.into()]); } } } impl trap::TrapClass for Abi { fn class_name() -> &'static str { "Abi" } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme Abi is a subclass of AstNode unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme Abi is a subclass of Locatable unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme Abi is a subclass of Element unsafe { Self::from_untyped(value.as_untyped()) } } } #[derive(Debug)] pub struct Addressable { _unused: () } impl Addressable { pub fn emit_extended_canonical_path(id: trap::Label, value: String, out: &mut trap::Writer) { out.add_tuple("addressable_extended_canonical_paths", vec![id.into(), value.into()]); } pub fn emit_crate_origin(id: trap::Label, value: String, out: &mut trap::Writer) { out.add_tuple("addressable_crate_origins", vec![id.into(), value.into()]); } } impl trap::TrapClass for Addressable { fn class_name() -> &'static str { "Addressable" } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme Addressable is a subclass of AstNode unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme Addressable is a subclass of Locatable unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme Addressable is a subclass of Element unsafe { Self::from_untyped(value.as_untyped()) } } } #[derive(Debug)] pub struct ArgList { pub id: trap::TrapId, pub args: Vec>, } impl trap::TrapEntry for ArgList { fn extract_id(&mut self) -> trap::TrapId { std::mem::replace(&mut self.id, trap::TrapId::Star) } fn emit(self, id: trap::Label, out: &mut trap::Writer) { out.add_tuple("arg_lists", vec![id.into()]); for (i, v) in self.args.into_iter().enumerate() { out.add_tuple("arg_list_args", vec![id.into(), i.into(), v.into()]); } } } impl trap::TrapClass for ArgList { fn class_name() -> &'static str { "ArgList" } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme ArgList is a subclass of AstNode unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme ArgList is a subclass of Locatable unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme ArgList is a subclass of Element unsafe { Self::from_untyped(value.as_untyped()) } } } #[derive(Debug)] pub struct AsmDirSpec { pub id: trap::TrapId, } impl trap::TrapEntry for AsmDirSpec { fn extract_id(&mut self) -> trap::TrapId { std::mem::replace(&mut self.id, trap::TrapId::Star) } fn emit(self, id: trap::Label, out: &mut trap::Writer) { out.add_tuple("asm_dir_specs", vec![id.into()]); } } impl trap::TrapClass for AsmDirSpec { fn class_name() -> &'static str { "AsmDirSpec" } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme AsmDirSpec is a subclass of AstNode unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme AsmDirSpec is a subclass of Locatable unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme AsmDirSpec is a subclass of Element unsafe { Self::from_untyped(value.as_untyped()) } } } #[derive(Debug)] pub struct AsmOperand { _unused: () } impl trap::TrapClass for AsmOperand { fn class_name() -> &'static str { "AsmOperand" } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme AsmOperand is a subclass of AstNode unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme AsmOperand is a subclass of Locatable unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme AsmOperand is a subclass of Element unsafe { Self::from_untyped(value.as_untyped()) } } } #[derive(Debug)] pub struct AsmOperandExpr { pub id: trap::TrapId, pub in_expr: Option>, pub out_expr: Option>, } impl trap::TrapEntry for AsmOperandExpr { fn extract_id(&mut self) -> trap::TrapId { std::mem::replace(&mut self.id, trap::TrapId::Star) } fn emit(self, id: trap::Label, out: &mut trap::Writer) { out.add_tuple("asm_operand_exprs", vec![id.into()]); if let Some(v) = self.in_expr { out.add_tuple("asm_operand_expr_in_exprs", vec![id.into(), v.into()]); } if let Some(v) = self.out_expr { out.add_tuple("asm_operand_expr_out_exprs", vec![id.into(), v.into()]); } } } impl trap::TrapClass for AsmOperandExpr { fn class_name() -> &'static str { "AsmOperandExpr" } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme AsmOperandExpr is a subclass of AstNode unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme AsmOperandExpr is a subclass of Locatable unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme AsmOperandExpr is a subclass of Element unsafe { Self::from_untyped(value.as_untyped()) } } } #[derive(Debug)] pub struct AsmOption { pub id: trap::TrapId, pub is_raw: bool, } impl trap::TrapEntry for AsmOption { fn extract_id(&mut self) -> trap::TrapId { std::mem::replace(&mut self.id, trap::TrapId::Star) } fn emit(self, id: trap::Label, out: &mut trap::Writer) { out.add_tuple("asm_options", vec![id.into()]); if self.is_raw { out.add_tuple("asm_option_is_raw", vec![id.into()]); } } } impl trap::TrapClass for AsmOption { fn class_name() -> &'static str { "AsmOption" } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme AsmOption is a subclass of AstNode unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme AsmOption is a subclass of Locatable unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme AsmOption is a subclass of Element unsafe { Self::from_untyped(value.as_untyped()) } } } #[derive(Debug)] pub struct AsmPiece { _unused: () } impl trap::TrapClass for AsmPiece { fn class_name() -> &'static str { "AsmPiece" } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme AsmPiece is a subclass of AstNode unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme AsmPiece is a subclass of Locatable unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme AsmPiece is a subclass of Element unsafe { Self::from_untyped(value.as_untyped()) } } } #[derive(Debug)] pub struct AsmRegSpec { pub id: trap::TrapId, pub identifier: Option>, } impl trap::TrapEntry for AsmRegSpec { fn extract_id(&mut self) -> trap::TrapId { std::mem::replace(&mut self.id, trap::TrapId::Star) } fn emit(self, id: trap::Label, out: &mut trap::Writer) { out.add_tuple("asm_reg_specs", vec![id.into()]); if let Some(v) = self.identifier { out.add_tuple("asm_reg_spec_identifiers", vec![id.into(), v.into()]); } } } impl trap::TrapClass for AsmRegSpec { fn class_name() -> &'static str { "AsmRegSpec" } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme AsmRegSpec is a subclass of AstNode unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme AsmRegSpec is a subclass of Locatable unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme AsmRegSpec is a subclass of Element unsafe { Self::from_untyped(value.as_untyped()) } } } #[derive(Debug)] pub struct AssocItem { _unused: () } impl trap::TrapClass for AssocItem { fn class_name() -> &'static str { "AssocItem" } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme AssocItem is a subclass of AstNode unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme AssocItem is a subclass of Locatable unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme AssocItem is a subclass of Element unsafe { Self::from_untyped(value.as_untyped()) } } } #[derive(Debug)] pub struct AssocItemList { pub id: trap::TrapId, pub assoc_items: Vec>, pub attrs: Vec>, } impl trap::TrapEntry for AssocItemList { fn extract_id(&mut self) -> trap::TrapId { std::mem::replace(&mut self.id, trap::TrapId::Star) } fn emit(self, id: trap::Label, out: &mut trap::Writer) { out.add_tuple("assoc_item_lists", vec![id.into()]); for (i, v) in self.assoc_items.into_iter().enumerate() { out.add_tuple("assoc_item_list_assoc_items", vec![id.into(), i.into(), v.into()]); } for (i, v) in self.attrs.into_iter().enumerate() { out.add_tuple("assoc_item_list_attrs", vec![id.into(), i.into(), v.into()]); } } } impl trap::TrapClass for AssocItemList { fn class_name() -> &'static str { "AssocItemList" } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme AssocItemList is a subclass of AstNode unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme AssocItemList is a subclass of Locatable unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme AssocItemList is a subclass of Element unsafe { Self::from_untyped(value.as_untyped()) } } } #[derive(Debug)] pub struct Attr { pub id: trap::TrapId, pub meta: Option>, } impl trap::TrapEntry for Attr { fn extract_id(&mut self) -> trap::TrapId { std::mem::replace(&mut self.id, trap::TrapId::Star) } fn emit(self, id: trap::Label, out: &mut trap::Writer) { out.add_tuple("attrs", vec![id.into()]); if let Some(v) = self.meta { out.add_tuple("attr_meta", vec![id.into(), v.into()]); } } } impl trap::TrapClass for Attr { fn class_name() -> &'static str { "Attr" } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme Attr is a subclass of AstNode unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme Attr is a subclass of Locatable unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme Attr is a subclass of Element unsafe { Self::from_untyped(value.as_untyped()) } } } #[derive(Debug)] pub struct Callable { _unused: () } impl trap::TrapClass for Callable { fn class_name() -> &'static str { "Callable" } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme Callable is a subclass of AstNode unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme Callable is a subclass of Locatable unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme Callable is a subclass of Element unsafe { Self::from_untyped(value.as_untyped()) } } } #[derive(Debug)] pub struct ClosureBinder { pub id: trap::TrapId, pub generic_param_list: Option>, } impl trap::TrapEntry for ClosureBinder { fn extract_id(&mut self) -> trap::TrapId { std::mem::replace(&mut self.id, trap::TrapId::Star) } fn emit(self, id: trap::Label, out: &mut trap::Writer) { out.add_tuple("closure_binders", vec![id.into()]); if let Some(v) = self.generic_param_list { out.add_tuple("closure_binder_generic_param_lists", vec![id.into(), v.into()]); } } } impl trap::TrapClass for ClosureBinder { fn class_name() -> &'static str { "ClosureBinder" } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme ClosureBinder is a subclass of AstNode unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme ClosureBinder is a subclass of Locatable unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme ClosureBinder is a subclass of Element unsafe { Self::from_untyped(value.as_untyped()) } } } #[derive(Debug)] pub struct Expr { _unused: () } impl trap::TrapClass for Expr { fn class_name() -> &'static str { "Expr" } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme Expr is a subclass of AstNode unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme Expr is a subclass of Locatable unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme Expr is a subclass of Element unsafe { Self::from_untyped(value.as_untyped()) } } } #[derive(Debug)] pub struct ExternItem { _unused: () } impl trap::TrapClass for ExternItem { fn class_name() -> &'static str { "ExternItem" } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme ExternItem is a subclass of AstNode unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme ExternItem is a subclass of Locatable unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme ExternItem is a subclass of Element unsafe { Self::from_untyped(value.as_untyped()) } } } #[derive(Debug)] pub struct ExternItemList { pub id: trap::TrapId, pub attrs: Vec>, pub extern_items: Vec>, } impl trap::TrapEntry for ExternItemList { fn extract_id(&mut self) -> trap::TrapId { std::mem::replace(&mut self.id, trap::TrapId::Star) } fn emit(self, id: trap::Label, out: &mut trap::Writer) { out.add_tuple("extern_item_lists", vec![id.into()]); for (i, v) in self.attrs.into_iter().enumerate() { out.add_tuple("extern_item_list_attrs", vec![id.into(), i.into(), v.into()]); } for (i, v) in self.extern_items.into_iter().enumerate() { out.add_tuple("extern_item_list_extern_items", vec![id.into(), i.into(), v.into()]); } } } impl trap::TrapClass for ExternItemList { fn class_name() -> &'static str { "ExternItemList" } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme ExternItemList is a subclass of AstNode unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme ExternItemList is a subclass of Locatable unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme ExternItemList is a subclass of Element unsafe { Self::from_untyped(value.as_untyped()) } } } #[derive(Debug)] pub struct FieldList { _unused: () } impl trap::TrapClass for FieldList { fn class_name() -> &'static str { "FieldList" } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme FieldList is a subclass of AstNode unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme FieldList is a subclass of Locatable unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme FieldList is a subclass of Element unsafe { Self::from_untyped(value.as_untyped()) } } } #[derive(Debug)] pub struct FormatArgsArg { pub id: trap::TrapId, pub expr: Option>, pub name: Option>, } impl trap::TrapEntry for FormatArgsArg { fn extract_id(&mut self) -> trap::TrapId { std::mem::replace(&mut self.id, trap::TrapId::Star) } fn emit(self, id: trap::Label, out: &mut trap::Writer) { out.add_tuple("format_args_args", vec![id.into()]); if let Some(v) = self.expr { out.add_tuple("format_args_arg_exprs", vec![id.into(), v.into()]); } if let Some(v) = self.name { out.add_tuple("format_args_arg_names", vec![id.into(), v.into()]); } } } impl trap::TrapClass for FormatArgsArg { fn class_name() -> &'static str { "FormatArgsArg" } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme FormatArgsArg is a subclass of AstNode unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme FormatArgsArg is a subclass of Locatable unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme FormatArgsArg is a subclass of Element unsafe { Self::from_untyped(value.as_untyped()) } } } #[derive(Debug)] pub struct GenericArg { _unused: () } impl trap::TrapClass for GenericArg { fn class_name() -> &'static str { "GenericArg" } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme GenericArg is a subclass of AstNode unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme GenericArg is a subclass of Locatable unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme GenericArg is a subclass of Element unsafe { Self::from_untyped(value.as_untyped()) } } } #[derive(Debug)] pub struct GenericArgList { pub id: trap::TrapId, pub generic_args: Vec>, } impl trap::TrapEntry for GenericArgList { fn extract_id(&mut self) -> trap::TrapId { std::mem::replace(&mut self.id, trap::TrapId::Star) } fn emit(self, id: trap::Label, out: &mut trap::Writer) { out.add_tuple("generic_arg_lists", vec![id.into()]); for (i, v) in self.generic_args.into_iter().enumerate() { out.add_tuple("generic_arg_list_generic_args", vec![id.into(), i.into(), v.into()]); } } } impl trap::TrapClass for GenericArgList { fn class_name() -> &'static str { "GenericArgList" } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme GenericArgList is a subclass of AstNode unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme GenericArgList is a subclass of Locatable unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme GenericArgList is a subclass of Element unsafe { Self::from_untyped(value.as_untyped()) } } } #[derive(Debug)] pub struct GenericParam { _unused: () } impl trap::TrapClass for GenericParam { fn class_name() -> &'static str { "GenericParam" } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme GenericParam is a subclass of AstNode unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme GenericParam is a subclass of Locatable unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme GenericParam is a subclass of Element unsafe { Self::from_untyped(value.as_untyped()) } } } #[derive(Debug)] pub struct GenericParamList { pub id: trap::TrapId, pub generic_params: Vec>, } impl trap::TrapEntry for GenericParamList { fn extract_id(&mut self) -> trap::TrapId { std::mem::replace(&mut self.id, trap::TrapId::Star) } fn emit(self, id: trap::Label, out: &mut trap::Writer) { out.add_tuple("generic_param_lists", vec![id.into()]); for (i, v) in self.generic_params.into_iter().enumerate() { out.add_tuple("generic_param_list_generic_params", vec![id.into(), i.into(), v.into()]); } } } impl trap::TrapClass for GenericParamList { fn class_name() -> &'static str { "GenericParamList" } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme GenericParamList is a subclass of AstNode unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme GenericParamList is a subclass of Locatable unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme GenericParamList is a subclass of Element unsafe { Self::from_untyped(value.as_untyped()) } } } #[derive(Debug)] pub struct ItemList { pub id: trap::TrapId, pub attrs: Vec>, pub items: Vec>, } impl trap::TrapEntry for ItemList { fn extract_id(&mut self) -> trap::TrapId { std::mem::replace(&mut self.id, trap::TrapId::Star) } fn emit(self, id: trap::Label, out: &mut trap::Writer) { out.add_tuple("item_lists", vec![id.into()]); for (i, v) in self.attrs.into_iter().enumerate() { out.add_tuple("item_list_attrs", vec![id.into(), i.into(), v.into()]); } for (i, v) in self.items.into_iter().enumerate() { out.add_tuple("item_list_items", vec![id.into(), i.into(), v.into()]); } } } impl trap::TrapClass for ItemList { fn class_name() -> &'static str { "ItemList" } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme ItemList is a subclass of AstNode unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme ItemList is a subclass of Locatable unsafe { Self::from_untyped(value.as_untyped()) } } } impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme ItemList is a subclass of Element unsafe { Self::from_untyped(value.as_untyped()) } } } #[derive(Debug)] pub struct Label { pub id: trap::TrapId