www.byronwasti.com
...Currently, Balter's control loops for error rate matching and latency matching are slow. By polling more often, the control loops would be run more often and Balter would be faster at converging to a specified error rate or latency. However, we don't want to provide bad data to...
Observations/Thoughts
2024-05-29
~5 min read
github.com
...If the type ascription expression is
in reference context, then we require the ascribed type to exactly match the
type of the expression, i.e., neither subtyping nor coercion is allowed. These
reference contexts are as follows (where `<expr>` is a type ascription
expression):
```
&[mut] <expr>
let ref [mut] x...
RFC 803
RFC
2015-02-03
~6 min read
lab.whitequark.org
...EthernetProtocolType::Ipv4 => {
let ip_packet = try!(Ipv4Packet::new(eth_frame.payload()));
match try!(Ipv4Repr::parse(&ip_packet)) {
// ...
Ipv4Repr { protocol: InternetProtocolType::Udp, src_addr, dst_addr } => {
let udp_packet = try!(UdpPacket::new(ip_packet.payload()));
udp_payload = udp_packet.data();
}
},
EthernetProtocolType::Ipv6 => {
let ip_packet = try!(Ipv6Packet::new(eth_frame.payload...
News & Blog Posts
2016-12-20
~9 min read
siciarz.net
...plugin)] extern crate regex_macros;
rusti=> extern crate regex;
rusti=> let re = regex!(r"\b[a-z]{6}:[0-9]{3}\b"); re.is_match("qwerty:123")
true
One great thing about rusti is the .type command which shows the type of an expression. (It's quite similar to :type...
24 Days of Rust continues!
2014-12-22
~2 min read
rust-gpu.github.io
...Look at other commit messages and
match the format. Match the style of other Rust shader commits. Include the
lockfile."
I would just paste those lines back in from the golden prompt. So, Claude was
effectively "three-shotting" the task. I think it was forgetting due to a small context...
Rust Walkthroughs
2025-06-25
~9 min read
www.sea-ql.org
...loop { match ws.next().await { Some(Ok(Message::Text(data))) => { if data == r#"{"event":"heartbeat"}"# { continue; } println!("{data}"); } Some(Err(e)) => bail!("Socket error: {e}"), None => bail!("Stream ended"), e => bail!("Unexpected message {e:?}"), }}
2. Redis / Kafka Stream Producer
Step 1, create a SeaStreamer instance connecting to Redis / Kafka:
let...
Rust Walkthroughs
2024-05-08
~5 min read
boats.gitlab.io
...If its a part of the pattern, then it would be an
irrefutable pattern that would match any future and await it, and could be used
in other positions (like the branches of a match statement). If its part of the
loop, then its just a modified form of the...
News & Blog Posts
2019-04-16
~6 min read
forgestream.idverse.com
...let mut tries_remaining = 3;
loop {
match uploader.upload(chunk.clone()) {
Ok(()) => break,
Err(e @ UploadError::UploadFailed(_)) => {
warn!("Upload failed: {e}");
tries_remaining -= 1;
if tries_remaining == 0 {
return Err(e.to_string());
}
}
Err(e) => {
return Err(e.to_string());
}
}
}
}
Ok(())
}
We created an Uploader trait so that we can...
Observations/Thoughts
2025-08-20
~5 min read
www.atriiy.dev
...Match imports with exports
With all module exports resolved, the next step is to match each import to its corresponding export. This entire process is managed using the data and structures encapsulated within the BindImportsAndExportsContext.
struct BindImportsAndExportsContext<'a> {
pub index_modules: &'a IndexModules,
pub metas: &'a mut LinkingMetadataVec,
pub symbol...
Miscellaneous
2025-06-18
~23 min read
natkr.com
...PlayTrick<'a>,
},
}
impl<'a> SimpleFuture<()> for TrickOrTreat<'a> {
fn poll(&mut self) -> Poll<()> {
loop {
match self {
TrickOrTreat::Init => {
let house = House {
street: "Riksgatan".to_string(),
house_number: 3,
};
*self = TrickOrTreat::DemandTreat {
house,
demand_treat: DemandTreat {
house: &house,
}
};
}
_ => todo!(),
}
}
}
}
error[E0597]: `house` does not live long enough
--> src/main.rs:76...
Observations/Thoughts
2025-05-28
~20 min read
fasterthanli.me
...we never use `sleep` anymore, and `socket` is `Unpin`
std::mem::swap(unsafe { self.as_mut().get_unchecked_mut() }, &mut state);
match state {
Acceptor::Waiting { socket, .. } => {
// necessary to avoid closing the socket on drop
std::mem::forget(socket)
}
_ => unreachable!(),
};
match unsafe { self.get_unchecked_mut() } {
Acceptor::Listening { ln } => {
let (stream...
Rust Walkthroughs
2022-04-06
~41 min read
tweedegolf.nl
...LoRaChannel) {
self.radio.set_channel(channel.into())
}
}
Other than that, the set_channel implementation is basically a match over the supported modulation types. the HAL is
used to properly configure the radio for each specific case.Using an enum for modulation types and converting with the From trait works fine...
Rust Walkthroughs
2022-04-20
~9 min read
redox-os.org
...Also, the addition of a really nice match-case construct to the grammar. @mmstick along with @myfreeweb have been working on Ion’s job control facility on things like adding support for process groups, handling of SIGTERM and SIGTSTP and the addition of bg, wait and jobs builtin commands.
On...
News & Blog Posts
2017-07-11
~5 min read
guillaumegomez.github.io
...Recent doc contributions
@ollie27 gave primitive types stability attributes in rustdoc.
@radix made a minor improvement to strange grammar in E0525.
@frewsxcv added doc examples & description in std::os::unix::ffi, made minor improvements to docs in std::env structures/functions, added ‘platform-specific’ section to sleep_ms to match...
Other Weeklies from Rust Community
2017-01-24
~2 min read
guillaumegomez.github.io
...Recent doc contributions
@estebank accounted for missing keyword in fn/struct definition, suggested using slice when encountering let x = ""[..];, used suggestions instead of notes ref mismatches, pointed to next token when it is in the expected line, highlighted & when type matches on type mismatch error and shortened output of E0391...
News & Blog Posts
2017-12-05
~2 min read
without.boats
...Rust already uses
this structural equality property when implementing matching. If you derive Eq and PartialEq for
your type and all its members, it should meet the structural equality property needed to be used in
matches and const generics.No complex expressions based on generic types or constsThe other limitation...
News & Blog Posts
2020-07-21
~6 min read
gill.net.in
...web::Data<Pool>) -> Result<SlimUser, ServiceError> {
use crate::schema::users::dsl::{email, users};
let conn = &pool.get()?;
let mut items = users
.filter(email.eq(&auth_data.email))
.load::<User>(conn)?;
if let Some(user) = items.pop() {
if let Ok(matching) = verify(&user.hash, &auth_data.password) {
if matching {
return Ok...
News & Blog Posts
2019-06-11
~21 min read
rust-gcc.github.io
...fix ICE with bad match arm type
PR2065
Fix bad handling of generic lifetimes
PR2063
gccrs: Fix bad cast error to bool
PR2062
Remove commented out TuplePatternItemsSingle
PR2058
ast: Refactor rust-ast-lower-type.h to source file
PR2057
Add proper support for `pub(crate)`
PR2056
docker: Do not run...
Project/Tooling Updates
2023-04-12
~9 min read
doc.rust-lang.org
...The soname is resolved at compile time by scanning the compiler's library path and matching the optional crate_name provided against the crate_name attributes that were declared on the external crate when it was compiled. If no crate_name is provided, a default name attribute is assumed, equal...
The Rust Reference
Book
2024-01-01
~2 min read
mainmatter.com
...EDeserialize<'a>,
{
let mut de = serde_json::Deserializer::from_str(s);
let error = match T::deserialize(&mut de) {
Ok(v) => {
return Ok(v);
}
Err(e) => e,
};
// [...]
}Nothing new on the happy path—it's the very same thing you're doing today in your own applications with vanilla serde. We...
Observations/Thoughts
2025-02-19
~5 min read