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 Sep 19, 2024
1 parent 25de82d commit 69a2ba9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions embassy-net/src/udp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ impl<'a> UdpSocket<'a> {
}
}

/// Lock the stack, provide access to the underlying smoltcp UDP socket and interface
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);
Expand Down

0 comments on commit 69a2ba9

Please sign in to comment.