maniagnosis.crsr.net
...So I broke down and created some macros: #[macro_export]macro_rules! unpack { ($e:expr,$m:expr) => ( match $e { Ok(v) => v, Err(e) => panic!(format!("{}: {}", $m, e.to_string())), })}#[macro_export]macro_rules! expect { ($e:expr,$m:expr) => ( match $e { Some(e) => e, None => panic!($m), })}#[macro_export]macro...
From the Blogosphere
2015-07-27
~11 min read
docs.rs
...FromRadix10>(text: &[u8]) -> Option<(&[u8], I)> { match I::from_radix_10(text) { (_, 0) => None, (n, used) => Some((&text[used..], n)), } } This crate has more to offer! Check out the full documentation at docs.rs .
Crate
v3.1.0
2026-06-25
deepfence.io
...It usually relies on the haystack finding approach but also regular expression matching approaches. Matching happens on different parts of the HTTP message, it can be headers, port, or even HTML body. Needless to say that such operations are CPU intensive. Here is a rule example:alert http $HOME_NET...
Project/Tooling Updates
2022-07-27
~16 min read
rust-lang-nursery.github.io
...get_typed_func looks up an export by name and checks that its signature matches the Rust generic parameters — (i32, i32) in, i32 out.
Core WebAssembly function parameters are limited to four numeric types: i32, i64, f32, and f64. Strings, structs, and other complex values cannot cross the function boundary...
The Rust Cookbook
Book
2024-01-01
~1 min read
github.com
...The object file is compiled by [this script] https://github.com/bytecodealliance/wit-bindgen/blob/main/ci/rebuild-libwit-bindgen-cabi.sh ) and is verified in repository continuous integration that the checked-in versions match what CI produces.
Crate
v0.44.0
2025-12-05
salvo.rs
...i64, } #[handler] async fn me(depot: &mut Depot, res: &mut Response) { match depot.jwt_auth_state() { JwtAuthState::Authorized => { let data = depot.jwt_auth_data::<Claims>().unwrap(); res.render(Json(&data.claims)); } JwtAuthState::Unauthorized => res.render(StatusError::unauthorized()), JwtAuthState::Forbidden => res.render(StatusError::forbidden()), } } #[tokio::main] async fn main() { let auth...
Crate
v0.95.2
2026-08-06
rsdlt.github.io
...another sequence of units based on of the dictionary.Make the Key and the Message have the same size (number of units or characters).Encode / Decode by matching each unit (or character) in the message and the key in the Vigenére table.For example:Dictionary: ABCDVigenére Matrix:ABCDBCDACDABDABCKey: DCABADMessage: BADCADEncode...
Rust Walkthroughs
2022-09-28
~18 min read
rust-analyzer.github.io
#8222 don’t mark unlinked file diagnostic as unused.
#8246 (first contribution) update VIM YCM installation instructions.
#8250 classify associated types in paths more accurately.
#8256 make "Move item" commands work in more cases.
#8261 fix expansion of OR-patterns in match check.
#8266 fix generic argument lowering in qualified...
Project/Tooling Updates
2021-04-07
~1 min read
cryptographycaffe.sandboxaq.com
...Specifically, the properties we aim to prove ensure that the configuration defined by a Sandwich user matches what Sandwich actually sets when interacting with the cryptographic library.In this initial effort, we focused on the OpenSSL 3 version of Sandwich and defined the following security properties.Safe TLS Protocol VersionsPolicy...
Miscellaneous
2025-04-02
~9 min read
www.greyblake.com
...Vehicle) -> VehicleRecord {
let Vehicle { id , vehicle_type } = vehicle;
let (kind, fuel, max_speed_kph) = match vehicle_type {
VehicleType::Car { fuel, max_speed_kph } => {
(
"Car".to_owned(),
Some(fuel_to_str(fuel).to_owned()),
max_speed_kph.map(|speed| speed.try_into().unwrap() )
)
}
Bicycle => {
(
"Bicycle".to_owned(),
None,
None,
)
}
};
let id...
Rust Walkthroughs
2022-11-02
~7 min read
www.sheshbabu.com
...Self::Message) -> ShouldRender {
match message {
+ Msg::GetProducts => {
+ self.state.get_products_loaded = false;
+ let handler =
+ self.link
+ .callback(move |response: api::FetchResponse<Vec<Product>>| {
+ let (_, Json(data)) = response.into_parts();
+ match data {
+ Ok(products) => Msg::GetProductsSuccess(products),
+ Err(err) => Msg::GetProductsError(err),
+ }
+ });
+ self.task = Some(api::get_products(handler));
+ true...
Learn More Rust
2020-08-11
~29 min read
docs.rs
...fn compute_something(input: &foo::FooAtom) -> u32 { match *input { foo_atom!("foo") => 1, foo_atom!("bar") => 2, _ => 3, } }
Crate
v0.11.0
2026-08-21
www.chriskrycho.com
...Pattern matching and the value of expression blocks.
Functions, closures, and an awful lot of Swift syntax.
Sum types (enums) and more on pattern matching.
Classes and structs (product types), and reference and value types.
Hopes for the next generation of systems programming.
Properties: type and instance, stored and computed...
News & Blog Posts
2016-03-07
~3 min read
jrvidal.github.io
...The wildcard pattern _ [...] In this case it acts like a final "catchall" in this
match expression.
And more...
There are many more minor contextual details that I've enjoyed adding (some of them were already mentioned in my previous post):
Writing the receiver of a method explicitly: mut self: &Self...
Tooling
2020-12-16
~3 min read
www.techofnote.com
...Vec<_> = self
.cell_positions()
.iter()
.map(|pos| self.cell(pos))
.filter_map(|cell| match &cell.symbol {
Some(symbol) => match symbol {
Symbol::Square(colour) | Symbol::Sun(colour) => Some((colour, &cell.region)),
},
None => None,
})
.collect();
let square_regions: Vec<_> = self
.cell_positions()
.iter()
.map(|pos| self.cell(pos))
.filter_map(|cell| match...
Rust Walkthroughs
2022-09-07
~9 min read
insanitybit.github.io
...self.queue_url.clone()
};
match self.sqs_client.delete_message_batch(&req) {
Ok(res) => {
unimplemented!()
},
Err(e) => {
println!("Failed to deleted {} messages {}", msg_count ,e);
}
}
}
}
A message for communicating to it:
pub enum MessageDeleterMessage {
DeleteMessages {
receipts: Vec<(String, Instant)>,
},
}
A ‘route_msg’ function to destructure the message and pass it...
News & Blog Posts
2017-07-18
~9 min read
docs.rs
...Support for computing multiple BLAKE2s hashes in parallel, matching the efficiency of BLAKE2sp. See the many module. Example use blake2s_simd::{blake2s, Params}; let expected = "08d6cad88075de8f192db097573d0e829411cd91eb6ec65e8fc16c017edfdb74"; let hash = blake2s(b"foo"); assert_eq!(expected, &hash.to_hex()); let hash = Params::new() .hash_length(16) .key(b"Squeamish Ossifrage") .personal(b...
Crate
v1.0.5
2026-08-20
doc.rust-lang.org
primitive char
...The gap in valid char values is understood by the compiler, so in the below example the two ranges are understood to cover the whole range of possible char values and there is no error for a non-exhaustive match.
let c: char = 'a';
match c {
'\0' ..= '\u{D7FF}' => false...
primitive
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
primitive char
...The gap in valid char values is understood by the compiler, so in the below example the two ranges are understood to cover the whole range of possible char values and there is no error for a non-exhaustive match.
let c: char = 'a';
match c {
'\0' ..= '\u{D7FF}' => false...
primitive
std
Stable since 1.0.0
Version 1.100.0-nightly
passcod.name
...U8) -> U8 {{
match n {{
\u{FFA0}0 => \u{FFA0}1,
\u{FFA0}1 => \u{FFA0}1,
_ => fibonacci(n - \u{FFA0}1) + fibonacci(n - \u{FFA0}2),
}}
}}
fn factorial(n: U12) -> U12 {{
match n {{
\u{FFA0}\u{FFA0}0 | \u{FFA0}\u{FFA0}1 => \u{FFA0}\u{FFA0}1,
_ => factorial(n...
Rust Walkthroughs
2021-10-06
~18 min read