-
-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add more example queries to rustdoc playground.
- Loading branch information
1 parent
d4d9fea
commit 94b36fd
Showing
4 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
experiments/browser_based_querying/example_queries/rustdoc/trait_associated_consts.example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Traits with associated constants + their default values, if any. | ||
# Try these crates: bitflags, arrayvec, digest, lock_api | ||
query { | ||
Crate { | ||
item { | ||
... on Trait { | ||
name @output | ||
|
||
associated_constant { | ||
const: name @output | ||
const_default_value: default @output | ||
|
||
span { | ||
filename @output | ||
first_line: begin_line @output | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
vars: | ||
{ | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
...ments/browser_based_querying/example_queries/rustdoc/traits_with_associated_types.example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Traits with associated types. | ||
# Try these crates: itertools, futures_core, anyhow, ansi_term | ||
query { | ||
Crate { | ||
item { | ||
... on Trait { | ||
name @output | ||
|
||
associated_type { | ||
associated_type: name @output | ||
|
||
span { | ||
filename @output | ||
first_line: begin_line @output | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
vars: | ||
{ | ||
|
||
} |
32 changes: 32 additions & 0 deletions
32
experiments/browser_based_querying/example_queries/rustdoc/type_associated_consts.example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Types with associated constants. | ||
# Try these crates: memchr, crossbeam_epoch, chrono, arrayvec, getrandom, hashbrown | ||
query { | ||
Crate { | ||
item { | ||
# ImplOwner in our schema is a common supertype of | ||
# vertex types like Struct and Enum: | ||
# ones that may own "impl" blocks. | ||
... on ImplOwner { | ||
__typename @output # Get the exact type of this vertex. | ||
name @output | ||
|
||
inherent_impl { | ||
associated_constant { | ||
const: name @output | ||
const_value: default @output | ||
|
||
span { | ||
filename @output | ||
first_line: begin_line @output | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
vars: | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters