Skip to content

Commit

Permalink
put union impl after enum
Browse files Browse the repository at this point in the history
  • Loading branch information
fprasx committed Jan 10, 2024
1 parent a8b0a67 commit aa9477a
Showing 1 changed file with 45 additions and 45 deletions.
90 changes: 45 additions & 45 deletions src/rustdoc_schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,9 @@ type StructField implements Item {
"""
https://docs.rs/rustdoc-types/0.11.0/rustdoc_types/struct.Item.html
https://docs.rs/rustdoc-types/0.11.0/rustdoc_types/enum.ItemEnum.html
https://docs.rs/rustdoc-types/0.11.0/rustdoc_types/struct.Union.html
https://docs.rs/rustdoc-types/0.11.0/rustdoc_types/struct.Enum.html
"""
type Union implements Item & Importable & ImplOwner {
type Enum implements Item & Importable & ImplOwner {
# properties from Item
id: String!
crate_id: Int!
Expand Down Expand Up @@ -339,7 +339,7 @@ type Union implements Item & Importable & ImplOwner {
visibility_limit: String!

# own properties
fields_stripped: Boolean!
variants_stripped: Boolean!

# edges from Item
span: Span
Expand Down Expand Up @@ -374,15 +374,15 @@ type Union implements Item & Importable & ImplOwner {
inherent_impl: [Impl!]

# own edges
field: [StructField!]
variant: [Variant!]
}

"""
https://docs.rs/rustdoc-types/0.11.0/rustdoc_types/struct.Item.html
https://docs.rs/rustdoc-types/0.11.0/rustdoc_types/enum.ItemEnum.html
https://docs.rs/rustdoc-types/0.11.0/rustdoc_types/struct.Enum.html
https://docs.rs/rustdoc-types/0.11.0/rustdoc_types/enum.Variant.html
"""
type Enum implements Item & Importable & ImplOwner {
interface Variant implements Item {
# properties from Item
id: String!
crate_id: Int!
Expand Down Expand Up @@ -423,51 +423,20 @@ type Enum implements Item & Importable & ImplOwner {

visibility_limit: String!

# own properties
variants_stripped: Boolean!

# edges from Item
span: Span
attribute: [Attribute!]

# edges from Importable
importable_path: [ImportablePath!]
canonical_path: Path

# edges from ImplOwner
"""
Any impl for this type.
All impl kinds are included:
- inherent impls: `impl Foo`
- explicit trait implementations: `impl Bar for Foo`
- blanket implementations: `impl<T> Bar for T`
"""
impl: [Impl!]

"""
Only inherent impls: implementations of the type itself (`impl Foo`).
The impls pointed to here are guaranteed to have no `trait` and no `blanket` edges.
This edge is just a convenience to simplify query-writing,
so we don't have to keep writing "@fold @transform(...) @filter(...)" chains
over the `trait` and `blanket` edges.
When Trustfall supports macro edges, this should just become a macro edge.
"""
inherent_impl: [Impl!]

# own edges
variant: [Variant!]
field: [StructField!]
}

"""
https://docs.rs/rustdoc-types/0.11.0/rustdoc_types/struct.Item.html
https://docs.rs/rustdoc-types/0.11.0/rustdoc_types/enum.ItemEnum.html
https://docs.rs/rustdoc-types/0.11.0/rustdoc_types/enum.Variant.html
"""
interface Variant implements Item {
type PlainVariant implements Item & Variant {
# properties from Item
id: String!
crate_id: Int!
Expand Down Expand Up @@ -512,7 +481,7 @@ interface Variant implements Item {
span: Span
attribute: [Attribute!]

# own edges
# edges from Variant
field: [StructField!]
}

Expand All @@ -521,7 +490,7 @@ https://docs.rs/rustdoc-types/0.11.0/rustdoc_types/struct.Item.html
https://docs.rs/rustdoc-types/0.11.0/rustdoc_types/enum.ItemEnum.html
https://docs.rs/rustdoc-types/0.11.0/rustdoc_types/enum.Variant.html
"""
type PlainVariant implements Item & Variant {
type TupleVariant implements Item & Variant {
# properties from Item
id: String!
crate_id: Int!
Expand Down Expand Up @@ -575,7 +544,7 @@ https://docs.rs/rustdoc-types/0.11.0/rustdoc_types/struct.Item.html
https://docs.rs/rustdoc-types/0.11.0/rustdoc_types/enum.ItemEnum.html
https://docs.rs/rustdoc-types/0.11.0/rustdoc_types/enum.Variant.html
"""
type TupleVariant implements Item & Variant {
type StructVariant implements Item & Variant {
# properties from Item
id: String!
crate_id: Int!
Expand Down Expand Up @@ -627,9 +596,9 @@ type TupleVariant implements Item & Variant {
"""
https://docs.rs/rustdoc-types/0.11.0/rustdoc_types/struct.Item.html
https://docs.rs/rustdoc-types/0.11.0/rustdoc_types/enum.ItemEnum.html
https://docs.rs/rustdoc-types/0.11.0/rustdoc_types/enum.Variant.html
https://docs.rs/rustdoc-types/0.11.0/rustdoc_types/struct.Union.html
"""
type StructVariant implements Item & Variant {
type Union implements Item & Importable & ImplOwner {
# properties from Item
id: String!
crate_id: Int!
Expand Down Expand Up @@ -670,11 +639,42 @@ type StructVariant implements Item & Variant {

visibility_limit: String!

# own properties
fields_stripped: Boolean!

# edges from Item
span: Span
attribute: [Attribute!]

# edges from Variant
# edges from Importable
importable_path: [ImportablePath!]
canonical_path: Path

# edges from ImplOwner
"""
Any impl for this type.
All impl kinds are included:
- inherent impls: `impl Foo`
- explicit trait implementations: `impl Bar for Foo`
- blanket implementations: `impl<T> Bar for T`
"""
impl: [Impl!]

"""
Only inherent impls: implementations of the type itself (`impl Foo`).
The impls pointed to here are guaranteed to have no `trait` and no `blanket` edges.
This edge is just a convenience to simplify query-writing,
so we don't have to keep writing "@fold @transform(...) @filter(...)" chains
over the `trait` and `blanket` edges.
When Trustfall supports macro edges, this should just become a macro edge.
"""
inherent_impl: [Impl!]

# own edges
field: [StructField!]
}

Expand Down

0 comments on commit aa9477a

Please sign in to comment.