Expand description
§Myd
Pronounced /mi:d/, like mead
Myd
is a rust library to create a representation of the
rust module tree as a usable datatype, and to resolve imports. It
is designed to be used by tools working with rust source code to
be less naïve about the module system.
§Examples
Parse a package:
// Expensive operation: may take a few seconds
let mi = myd::parse::parse("./Cargo.toml");
Work out where something is imported from:
let my_path: syn::Path = syn::parse_str("std::collections::HashMap");
let hashmap = mi.path(my_node, my_path)
See the examples for more.
Modules§
- parse
- Exposes a function to parse a crate into a
ModuleInformation
- platforms
- Information about the platform / target
Structs§
- ItemId
- A reference to an item on the tree.
- Module
- A rust module
- Module
Information - A struct representing all
Module
s as aTree
.
Enums§
- Cargo
Opt - Cargo features flags
- Module
OrItem - A reference either fo a module or an item on the tree
- Resolve
Error - An error occuring when resolving a path
with
ModuleInformation::path