Rust Search

Find the best content on Rust, curated by the community; a search engine for Rustaceans.
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
datafusion.apache.org
...It handles schema differences in file scans by rewriting expressions to match the physical schema, including type casting, missing columns, and partition values. For detailed documentation, see the PhysicalExprAdapter trait documentation. Most projects should use the datafusion crate directly, which re-exports this module. If you are already using the...
Crate v55.0.0 2026-08-18
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
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.6 2026-07-20
github.com
...use x509_parser::prelude::*; static IGCA_DER: &[u8] = include_bytes!("../assets/IGC_A.der"); let res = X509Certificate::from_der(IGCA_DER); match res { Ok((rem, cert)) => { assert!(rem.is_empty()); // assert_eq!(cert.version(), X509Version::V3); }, _ => panic!("x509 parsing failed: {:?}", res), } To parse a CRL and print information about revoked...
Crate v0.18.1 2026-02-05
gitlab.com
...Cursor Position Cursor {Up, Down, Forward, Backward} Cursor {Save, Restore} Erase Display Erase Line Set Graphics mode Set/Reset Text Mode Usage let text = "\x1b[31;1;4mHello World\x1b[0m"; for e in parse_ansi(text) { match e.kind() { ElementKind::Text => { println!("Got a text: {:?}", &text[e.range()],); } _ => { println...
Crate v0.3.0 2025-01-30
docs.rs
...MacroArgs = match syn::parse(args) { Ok(v) => v, Err(e) => { return e.to_compile_error().into(); } }; let _input = syn::parse_macro_input!(input as ItemFn); // do things with `args` unimplemented!() } Consuming Code use your_crate::your_attr; #[your_attr(path = "hello", timeout_ms = 15)] fn do_stuff() { println!("Hello"); } Features...
Crate v0.24.1 2026-08-20
docs.rs
...use konst::{ eq_str, option, result::unwrap_ctx, }; #[derive(Debug, PartialEq)] enum Direction { Forward, Backward, Left, Right, } impl Direction { const fn try_parse(input: &str) -> Result<Self, ParseDirectionError> { // As of Rust 1.65.0, string patterns don't work in const contexts match () { _ if eq_str(input, "forward") => Ok(Direction...
Crate v0.3.17 2026-04-16
docs.rs
...Making API calls The following will execute a POST request to /_search?allow_no_indices=true with a JSON body of {"query":{"match_all":{}}} use elasticsearch::{Elasticsearch, Error, SearchParts}; use serde_json::{json, Value}; #[tokio::main] async fn main() -> Result<(), Box<dyn std::error::Error>> { let client = Elasticsearch::default(); // make...
Crate v8.19.0-alpha.1 2025-08-08
docs.rs
...assert_eq!(a != b, true); assert_eq!(a.compare(&b), Cmp::Lt); assert_eq!(a.compare_to(&b, Cmp::Lt), true); // Or match the comparison operators match a.compare(b) { Cmp::Lt => println!("Version a is less than b"), Cmp::Eq => println!("Version a is equal to b"), Cmp::Gt...
Crate v0.2.1 2025-10-31
crates.io
...TcpStream, ) -> Result<(), WebSocketError> { handshake(&mut socket).await?; let mut ws = WebSocket::after_handshake(socket); ws.set_writev(true); ws.set_auto_close(true); ws.set_auto_pong(true); loop { let frame = ws.read_frame().await?; match frame { OpCode::Close => break, OpCode::Text | OpCode::Binary => { let frame = Frame::new(true, frame...
Crate v0.8.1 2026-01-01
docs.rs
y4m
...extern crate y4m; use std::io; let mut infh = io::stdin(); let mut outfh = io::stdout(); let mut dec = y4m::decode(&mut infh).unwrap(); let mut enc = y4m::encode(dec.get_width(), dec.get_height(), dec.get_framerate()) .with_colorspace(dec.get_colorspace()) .write_header(&mut outfh) .unwrap(); loop { match...
Crate v0.8.0 2023-04-21
crates.io
...use docker_credential; use docker_credential::DockerCredential; let credential = docker_credential::get_credential("https://index.docker.io/v1/").expect("Unable to retrieve credential"); match credential { DockerCredential::IdentityToken(token) => println!("Identity token: {}", token), DockerCredential::UsernamePassword(user_name, password) => println!("Username: {}, Password: {}", user_name, password), };
Crate v1.4.0 2026-05-19
docs.rs
...When searching for more than one byte, positions are considered a match if the byte at that position matches any of the bytes. The memmem sub-module provides forward and reverse substring search routines. In all such cases, routines operate on &[u8] without regard to encoding. This is exactly what...
Crate v2.8.3 2026-07-08
crates.io
...pub enum DbDriver { Postgresql, Mysql, } impl std::str::FromStr for DbDriver { type Err = String; fn from_str(s: &str) -> Result<Self, Self::Err> { match s.trim().to_lowercase().as_ref() { "postgres" => Ok(DbDriver::Postgresql), "mysql" => Ok(DbDriver::Mysql), _ => Err(format!("Unknown DB driver: {s}")) } } } #[derive(Envconfig)] pub struct DbConfig { // ... #[envconfig...
Crate v0.11.1 2025-12-10
crates.io
...pub enum DbDriver { Postgresql, Mysql, } impl std::str::FromStr for DbDriver { type Err = String; fn from_str(s: &str) -> Result<Self, Self::Err> { match s.trim().to_lowercase().as_ref() { "postgres" => Ok(DbDriver::Postgresql), "mysql" => Ok(DbDriver::Mysql), _ => Err(format!("Unknown DB driver: {s}")) } } } #[derive(Envconfig)] pub struct DbConfig { // ... #[envconfig...
Crate v0.11.1 2025-12-10
docs.rs
...16) -> Result<Self, Self::Error> { match n { 0 => Ok(Foo::Bar), 100 => Ok(Foo::Baz), 200 => Ok(Foo::Quix), _ => Err(n), } } } fn main() { let bar = Foo::try_from(0); let baz = Foo::try_from(100); let quix = Foo::try_from(200); let bad = Foo::try_from(300); assert_eq!(bar...
Crate v1.0.0 2020-03-30
docs.rs
...syn::DeriveInput) -> syn::Result<TokenStream> { let attrs = Attrs::parse_attrs("from", &input)?; match (attrs.forward.is_some(), !attrs.custom.is_empty()) { (true, true) => Err(syn::Error::new_spanned( input, "`forward` and `on` arguments are mutually exclusive", )), (false, false) => Err(syn::Error::new_spanned( input, "either `forward` or `on` argument is...
Crate v0.5.1 2026-07-22
docs.rs
...use std::io::Read; use wl_clipboard_rs::{paste::{get_contents, ClipboardType, Error, MimeType, Seat}}; let result = get_contents(ClipboardType::Regular, Seat::Unspecified, MimeType::Text); match result { Ok((mut pipe, _)) => { let mut contents = vec![]; pipe.read_to_end(&mut contents)?; println!("Pasted: {}", String::from_utf8_lossy(&contents)); } Err(Error::NoSeats...
Crate v0.8.2 2026-05-07
github.com
...The bindings are checked in CI to ensure that what exists in git matches the output of the script. License This project is licensed under either of Apache License, Version 2.0, ( LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0 ) MIT license ( LICENSE-MIT or http://opensource...
Crate v0.1.13+1.68.1 2026-03-31
"Because lower-level software has more operational constraints than higher-level software (e.g. it typically cannot tolerate a runtime or memory manage..."

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.
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.