Enum query_structure::ast::Top
source · pub enum Top {
CompositeType(CompositeType),
Enum(Enum),
Model(Model),
Source(SourceConfig),
Generator(GeneratorConfig),
}
Expand description
Enum for distinguishing between top-level entries
Variants§
CompositeType(CompositeType)
A composite type
Enum(Enum)
An enum declaration
Model(Model)
A model declaration
Source(SourceConfig)
A datasource block
Generator(GeneratorConfig)
A generator block
Implementations§
source§impl Top
impl Top
sourcepub fn identifier(&self) -> &Identifier
pub fn identifier(&self) -> &Identifier
The name of the item.
sourcepub fn as_composite_type(&self) -> Option<&CompositeType>
pub fn as_composite_type(&self) -> Option<&CompositeType>
Try to interpret the item as a composite type declaration.
sourcepub fn as_generator(&self) -> Option<&GeneratorConfig>
pub fn as_generator(&self) -> Option<&GeneratorConfig>
Try to interpret the item as a generator block.
sourcepub fn as_source(&self) -> Option<&SourceConfig>
pub fn as_source(&self) -> Option<&SourceConfig>
Try to interpret the item as a datasource block.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Top
impl Send for Top
impl Sync for Top
impl Unpin for Top
impl UnwindSafe for Top
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more