Rust Search

Find the best content on Rust, curated by the community; a search engine for Rustaceans.
blog.sheerluck.dev
...fn log_oneline(commits: &HashMap<String, Commit>, start_hash: &str) { let mut hash = start_hash.to_string(); loop { match commits.get(&hash) { Some(commit) => { let short_hash = &hash[..7]; let first_line = commit.message.lines().next().unwrap_or(""); println!("{} {}", short_hash, first_line); match commit.parent_hashes.first() { Some(parent...
Rust Walkthroughs 2026-05-27 ~22 min read
guillaumegomez.github.io
...documentation. @QuietMisdreavus updated rustdoc to print non-self arguments of bare functions and struct methods on their own line. @kmcallister updated Arc docs to match new Rc docs. @liigo updated rustdoc to inline sidebar items, to display more in a page. @sinkuu made E0243/E0244 message consistent with E0107. @christopherdumas...
Other weeklies from Rust community 2016-10-04 ~2 min read
hermanradtke.com
...fn tick(&mut self, event_loop: &mut EventLoop<Server>) { trace!("Handling end of tick"); let mut reset_tokens = Vec::new(); for c in self.conns.iter() { if c.is_reset() { reset_tokens.push(c.token); } } for token in reset_tokens { match self.conns.remove(token) { Some(_c) => { debug!("reset connection...
News & Blog Posts 2015-10-26 ~7 min read
trifectatech.org
...u64; match operation { 1 => { *value += 10 as libc::c_int; current_block_1 = 4407541767199398248; } 2 => { current_block_1 = 4407541767199398248; } _ => { current_block_1 = 12675440807659640239; } } match current_block_1 { 4407541767199398248 => { *value *= 2 as libc::c_int; } _ => {} }; } We can try to find some better names for the labels, but otherwise it's not...
Rust Walkthroughs 2025-03-12 ~11 min read
codeinput.com
...Though I knew from the start that each editor would need its own integration, the pattern matching logic for CODEOWNERS rules stays the same across all of them; and it was important that this code produce consistent results whether it ran in Lua or Rust. So the challenge was twofold...
Rust Walkthroughs 2026-03-25 ~6 min read
poignardazur.github.io
...The (T, ...Ts) syntax that lets our trait impl match tuples with at least one element. The (head, ...tail) syntax that lets us destructure our tuple and get a tail tuple. Already we can make some DX observations: We replaced an iterative loop with a tail-recursive loop (well, almost...
Observations/Thoughts 2025-07-16 ~19 min read
rvarago.github.io
...From Vec<T> into IndexedVec<T, N> if N matches the run-time length of Vec<T>. impl<T, N: Nat> TryFrom<Vec<T>> for IndexedVec<T, N> { type Error = (); // TODO: Use a better error type. fn try_from(value: Vec<T>) -> Result<Self, Self::Error> { if value.len() == N...
Observations/Thoughts 2025-02-26 ~2 min read
blog.joco.dev
...Arc<Mutex<HashMap<String, User>>>, ) -> Result<impl warp::Reply, warp::Rejection> { let users = db.lock().await; match users.get(&credentials.username) { None => Ok(StatusCode::BAD_REQUEST), Some(user) => { if credentials.password == user.password { Ok(StatusCode::OK) } else { Ok(StatusCode::UNAUTHORIZED) } } } } This function takes the given credentials and checks to see...
News & Blog Posts 2019-12-03 ~6 min read
dev.to
...Here are representative host functions you’ll see in pallet-revive-uapi (names match the HostFn surface): Host Function Purpose set_storage / get_storage Write/read contract storage (key/value). call / instantiate Call another contract / deploy a new contract instance. deposit_event Emit an event (topics + data). caller / origin Get...
Rust Walkthroughs 2026-02-18 ~11 min read
dev.to
...The UI never blocks — it just renders whatever state it has and updates when events arrive. // Sending a query from UI thread let _ = self.db_tx.send(DbCommand::Execute(sql)); // Receiving results in the same UI update loop while let Ok(event) = self.db_rx.try_recv() { match event { DbEvent...
Project/Tooling Updates 2026-03-25 ~2 min read
arzg.github.io Archived: primary link replaced with an archive on 2026-09-12T11:26:12.726Z (UTC; replacement date, not snapshot date)
...TokenKind) -> Self { match token_kind { TokenKind::Whitespace => Self::Whitespace, TokenKind::FnKw => Self::FnKw, TokenKind::LetKw => Self::LetKw, TokenKind::Ident => Self::Ident, TokenKind::Number => Self::Number, TokenKind::Plus => Self::Plus, TokenKind::Minus => Self::Minus, TokenKind::Star => Self::Star, TokenKind::Slash => Self::Slash, TokenKind::Equals => Self::Equals, TokenKind::LParen => Self::LParen, TokenKind...
Rust Walkthroughs 2020-12-23 ~10 min read
linebender.org
...Using it has trade-offs around bandwidth usage in CI, but otherwise matches our use-case perfectly. The demo for the stroke expansion paper, which was created using Xilem Web. An interactive version can be found on the paper's website. Parley Parley is a text layout library. Nico Burns...
Project/Tooling Updates 2024-08-14 ~2 min read
zupzup.org
...let config = match Config::init() { Ok(v) => v, Err(e) => panic!("Could not read config from environment: {}", e), }; For logging we use the slog crate. I won’t go into any details on logging, but there are several ways to set it up. The way we will use in our...
News & Blog Posts 2019-04-09 ~10 min read
postacnormalna.pl
...f64) { // Flap if space is pressed let input = Input::godot_singleton(); if Input::is_action_pressed(&input, "ui_flap") { match self.state { PlayerState::Flying => { self.state = PlayerState::Flapping; self.flap(owner); } PlayerState::Flapping => self.flap(owner), PlayerState::Dead => {} } } . . . } Kolejnym miejscem, w którym należy rozważyć aktualny stan kraboptaka, jest dalsza część...
Rust Walkthroughs 2021-02-03 ~11 min read
fitzgeraldnick.com
...fn foo() -> impl Future<Output = ()> { use std::future; use std::pin::Pin; use std::task::Poll; future::from_generator(move || { // Awaiting `task::sleep`. { let mut pinned = task::sleep(<Duration>::from_millis(100)); loop { match future::poll_with_tls_context(unsafe { Pin::new_unchecked(&mut pinned) }) { Poll::Ready(()) => break, Poll::Pending...
News & Blog Posts 2019-08-27 ~7 min read
gruebelinchen.wordpress.com
...ContactFormMessage) = event.payload()? else {        return Ok(Response::builder()            .status(StatusCode::BAD_REQUEST)            .body("Could not extract message payload".into())            .unwrap());    };    match self.process_message(message).await {        Ok(_) => Ok(Response::builder()            .status(StatusCode::OK)            .body("Message sent".into())            .unwrap()),        Err(_) => Ok(Response::builder()            .status(StatusCode::INTERNAL_SERVER_ERROR)            .body("Could not...
Rust Walkthroughs 2023-12-13 ~6 min read
rust-lang.github.io
...satisfied wherever the struct or enum is used with actual type parameters. Motivation Makes type checking saner. Catches errors earlier in the development process. Matches behaviour with built-in bounds (I think). Currently formal type variables in traits and functions may have bounds and these bounds are checked whenever the...
RFC 34 RFC 2014-04-05 ~2 min read
blog.veeso.dev
...Future, { let mut f = unsafe { Pin::new_unchecked(&mut f) }; let thread = std::thread::current(); let waker = Arc::new(SimpleWaker { thread }).into(); let mut ctx = Context::from_waker(&waker); loop { println!("polling future"); match f.as_mut().poll(&mut ctx) { Poll::Ready(val) => { println!("future is ready"); return val; } Poll...
Observations/Thoughts 2025-03-19 ~6 min read
rust-lang.github.io
...Adding a dependency To depend on a library hosted on crates.io, you modify hello_world.rs: #!/usr/bin/env cargo //! ```cargo //! [dependencies] //! regex = "1.8.0" //! ``` fn main() { let re = Regex::new(r"^\d{4}-\d{2}-\d{2}$").unwrap(); println!("Did our date match? {}", re.is_match("2014...
RFC 3424 RFC 2023-04-26 ~16 min read
nitschinger.at
...position, } } #[inline] fn convert_term(term: &str) -> Term { if term.len() <= MAX_STACK_TERM_LEN { Term::Stack(ArrayString::<[_; MAX_STACK_TERM_LEN]>::from(term).unwrap()) } else { Term::Heap(term.to_string()) } } #[inline] pub fn term(&self) -> &str { match self.term { Term::Heap(ref s) => s.as_ref(), Term::Stack(ref...
Blog Posts 2016-11-01 ~15 min read
"Rust-based Python type checkers are like buses - you wait ages for one and then two come along at once."

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.