Rust Search

Find the best content on Rust, curated by the community; a search engine for Rustaceans.
docs.rs
...u64 = key.get_value("TestQWORD")?; println!("TestQWORD = {}", qword_val); key.create_subkey("sub\\key")?; hkcu.delete_subkey_all(&path)?; println!("Trying to open nonexistent key..."); hkcu.open_subkey(&path).unwrap_or_else(|e| match e.kind() { io::ErrorKind::NotFound => panic!("Key doesn't exist"), io::ErrorKind::PermissionDenied => panic!("Access denied...
Crate v0.56.0 2026-03-14
docs.rs
...Example // This could be a cargo build script use rustc_version::{version, version_meta, Channel, Version}; fn main() { // Assert we haven't travelled back in time assert!(version().unwrap().major >= 1); // Set cfg flags depending on release channel match version_meta().unwrap().channel { Channel::Stable => { println!("cargo:rustc-cfg=RUSTC...
Crate v0.4.1 2024-08-28
docs.rs
...templates` dir in the crate root struct HelloTemplate<'a> { // the name of the struct can be anything name: &'a str, // the field name should match the variable name // in your template } fn main() { let hello = HelloTemplate { name: "world" }; // instantiate your struct println!("{}", hello.render().unwrap()); // then render it. } You should...
Crate v0.16.0 2026-04-29
askama.rs
...templates` dir in the crate root struct HelloTemplate<'a> { // the name of the struct can be anything name: &'a str, // the field name should match the variable name // in your template } fn main() { let hello = HelloTemplate { name: "world" }; // instantiate your struct println!("{}", hello.render().unwrap()); // then render it. } You should...
Crate v0.16.0 2026-04-29
askama.rs
...templates` dir in the crate root struct HelloTemplate<'a> { // the name of the struct can be anything name: &'a str, // the field name should match the variable name // in your template } fn main() { let hello = HelloTemplate { name: "world" }; // instantiate your struct println!("{}", hello.render().unwrap()); // then render it. } You should...
Crate v0.16.0 2026-04-29
github.com
...templates` dir in the crate root struct HelloTemplate<'a> { // the name of the struct can be anything name: &'a str, // the field name should match the variable name // in your template } fn main() { let hello = HelloTemplate { name: "world" }; // instantiate your struct println!("{}", hello.render().unwrap()); // then render it. } You should...
Crate v0.16.0 2026-04-29
docs.rs
...Exhaustive matches on the previous six-variant Value enum need either a Value::Tagged(_) arm or a call to Value::untag() / Value::untag_ref() before the match. YAML 1.2 strict booleans by default. country: NO stays "NO" (the YAML 1.2 fix to the "Norway problem") instead of becoming...
Crate v0.0.13 2026-05-27
askama.rs
...templates` dir in the crate root struct HelloTemplate<'a> { // the name of the struct can be anything name: &'a str, // the field name should match the variable name // in your template } fn main() { let hello = HelloTemplate { name: "world" }; // instantiate your struct println!("{}", hello.render().unwrap()); // then render it. } You should...
Crate v0.16.0 2026-04-29
docs.rs
...let mut lru_cache = LinkedHashMap::new(); let key = "key".to_owned(); // Try to find my expensive to construct and hash key let _cached_val = match lru_cache.raw_entry_mut().from_key(&key) { RawEntryMut::Occupied(mut occupied) => { // Cache hit, move entry to the back. occupied.to_back(); occupied.into_mut...
Crate v0.12.1 2026-07-06
crates.io
...Fuzz tests verify the hand-written parser never panics and matches a nom-based reference implementation. light-weight. Minimal dependencies; uses Cargo features so callers can avoid them when undesired. Simple code that minimizes monomorphization bloat. Small data structures; eg http_auth::DigestClient currently weighs in at 32 bytes plus...
Crate v0.1.10 2024-08-31
github.com
...use versions::{Requirement, Versioning}; let req = Requirement::new("^1.2.3").unwrap(); let ver = Versioning::new("1.2.4").unwrap(); assert!(req.matches(&ver)); In this case, the incoming version 1.2.4 satisfies the "caret" constraint, which demands anything greater than or equal to 1.2.3 . See the...
Crate v7.0.0 2025-02-24
docs.rs
...If the dependency is not specified in the configuration, wasm-compose will search the configured search paths for a matching component file. If a component to satisfy the dependency cannot be found, it will remain as an instance import in the composed component; at least one dependency must be satisfied...
Crate v0.257.1 2026-08-19
crates.io
...f64, } impl C { fn dbg_inner(&self) -> usize { dbg!(self.val_c); 3 } } impl Enum { delegate! { // transformed to // // ```rust // match self { // Enum::A(a) => a.dbg_inner(), // Enum::B(b) => { println!("i am b"); b }.dbg_inner(), // Enum::C { v: c } => { c }.dbg_inner(), // } // ``` to match self { Enum::A(a...
Crate v0.13.5 2025-12-10
crates.io
...This can be particularly handy with match statements. /// A trait for managing 8-byte discriminators in a slab of bytes pub trait SplDiscriminate { /// The 8-byte discriminator as a `[u8; 8]` const SPL_DISCRIMINATOR: ArrayDiscriminator; /// The 8-byte discriminator as a slice (`&[u8]`) const SPL_DISCRIMINATOR_SLICE: &'static [u8] = Self...
Crate v0.5.2 2026-03-23
docs.rs
...extern crate udev; fn main() { let mut enumerator = udev::Enumerator::new().unwrap(); enumerator.match_subsystem("tty").unwrap(); for device in enumerator.scan_devices().unwrap() { println!("found device: {:?}", device.syspath()); } } Thread-safety The udev-api does not have any thread-safety guarantees, however many implementations are indeed thread-safe. If you...
Crate v0.9.3 2025-01-23
docs.rs
...Crate containers mirror the stable API of the matched Rust containers and forward to them as much as possible. TiSlice and TiVec can be easily converted to matched Rust containers and back using From , Into , AsRef and AsMut traits. Also, they expose raw property with the original data type. Containers...
Crate v3.5.0 2026-01-18
github.com
...use ratelimit::Ratelimiter; // 10,000 requests/s let ratelimiter = Ratelimiter::new(10_000); loop { match ratelimiter.try_wait() { Ok(()) => { // token acquired -- perform rate-limited action break; } Err(wait) => { // rate limited -- sleep and retry std::thread::sleep(wait); } } } For more control over burst capacity and initial tokens: use ratelimit::Ratelimiter; let...
Crate v2.0.0 2026-04-21
crates.io
...We want to perform one operation on all the leading contiguous // elements that match some predicate, and a different thing with the rest of // the elements. With the `xs`, we will use the normal `take_while`. With the // `ys`, we will use `peeking_take_while`. let xs: Vec<u8> = (0...
Crate v1.0.0 2021-09-03
crates.io
...Features Selector matching support. The rules are sorted by specificity. !important parsing support. Has a high-level parsers and low-level, zero-allocation tokenizers. No unsafe. Minimum supported Rust Version (MSRV) This version of SimpleCSS has been verified to compile with Rust 1.65 and later. Future versions of SimpleCSS...
Crate v0.2.2 2025-01-06
docs.rs
...use lebe::Endian; fn main(){ let mut numbers: &[i32] = &[ 32, 102, 420, 594 ]; numbers.convert_current_to_little_endian(); } Why not use byteorder ? This crate supports batch-writing slices with native speed where the os has the matching endianness. Writing slices in byteorder must be done manually, and may be...
Crate v0.5.3 2025-09-06
"A Box always holds exactly one thing, like a single large struct. A Vec holds zero to many things of exactly one type and can change over time. If you..."

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.