Rust Search

Find the best content on Rust, curated by the community; a search engine for Rustaceans.
docs.rs
...u32) -> u32 { match n { 0 | 1 => 1, _ => fib(n-1).await + fib(n-2).await } } The compiler helpfully tells us that: error[E0733]: recursion in an `async fn` requires boxing --> src/main.rs:1:26 | 1 | async fn fib(n : u32) -> u32 { | ^^^ recursive `async fn` | = note: a recursive `async fn...
Crate v1.2.0 2026-10-03
docs.rs
...assert_eq!(queue.pop(), None); // There are Entry API if you want to avoid double hash lookups match queue.entry("Entry"){ Entry::Vacant(entry)=>entry.set_priority(10), Entry::Occupied(_)=>unreachable!(), }; match queue.entry("Entry"){ Entry::Vacant(_)=>unreachable!(), Entry::Occupied(entry)=>{ assert_eq!(entry.get_key(), &"Entry"); assert_eq!(entry...
Crate v0.4.2 2023-11-15
github.com
yap
...let mut current_op = Op::Plus; let mut current_digit = 0; for d in op_or_digit.into_iter() { match d { OpOrDigit::Op(op) => { current_op = op }, OpOrDigit::Digit(n) => { match current_op { Op::Plus => { current_digit += n }, Op::Minus => { current_digit -= n }, Op::Multiply => { current_digit *= n }, } }, } } assert_eq...
Crate v0.12.0 2023-11-18
github.com
...examples/matching.rs includes matching.go by Stefan Nilsson, licensed under Creative Commons Attribution 3.0 Unported License. tests/mpsc.rs includes modifications of code from The Rust Programming Language, licensed under the MIT License and the Apache License, Version 2.0. tests/golang.rs is based on code from...
Crate v0.5.17 2026-09-05
crates.io
...How to get a compatible version of protoc The protoc binary that you use to generate code needs to have a version that exactly matches the version of the protobuf crate you are using. More specifically, if you are using Rust protobuf x.y.z then you need to use...
Crate v4.36.2-release 2026-09-17
docs.rs
...loop { for issue in &page { println!("{}", issue.title); } page = match octocrab .get_page::<models::issues::Issue>(&page.next) .await? { Some(next_page) => next_page, None => break, } } HTTP API The typed API currently doesn't cover all of GitHub's API at this time, and even if it did GitHub is...
Crate v0.54.9 2026-10-31
crates.io
A crate of the gitoxide project dealing with pattern matching
Crate v0.30.0 2026-11-22
docs.rs
Diff library with semantic cleanup, based on Google's diff-match-patch
Crate v1.0.11 2026-03-15
docs.rs
...Some things wouldn't ever be written on one line, like this match expression, and certainly not with a comma in front of the closing brace: fn eq(&self, other: &IpAddr) -> bool { match other { IpAddr::V4(v4) => self == v4, IpAddr::V6(_) => false, } } Some places use non-multiple-of-4 indentation...
Crate v0.3.0 2026-07-18
docs.rs
...extern crate version_check as rustc; match rustc::is_min_date("2018-12-18") { Some(true) => "Yep! It's recent!", Some(false) => "No, it's older.", None => "Couldn't determine the rustc version." }; Check that the running compiler supports feature flags: extern crate version_check as rustc; match rustc::is...
Crate v0.9.5 2024-07-25
crates.io
Emulate macro-rules pattern matching in procedural macros proc-macro-rules macros You are probably looking for the proc-macro-rules crate.
Crate v0.4.0 2023-11-07
docs.rs
...Here's a simple example that matches a date in YYYY-MM-DD format and prints the year, month and day: use regex_lite::Regex; fn main() { let re = Regex::new(r"(?x) (?P<year>\d{4}) # the year - (?P<month>\d{2}) # the month - (?P<day>\d{2}) # the...
Crate v0.1.9 2026-11-19
crates.io
...let parser = parser.map(|event| match event { Event::SoftBreak => Event::HardBreak, _ => event }); Or expanding an abbreviation in text: let parser = parser.map(|event| match event { Event::Text(text) => Event::Text(text.replace("abbr", "abbreviation").into()), _ => event }); Another simple example is code to determine the max nesting level: let mut max...
Crate v0.13.6 2026-10-30
sentry.io
...use sentry::integrations::tracing::EventFilter; use tracing_subscriber::prelude::*; let sentry_layer = sentry::integrations::tracing::layer() .event_filter(|md| match *md.level() { tracing::Level::ERROR => EventFilter::Event, _ => EventFilter::Ignore, }) .span_filter(|md| matches!(*md.level(), tracing::Level::ERROR | tracing::Level::WARN)); tracing_subscriber::registry() .with(tracing_subscriber::fmt::layer()) .with...
Crate v0.49.6 2026-11-16
github.com
...0.3.8 Tracking upstream to match version 0.7.1 Recommended to upgrade from 0.3.7 to get an important bug fix. 0.3.7 Tracking upstream to match version 0.7 0.3.4 Tracking upstream to version 0.6.2. 0.3.3 Tracking upstream to...
Crate v0.7.6 2026-10-02
docs.rs
...Click, click, click!", termion::clear::All, termion::cursor::Goto(1, 1)).unwrap(); stdout.flush().unwrap(); for c in stdin.events() { let evt = c.unwrap(); match evt { Event::Key(Key::Char('q')) => break, Event::Mouse(me) => { match me { MouseEvent::Press(_, x, y) => { write!(stdout, "{}x", termion::cursor::Goto(x, y)).unwrap...
Crate v4.0.6 2025-11-21
crates.io
GraphQL introspection query and response types. graphql-introspection-query This crate defines structs implementing serde::Deserialize that match the shape returned by a spec-compliant GraphQL API presented with the introspection query.
Crate v0.3.0 2025-12-08
crates.io
...shortcuts(["ctrl+d", "alt+space"])? .with_handler(|app, shortcut, event| { if event.state == ShortcutState::Pressed { if shortcut.matches(Modifiers::CONTROL, Code::KeyD) { let _ = app.emit("shortcut-event", "Ctrl+D triggered"); } if shortcut.matches(Modifiers::ALT, Code::Space) { let _ = app.emit("shortcut-event", "Alt+Space triggered"); } } }) .build(), )?; } Ok(()) }) .run(tauri::generate...
Crate v3.0.0-alpha.3 2026-10-14
docs.rs
The tree-sitter Language type, used by the library and by language implementations Tree-sitter Language This crate provides a LanguageFn type for grammars to create Language instances from a parser, without having to worry about the tree-sitter crate version not matching.
Crate v0.1.9 2026-10-08
docs.babelmonkeys.de
...use xml::{Event, Parser}; // Create a new Parser let mut p = Parser::new(); // Feed data to be parsed p.feed_str("<a href"); p.feed_str("='//example.com'/>"); // Get events for the fed data for event in p { match event.unwrap() { Event::ElementStart(tag) => println!("<{}>", tag.name), Event::ElementEnd(tag...
Crate v0.3.0 2020-03-08
"# Bastion of the Turbofish Beware travellers, lest you venture into waters callous and unforgiving, where hope must abandoned, ere it is cruelly torn..."

Search tips

Type anything to search across articles, videos (including conference talks), podcasts, research, crates, and Rust API documentation. These operators give you finer control — click an example to try it.

Find pages containing all your words. Pages where the words appear together rank higher.
Quote part of your query to keep those words together as an exact phrase within a larger search.
Wrap the whole query in quotes for a verbatim search that matches text exactly, punctuation and all — perfect for Rust syntax. Needs at least 3 characters.
Put ! first to open the top result immediately. Quote the whole query for a literal leading bang, as in '!Send'. Bangs elsewhere, such as println!, stay literal. Browser and launcher shortcuts can invoke this directly. See search integrations.
Limit results to a single site. Works on its own () too. One site: per search.

Use the tabs and filters above the results to narrow by content type, publication year, and sort order.