roogle-rs / roogle Goto Github PK
View Code? Open in Web Editor NEWA Rust API search engine
Home Page: https://roogle.hkmatsumoto.com
License: Apache License 2.0
A Rust API search engine
Home Page: https://roogle.hkmatsumoto.com
License: Apache License 2.0
(xxx) -> yyy
is supported but not documented on README and the website.It would make it easier to package for distro maintainers
It is possible to index user provided crates like so:
export RUSTDOCFLAGS="-Zunstable-options --output-format=json"
cargo +nightly doc
Alternatively, in Rust:
std::process::Command::new("cargo")
.arg("+nightly")
.arg("doc")
.env("RUSTDOCFLAGS", "-Zunstable-options --output-format=json")
.env("CARGO_TARGET_DIR", &index_dir)
.current_dir(crate_path)
.output();
I think it would be useful to document this as an option somewhere in the roogle-engine
documentation or README.md
, or both. However, it does run into internal compiler errors, so it will not currently work for all projects.
Would be cool to point this at a large workspace and have it index all the crates it finds there.
I did something similar for undepend. Something like this should do the trick:
use cargo_metadata::{Metadata, MetadataCommand};
let metadata = MetadataCommand::new()
.manifest_path(repo_dir.join("Cargo.toml"))
.exec()
.unwrap();
for package in metadata.workspace_members.iter() {
}
I haven't looked in detail how roogle currently works, but I would love for it to be the default search rustdoc uses for the standard library and docs.rs :) would you be interested in working on that if I help out with the rusrdoc-specific parts?
(Loving your work btw)
fn (PathBuf) -> String
returns sensible results.
fn PathBuf -> String
returns interesting results. I was just wondering if the prompt should be fn
given that it has to be typed often and whether (
)
are needed for simple cases.
If you can't serialise a crate it should warn but skip it rather than panic.
Compiling roogle-api v0.1.0 (/home/gilescope/git/roogle/roogle-api)
Finished release [optimized] target(s) in 6.47s
Running target/release/roogle-api
thread 'main' panicked at 'failed to deserialize: Error("invalid type: map, expected unit", line: 1, column: 7576)', roogle-api/src/main.rs:43:51
stack backtrace:
0: rust_begin_unwind
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:515:5
1: core::panicking::panic_fmt
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/panicking.rs:92:14
2: core::result::unwrap_failed
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/result.rs:1599:5
3: core::ops::function::impls::<impl core::ops::function::FnOnce for &mut F>::call_once
4: <alloc::vec::Vec as alloc::vec::spec_from_iter::SpecFromIter<T,I>>::from_iter
5: roogle_api::krates
fn (&Option<T>) -> Option<&T>
vs
fn f(&Option<T>) -> Option<&T>
get different result, but only add a name here.
A rustc wrapper that when it detects error message "expects X but found Y", searches roogle to offer some likely suggestions. Doing this properly might not be possible but a bit of ducktape-heath-robinson-hacking might make something that's actually really useful.
Like hoogle.haskell.org
, but for Rust.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.