Crates.io | myd |
lib.rs | myd |
version | 0.1.1 |
source | src |
created_at | 2023-04-02 10:31:54.430444 |
updated_at | 2023-04-04 09:19:15.377261 |
description | An implementation of the rust module system |
homepage | |
repository | https://gitlab.com/john_t/myd |
max_upload_size | |
id | 827966 |
size | 97,214 |
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.
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.