Rust Search

Find the best content on Rust, curated by the community; a search engine for Rustaceans.
github.com
...Attribute invocations can only match the `attr` rules, and non-attribute invocations can only match the non-`attr` rules. This allows adding `attr` rules to an existing macro without breaking backwards compatibility. An attribute macro may emit code containing another attribute, including one provided by an attribute macro. An attribute...
RFC 3697 RFC 2024-09-20 ~8 min read
blog.none.at
...If the target returns both the HTML element and the cookie on every single response, the iteration count, HTML match count, and header match count should be identical — any mismatch indicates a parsing or check evaluation bug:=== per-worker results === worker iterations html_match header_match ok? ------------------------------------------------------------------------------------- http://worker1:9091...
Project/Tooling Updates 2026-03-18 ~25 min read
doc.rust-lang.org
...In that regard, macro_rules! can work similarly to a match block: // `test!` will compare `$left` and `$right` // in different ways depending on how you invoke it: macro_rules! test { // Arguments don't need to be separated by a comma. // Any template can be used! ($left:expr; and $right:expr...
Rust by Example Book 2024-01-01 ~1 min read
github.com
...use system_shutdown::shutdown; fn main() { match shutdown() { Ok(_) => println!("Shutting down, bye!"), Err(error) => eprintln!("Failed to shut down: {}", error), } } In most of the systems it does not requires the user to be root/admin. Contributions Pull Requests are welcome! =) License system_shutdown is licensed under either of the...
Crate v4.1.0 2026-01-17
doc.rust-lang.org
pub const fn _mm_setr_ps(a: f32, b: f32, c: f32, d: f32) -> __m128
...This matches the memory order of __m128, i.e., a will be the lowest 32 bits of the result, and d the highest. assert_eq!(__m128::new(a, b, c, d), _mm_setr_ps(a, b, c, d)); Intel's documentation
function core Stable since 1.27.0 Version 1.100.0-nightly
speakerdeck.com
Transcript ALGEBRAIC DATA TYPES enum Color { Red, Green, Blue } enum Tree { Empty, Leaf(int), Node(~Tree, ~Tree) } tag tag int tag ~Tree ~Tree Empty Leaf(int) Node(~Tree, ~Tree) PATTERN MATCHING enum Option<T> { None, Some(T) } fn double(p: ~int) -> int { *p * 2 } OWNERSHIP void *realloc(void *, ...); void free...
Discussion + Blog posts 2013-07-29 ~1 min read
matklad.github.io
...Repr::Custom(Box::new(Custom { kind, error })), } } pub fn get_ref( &self, ) -> Option<&(dyn error::Error + Send + Sync + 'static)> { match &self.repr { Repr::Os(..) => None, Repr::Simple(..) => None, Repr::Custom(c) => Some(&*c.error), } } pub fn into_inner( self, ) -> Option<Box<dyn error::Error + Send + Sync>> { match self.repr { Repr...
Observations/Thoughts 2020-10-21 ~8 min read
fredrik.anderzon.se
...Knock, knock", fruits[i]); println!("WHO'S THERE???"); }, 3 => { println!("{}", fruits[i]); println!("{}, who?", fruits[i]); }, 4 => { println!("{} you glad I didn't say {}?", fruits[i], fruits[0]); println!("facepalm"); }, // Rust wants to make sure your match statements always get a match to avoid // unexpected behaviors, `_` is the "default" or...
News & Blog Posts 2016-05-16 ~19 min read
doc.rust-lang.org
pub fn get<Q>(&self, key: &Q) -> Option<&V>
...The key may be any borrowed form of the map's key type, but the ordering on the borrowed form must match the ordering on the key type. Examples use std::collections::BTreeMap; let mut map = BTreeMap::new(); map.insert(1, "a"); assert_eq!(map.get(&1), Some(&"a")); assert...
method alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn contains<Q>(&self, value: &Q) -> bool
...The value may be any borrowed form of the set's element type, but the ordering on the borrowed form must match the ordering on the element type. Examples use std::collections::BTreeSet; let set = BTreeSet::from([1, 2, 3]); assert_eq!(set.contains(&1), true); assert_eq!(set.contains...
method alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn get<Q>(&self, k: &Q) -> Option<&V>
...The key may be any borrowed form of the map's key type, but Hash and Eq on the borrowed form must match those for the key type. Examples use std::collections::HashMap; let mut map = HashMap::new(); map.insert(1, "a"); assert_eq!(map.get(&1), Some(&"a")); assert...
method std Stable since 1.0.0 Version 1.100.0-nightly
www.freecodecamp.org
...In main let's check that the action passed as an argument is "complete" by using an else if statement: // in the main function if action == "add" { // add action snippet } else if action == "complete" { match todo.complete(&item) { None => println!("'{}' is not present in the list", item), Some(_) => match todo...
Rust Walkthroughs 2021-01-06 ~22 min read
rust-lang.github.io
...The migration lint will be implemented as follows: • Find method calls matching the name of one of the newly added traits' methods. This can be done either by hardcoding these method names or by setting up some kind of registry through the use of an attribute on the relevant traits...
RFC 3114 RFC 2021-02-16 ~6 min read
rust-lang.github.io
...match msg { // you can reorder too! Bind { values, formats, .. } => ... // ... } versus match msg { Bind(_, _, formats, values, _) => ... // ... } This feature gate was originally put in place because there were many serious bugs in the compiler's support for struct variants. This is not the case today. The issue tracker does not appear have...
RFC 418 RFC 2014-10-25 ~2 min read
upsuper.github.io
...matches (Pattern) -> &strfn trim_start_matches (Pattern) -> &strfn trim_end_matches (Pattern) -> &strMatching and findingfn contains (Pattern) -> boolfn starts_with (Pattern) -> boolfn ends_with (Pattern) -> boolfn find (Pattern) -> Option<usize>fn rfind (Pattern) -> Option<usize>fn matches (Pattern) -> Iterator<Item = &str>fn rmatches (Pattern) -> Iterator<Item = &str>fn match_indices...
News & Blog Posts 2019-04-30 ~8 min read
home.expurple.me
Table of Contents“Using thiserror for libraries and anyhow for applications”Pattern matching isn’t the only reason to use structured errorsThe tradeoffsTo be continuedRelated readingDiscussTL;DR I prefer thiserror enums over anyhow, even for application code that simply propagates errors. Custom error types require additional effort, but make the...
Observations/Thoughts 2025-06-04 ~8 min read
notes.eatonphil.com
...Vec<char> = contents.chars().collect(); let tokens = match lex::lex(&raw) { Ok(tokens) => tokens, Err(msg) => panic!("{}", msg), }; let ast = match parse::parse(&raw, tokens) { Ok(ast) => ast, Err(msg) => panic!("{}", msg), }; let pgrm = eval::compile(&raw, ast); eval::eval(pgrm); } Easy peasy. Now let's implement lex. Lexical analysisLexical...
Rust Walkthroughs 2021-12-29 ~25 min read
docs.rs
...Lastly, Radium provides RadiumT type aliases matching all of the AtomicT type names in the standard library. Each of these aliases forwards to its atomic variant when it exists, and to Cell<T> when it does not. Your code can use these names to be portable across targets with varying...
Crate v1.1.1 2025-07-09
blog.veeso.dev
...Option<Vec<(ColumnDef, Value)>>, op: &Operation,) -> Option<Vec<(ColumnDef, Value)>> { match (row, op) { (_, Operation::Insert(_, record)) => Some(record.clone()), (_, Operation::Delete(_)) => None, (None, Operation::Update(_, _)) => None, (Some(mut existing_row), Operation::Update(_, updates)) => { for (col_name, new_value) in updates { if let Some((_, value)) = existing_row .iter_mut() .find(|(col...
Observations/Thoughts 2025-12-10 ~6 min read
substrate.dev
...Search for a matching entry that has matching key bits. Use the address in the entry to query the partial k and value from a value table. Confirm that k matches expected value. Hash index insertion If an insertion is attempted into a full index page a reindex is triggered...
Crate v0.5.7 2026-10-06
"<heycam\> one of the best parts about stylo has been how much easier it has been to implement these style system optimizations that we need, because R..."

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.