Enum query_structure::ast::TopId
source · pub enum TopId {
CompositeType(CompositeTypeId),
Model(ModelId),
Enum(EnumId),
Generator(GeneratorId),
Source(SourceId),
}
Expand description
An identifier for a top-level item in a schema AST. Use the schema[top_id]
syntax to resolve the id to an ast::Top
.
Variants§
CompositeType(CompositeTypeId)
A composite type
Model(ModelId)
A model declaration
Enum(EnumId)
An enum declaration
Generator(GeneratorId)
A generator block
Source(SourceId)
A datasource block
Implementations§
source§impl TopId
impl TopId
sourcepub fn as_enum_id(self) -> Option<EnumId>
pub fn as_enum_id(self) -> Option<EnumId>
Try to interpret the top as an enum.
sourcepub fn as_model_id(self) -> Option<ModelId>
pub fn as_model_id(self) -> Option<ModelId>
Try to interpret the top as a model.
sourcepub fn as_composite_type_id(&self) -> Option<CompositeTypeId>
pub fn as_composite_type_id(&self) -> Option<CompositeTypeId>
Try to interpret the top as a composite type.
Trait Implementations§
source§impl Ord for TopId
impl Ord for TopId
source§impl PartialEq for TopId
impl PartialEq for TopId
source§impl PartialOrd for TopId
impl PartialOrd for TopId
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for TopId
impl Eq for TopId
impl StructuralEq for TopId
impl StructuralPartialEq for TopId
Auto Trait Implementations§
impl RefUnwindSafe for TopId
impl Send for TopId
impl Sync for TopId
impl Unpin for TopId
impl UnwindSafe for TopId
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
source§impl<T> CallHasher for Twhere
T: Hash + ?Sized,
impl<T> CallHasher for Twhere T: Hash + ?Sized,
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.