Skip to content

Commit

Permalink
Make the UDP socket's .with pub
Browse files Browse the repository at this point in the history
This helps develop embassy-rs#2516
out-of-tree.

Not cherry-picked from any PR.
  • Loading branch information
chrysn authored and kaspar030 committed Jan 10, 2025
1 parent 6eaef1f commit 2e2a175
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion embassy-net/src/udp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ impl<'a> UdpSocket<'a> {
}
}

fn with<R>(&self, f: impl FnOnce(&udp::Socket, &Interface) -> R) -> R {
/// Lock the stack, provide access to the underlying smoltcp UDP socket and interface
pub fn with<R>(&self, f: impl FnOnce(&udp::Socket, &Interface) -> R) -> R {
self.stack.with(|i| {
let socket = i.sockets.get::<udp::Socket>(self.handle);
f(socket, &i.iface)
Expand Down

0 comments on commit 2e2a175

Please sign in to comment.