Rust Search

Find the best content on Rust, curated by the community; a search engine for Rustaceans.
thunderseethe.dev
...AstTypeVar is a simple wrapper enum to allow this (like TyApp):enum AstTypeVar { Ty(ast::TypeVar), Row(ast::RowVar), } It provides a single helper method kind():impl AstTypeVar { fn kind(&self) -> Kind { match self { AstTypeVar::Ty(_) => Kind::Type, AstTypeVar::Row(_) => Kind::Row, } } } We found this method used in the construction...
Observations/Thoughts 2025-02-19 ~11 min read
rust-lang.github.io
...IntoIterator<Item = u8>> Iterator for RlEncode<I> { type Item = u8; fn next(&mut self) -> Option<Self::Item> { let xs = self.xs.get_or_insert_with(|| unsafe { self.into_xs.take().unwrap_unchecked().into_iter() }); if let Some(x) = self.yield_x.take() { return Some(x); } loop { match (xs.next(), self...
RFC 3513 RFC 2023-10-10 ~19 min read
simonask.github.io
...And even though the code was ported with a true dedication to matching the original semantics, and even the general "shape" of the API, many things could go wrong - particularly around flow control and errors. See, the use of gotos is emulated by c2rust using complicated loop/match/break constructs...
Observations/Thoughts 2024-02-14 ~18 min read
developerlife.com
...InvalidDigit } /// ``` #[test] fn test() -> Result<(), Box<dyn std::error::Error>> { fn return_error_result() -> Result<u32, std::num::ParseIntError> { "1.2".parse::<u32>() } fn run() -> Result<(), Box<dyn std::error::Error>> { // It is as if the `?` is turned into the following code. // let result = match result { // Ok(value) => value, // Err...
Rust Walkthroughs 2024-06-12 ~7 min read
www.infoq.com
...It's taken a few thorough redesigns but CXX on Cargo now comes close to matching the experience of CXX in a natively polyglot build system. That pleasantly encompasses Rust depending on C++, C++ depending on Rust, and C++ depending on C++ from other crates. InfoQ: How would you describe...
Miscellaneous 2020-12-09 ~3 min read
www.techofnote.com
...It then returns true if the total matches the second argument k. In this example, all the ints are set to 1, so it effectively checks whether the number of true bools is 0, 1 or 2 respectively. Finally, we check that the line is continuous, and starts/ends at...
Observations/Thoughts 2022-08-31 ~7 min read
asterinas.github.io
...We connect Cursor to ConcreteCursor with Cursor::relate(), which checks, for instance, that self.va and self.level match model.path.vaddr() and the path length in model. pub open spec fn relate(self, model: ConcreteCursor) -> bool recommends model.inv(), { &&& self.level == NR_LEVELS() - model.path.len() &&& self.va == model...
Project/Tooling Updates 2025-02-19 ~8 min read
romankudryashov.com
...pub async fn get_planet(&self, planet_id: &str) -> Result<Planet, CustomError> { let cache_key = self.get_planet_cache_key(planet_id); let mut con = self.redis_client.get_async_connection().await?; let cached_planet = con.get(&cache_key).await?; match cached_planet { Value::Nil => { debug!("Use database to retrieve...
Rust Walkthroughs 2021-06-23 ~11 min read
rustc-dev-guide.rust-lang.org
...You can use a regex to match on that LocalDefId to log type checking for a specific function: RUSTC_LOG=[typeck{key=.*name_of_item.*}] Different queries have different arguments. You can find a list of queries and their arguments in rustc_middle/src/queries.rs. Broad module level filters...
Guide to Rustc Development Book 2024-01-01 ~7 min read
aimdb.dev
...impl Connection for UdsConnection { fn recv(&mut self) -> BoxFut<'_, TransportResult<Option<Vec<u8>>>> { Box::pin(async move { let mut line = String::new(); match self.reader.read_line(&mut line).await { Ok(0) => Ok(None), // EOF — peer closed Ok(_) => { while matches!(line.as_bytes().last(), Some(b'\n' | b'\r')) { line...
Project/Tooling Updates 2026-07-01 ~7 min read
rust-dd.com
...PinState) -> Result<(), P::Error> { loop { match state { PinState::Low => { if self.pin.is_low()? { break; } } PinState::High => { if self.pin.is_high()? { break; } } } self.delay.delay_us(1); } Ok(()) } With this new method, we can now wait first for the high state and then for the low state: self.wait...
Project/Tooling Updates 2025-07-30 ~8 min read
lambda-the-ultimate.org
...Doing N things in succession, each of which can generate an error, is either verbose (match statement) or obscure ("and_then()"). You get to pick. Or you can just use ".unwrap()", which extracts the value from a Some form and makes a failure fatal. It's tempting to over-use...
Blog Posts 2015-02-02 ~3 min read
killercup.github.io
...Auto merge of #49447 - pnkfelix:remove-cfg-const-pat-hack-47295, r=nikomatsakis Remove adjacent all-const match arm hack. An old fix for moves-in-guards had a hack for adjacent all-const match arms. The hack was explained in a comment, which you can see here: https://github...
What 2015-04-20 ~49 min read
blog.frankel.ch
...Api<Pod> = Api::namespaced(client, "kube-system"); let mut stream = api.watch(&ListParams::default(), "0") (1) .await? (2) .boxed(); (3) while let Some(event) = stream .try_next() (4) .await? { (5) match event { _ => {} }; } } 1 Call watch() that returns a Result 2 Await to either get the underlying Stream or return an...
Rust Walkthroughs 2021-07-14 ~8 min read
www.mess.org
...The lexer and the parser are in one big definition; so we can match seconds as a keyword only where it is expected; in other cases, it can be a variable name. This would mean an end to most keywords. That would be nice.
Project/Tooling Updates 2021-04-07 ~3 min read
pythonspeed.com
...Normal integer arithmetic is also avoided to avoid bugs caused by overflows; saturating APIs are used instead. #![deny( clippy::expect_used, clippy::unwrap_used, clippy::ok_expect, clippy::integer_division, clippy::indexing_slicing, clippy::arithmetic_side_effects, clippy::panic, clippy::match_on_vec_items, clippy::manual_strip, clippy::await_holding...
Observations/Thoughts 2021-09-08 ~8 min read
lewiscampbell.tech
...trait based polymorphism pattern matching closures operator overloading monadic error handling a macro system more akin to a LISP than to C Everything Zig leaves out in the name of "simplicity", Rust includes to be more expressive. Even it's much touted "safety" is accomplished through an affine-like type...
Miscellaneous 2025-01-22 ~3 min read
engineering.backtrace.io
...Unfortunately, the result is slower than a native solution, and, without help from the underlying allocator, it’s easy to incorrectly match tags between malloc and free calls. In my experience, this frequently leads to useless allocation statistics, usually around the very faulty code paths one is attempting to debug...
Observations/Thoughts 2021-08-10 ~13 min read
dev.to
...This means as we saw in the previous chapter, we can mix and match these models to get the best possible performance for any use case. Multi-threading Rust provides building blocks to create and manage OS threads as part of the standard library and it also provides implementations required...
Rust Walkthroughs 2020-12-30 ~13 min read
iantayler.com
...FBSim uses const fn with a match statement, so you will need a relatively new version of the Rust compiler. If you’re getting errors mentioning const fn and match, then you probably need to update your compiler to a newer version. Build FBSim Linux In order for amethyst to...
Rust Walkthroughs 2020-11-25 ~12 min read
"My Rust memoirs will be called "Once in 'a lifetime"."

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.